Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge cc toolchain flags into build script env #1675

Merged
merged 2 commits into from
Nov 29, 2022

Conversation

illicitonion
Copy link
Collaborator

Right now, setting build_script_env will overwrite the values from the cc_toolchain, which is almost certainly ~always wrong.

Instead, allow appending values, which means that if overrides are necessary people can add them (e.g. disabling specific warnings).

Note: This is technically a breaking change, but one which should improve faithfulness of the build.

Right now, setting build_script_env will _overwrite_ the values from the
cc_toolchain, which is almost certainly ~always wrong.

Instead, allow _appending_ values, which means that if overrides are
necessary people can add them (e.g. disabling specific warnings).

Note: This is technically a breaking change, but one which should
improve faithfulness of the build.
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me! Is there an easy way to have a test for this in //test/cargo_build_script though? Would be nice to decouple this example/integration test with testing the new functionality.

@illicitonion
Copy link
Collaborator Author

Unfortunately I don't think there's an easy way to - we'd need to have a cc_toolchain set up which provided non-empty flags here, which is complex to do. This example, which has one set up, seems like a very convenient place to avoid needing to set one up custom for test, but if anyone wants to / knows how, I'm happy to pick that up!

@illicitonion illicitonion merged commit 025bf7d into bazelbuild:main Nov 29, 2022
@illicitonion illicitonion deleted the merge-flags branch November 29, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants