Skip to content

Allow opting out of RUSTFLAGS env var #536

@janhohenheim

Description

@janhohenheim

What problem does this solve or what need does it fill?

Using a RUSTFLAGS env var silently overrides all rustflags defined in cargo.toml files. That's right, it doesn't merge them :bavy:

This is a major footgun for my setup: my local dev environment uses ~/.cargo/config.toml with a ton of build time optimizations, and my CI sets up a project/.cargo/config.toml with settings for the build, including many of the same build time optimizations.

So it's really important to me that nothing sneaks in a RUSTFLAGS env var

What solution would you like?

Pass --no-rustflags-env to omit any rustflags that could have been built as part of the CLI command

What alternative(s) have you considered?

Make sure that all CLI commands now and in the future individually have an opt-out for rustflags. That seems way less robust to me.

Additional context

This came up in the context of #499, which adds RUSTFLAGS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIRelated to the main CLI and not a more specific subcommandC-FeatureMake something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions