config: make strip a bool_flag#3526
Closed
malt3 wants to merge 1 commit intobazel-contrib:masterfrom
malt3:fix/strip-flag
Closed
config: make strip a bool_flag#3526malt3 wants to merge 1 commit intobazel-contrib:masterfrom malt3:fix/strip-flag
malt3 wants to merge 1 commit intobazel-contrib:masterfrom
malt3:fix/strip-flag
Conversation
Member
|
I do see one reason: Bazel's Did you check whether this works? Do you have a use case which for stripping Go but not other languages? |
Contributor
Author
I added this to my .bazelrc: |
Contributor
Author
|
Superseded by #3527 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
Allows specifying the
stripconfig setting via a flag. This allows configuration of the strip setting via a bazel command line flag and makes it easier to switch between stripped and non-stripped builds.Which issues(s) does this PR fix?
Fixes #3325
Other notes for review
As far as I can tell, changing this setting to be a bool_flag just works. It does perform stripping as expected1. I couldn't find any reason as to why the strip setting is handled differently from the rest. If there was a reason, please state it and we can close this.
Edit: This is one possible resolution. See also #3527 for an alternative solution that respects the global bazel strip setting.
Footnotes
running
fileon a resulting binary when using the flag showsELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=redacted, not stripped, while it showsELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=redacted, with debug_info, not strippedwithout the flag. This seems to be consistent with what the docs say about this flag (it is equivalent to-won thego buildoptions). I was expecting this to also set-sfor the go build options which would change the last part of the output to saystripped, but this is a separate issue. ↩