Allow safe stripping of Bazel binary
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 75
Description
### Description of the problem / feature request:
Please consider implementing a means of safely stripping the Bazel binary. I see two possible means by which this might be achieved:
1. Document [strip command](https://manpages.debian.org/unstable/binutils-common/strip.1.en.html) options that would allow debug symbols to be removed without also removing the embedded zip file.
2. Provide (or document, if it exists already) a means by which a "skinny" Bazel binary could be built that would not contain the embedded zip and could therefore be safely stripped. This is the preferred solution from a Debian perspective since we are already packaging Bazel with an extracted system-level installation base that we point to upon execution with `--install_base`.
### Feature requests: what underlying problem are you trying to solve with this feature?
Stripping release binaries is common practice and even required in many cases for both speed and storage efficiency. For example, this is a [requirement in Debian](https://www.debian.org/doc/debian-policy/ch-files.html#binaries) and produces a [packaging error](https://lintian.debian.org/tags/unstripped-binary-or-object.html) if skipped.
### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Strip the Bazel binary with `strip --strip-unneeded` or `strip --strip-debug`.
$ bazel version
Opening zip "/proc/self/exe": open(): No such file or directory
FATAL: Failed to open '/proc/self/exe' as a zip file: (error: 2): No such file or directory
### What operating system are you running Bazel on?
Debian Unstable
### What's the output of `bazel info release`?
Same as `bazel version` above.
### If `bazel info release` returns "development version" or "(@non-git)", tell us how you built Bazel.
Built as part of Debian package for #9408.
### Have you found anything relevant by searching the web?
Yes. The stripping problem seem to be a known issue as shown in #600.
Contributor guide
Assessment
This issue has not been assessed yet.