Skip to content

add suppress_warnings feature#367

Merged
aaronsky merged 2 commits intobazelbuild:masterfrom
aaronsky:aaronsky/feat-suppress-warnings
Feb 10, 2025
Merged

add suppress_warnings feature#367
aaronsky merged 2 commits intobazelbuild:masterfrom
aaronsky:aaronsky/feat-suppress-warnings

Conversation

@aaronsky
Copy link
Copy Markdown
Contributor

@aaronsky aaronsky commented Feb 9, 2025

This is something I could use in my codebase. I would like have a way to propagate the -w flag to all clang-using targets, and specifically, selectively disable it in my REPO.bazel and individual targets. This would allow me to globally suppress warnings for external repositories, without enabling it in my own code, and without needing to juggle the state of the flag setting (-w and other diagnostic flags are mutually exclusive afaik). This is the same as how we organize the treat_warnings_as_errors feature today.

Companion change in rules_swift is bazelbuild/rules_swift#1489

@aaronsky aaronsky marked this pull request as ready for review February 9, 2025 20:13
Copy link
Copy Markdown
Member

@keith keith left a comment

Choose a reason for hiding this comment

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

seems good to me. i think the only thing to think about with these is where we want to "draw the line" so we don't have a feature per compiler flag. but i totally agree with the benefits of the feature system being easier than passing copts in some cases.

@luispadron
Copy link
Copy Markdown
Contributor

seems good to me. i think the only thing to think about with these is where we want to "draw the line" so we don't have a feature per compiler flag. but i totally agree with the benefits of the feature system being easier than passing copts in some cases.

Agree! Think this is fine since it's the inverse of an existing feature, but we shouldn't make one for all copts

@aaronsky
Copy link
Copy Markdown
Contributor Author

yup, agreed!

@aaronsky aaronsky merged commit 5e579c7 into bazelbuild:master Feb 10, 2025
1 check passed
aaronsky added a commit to bazelbuild/rules_swift that referenced this pull request Feb 10, 2025
This is something I could use in my codebase. I would like have a way to
propagate the `-suppress-warnings` flag to all swift libraries, and
specifically, selectively disable it in my REPO.bazel and individual
targets. This would allow me to globally suppress warnings for external
repositories, without enabling it in my own code, and without needing to
juggle the state of the flag setting (`-suppress-warnings` and other
diagnostic flags are mutually exclusive afaik). This is the same as how
we organize the `swift.warnings_as_errors` feature today.

Companion change in apple_support is bazelbuild/apple_support#367
@aaronsky aaronsky deleted the aaronsky/feat-suppress-warnings branch February 10, 2025 18:35
aaronsky added a commit to aaronsky/rules_swift that referenced this pull request Feb 11, 2025
This is something I could use in my codebase. I would like have a way to
propagate the `-suppress-warnings` flag to all swift libraries, and
specifically, selectively disable it in my REPO.bazel and individual
targets. This would allow me to globally suppress warnings for external
repositories, without enabling it in my own code, and without needing to
juggle the state of the flag setting (`-suppress-warnings` and other
diagnostic flags are mutually exclusive afaik). This is the same as how
we organize the `swift.warnings_as_errors` feature today.

Companion change in apple_support is bazelbuild/apple_support#367
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.

3 participants