Skip to content

Config options for specific chips #3020

@MabezDev

Description

@MabezDev

Following on from the discussion here: #3001 (comment)

We might want a better solution than just documenting which cfg's are supported on each chip (the current solution).

We one quite large constraint when building this:

  • we can't break builds when a config option is passed by the user, but the current target doesn't support that option. Doing so would break multi chip project setups.

With this constraint in mind, we still need to signal that the option isn't supported.

One idea I had:

(ab)use cargo cfg linting

Where a cfg isn't supported, we could choose not to emit this line:

println!("cargo:rustc-check-cfg=cfg({cfg_name})");
.

This would flag a warning in user code, that the cfg they're trying to use has no effect. Unfortunately I don't think we can control the error message here, so the message is quite vague - but maybe something we could document in an FAQ.

I would appreciate some more input/ideas here :).

I'm adding the 1.0 blocker label, though we might be able to add this later if we go with the above solution (iirc, introducing warnings is not a breaking change).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Todo

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions