Closed Strum355 closed 4 weeks ago
The current behavior was actually last modified by me in #3527
I looked into Bazel's documented behavior for --strip
. It says:
--strip (always|never|sometimes)
This option determines whether Bazel will strip debugging information from all binaries and shared libraries, by invoking the linker with the -Wl,--strip-debug option.
--strip=always means always strip debugging information.
--strip=never means never strip debugging information.
The default value of --strip=sometimes means strip if the --compilation_mode is fastbuild.
https://bazel.build/docs/user-manual#strip
To the best of my understanding, this works as intended.
I think you're right, Im not sure why I thought otherwise anymore :woozy_face:
What version of rules_go are you using?
0.46.0
What version of gazelle are you using?
0.35.0
What version of Bazel are you using?
7.1.0
Does this issue reproduce with the latest releases of all the above?
yes
What operating system and processor architecture are you using?
x86_64 linux (also tested on macOS)
Any other potentially useful information about your toolchain?
https://github.com/uber/hermetic_cc_toolchain on linux, presumably host toolchain on maOS
What did you do?
bazel build --compilation_mode={fastbuild,dbg,opt} //some/go_binary:target
What did you expect to see?
Setting
--compilation_mode=opt
results in a stripped binary without debug info. The current behaviour may be WIA, in which case this issue can probably be closed.See Bazel slack thread for some discussion https://bazelbuild.slack.com/archives/CDBP88Z0D/p1712748379078069
What did you see instead?