Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
shell toolchain, design: including common bintools #5265
Description of the problem / feature request:
Design a mechanism to express that a rule executing a shell command depends on certain command line tools.
Feature requests: what underlying problem are you trying to solve with this feature?
Not every machine has Bash installed, and those that do don't always install Bash at the same location, or have another shell interpreter installed. To accommodate all scenarios, I designed how to turn Bash, or broadly speaking, the Shell, into a toolchain. The efforts is tracked as #4319.
However what Bazel treats as "the shell" is more than just the shell interpreter. Bazel assumes that not only Bash is the shell and it's installed at a fixed location, but also that common GNU binutils and other common programs such as "zip" or "grep" are also installed and are on the PATH.
Rules that execute shell commands also expect these tools to exist and be on the PATH. Bazel currently has no way to express that such rules depend on these tools.