Replies: 1 comment 1 reply
-
I imagine the intent here is that with opt binaries you might want to collect debug info from the binary for debugging crashes later, and then strip it yourself. Note that cc_binary has a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The default value of
--strip
is documented as follows:This results in the following behavior:
bazel build :target # fastbuild, stripped
bazel build :target -c opt # opt, not stripped(!)
It is surprising that switching to "-c opt" could result in the inclusion of debug symbols and the resulting artifact being larger than the default. My expectation would be that "-c opt" would strip debug symbols by default.
This documentation was explicitly used as a spec in rules_go: bazel-contrib/rules_go#3917, resulting in binary size surprisingly growing when "-c opt" is enabled.
It would be more intuitive if the spec was:
Beta Was this translation helpful? Give feedback.
All reactions