Skip to content

New rustc nightly suggests adding a build.rs to use conditional compilation #124800

Closed
@TheBlueMatt

Description

@TheBlueMatt

We use conditional compilation in a lot of places (eg the fuzzing cfg flag is standard to conditionally compile when fuzzing in the rust-fuzz ecosystem) and have a hard rule against unnecessary build.rss (as running build-time code is a red flag when auditing a crate and requires special care). Latest rustc nightly now generates a huge pile of warnings encouraging us to add a build.rs to make them go away, which isn't really acceptable. It seems this is encouraging bad practice to respond to a common practice - is there some way to just list fuzzing and some other super common flags and allow those?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-check-cfg--check-cfgL-unexpected_cfgsLint: unexpected_cfgsP-highHigh priorityT-cargoRelevant to the cargo team, which will review and decide on the PR/issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions