-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a fragment with paths to standard utilities like ln, grep, etc. #4681
Comments
This generally kills hermeticity, so we must avoid using shell. The proposed approach with specifying locations of common utilities like ‘ln’ and ‘grep’ as argument to toolchain creating function should suffice until bazelbuild/bazel#4681 is implemented in Bazel itself. After that the ‘ln_location’ and ‘grep_location’ arguments may be removed.
This generally kills hermeticity, so we must avoid using shell. The proposed approach with specifying locations of common utilities like ‘ln’ and ‘grep’ as argument to toolchain creating function should suffice until bazelbuild/bazel#4681 is implemented in Bazel itself. After that the ‘ln_location’ and ‘grep_location’ arguments may be removed.
@gregestren assigning this to configurability, please re-prioritize if it's not a P1. Thanks! |
@laszlocsomor - would #5265 cover this need? |
@gregestren -- Even though they are closely related, I don't think so. #5265 provides the foundation, this issue asks for the interface. |
My hope is that if binutils can be expressed as a toolchain, this request can be fulfilled by the toolchain API instead of a new |
Closing. We don't want to add to fragments, and a shell toolchain would solve the problems. |
Description of the feature request
If we had a fragment, e.g.
ctx.fragments.binutils
that allowed us to get locations (full paths) to various utilities likeln
andgrep
, we could perform some actions (such as symlink creation) without resorting toctx.actions.run_shell
oruse_default_shell_env = True
(forctx.actions.run
) and that in turn would allow for better hermeticity and control over build environment.What underlying problem are you trying to solve with this feature?
When we call e.g.
grep
, some users report errors because although it is on theirPATH
, it's not in standard location, and so we have to enableuse_default_shell_env
for ourrun
actions or equivalently resort toctx.actions.run_shell
which brings too much in scope and hurts hermeticity.Have you found anything relevant by searching the web?
No.
Any other information, logs, or outputs that you want to share?
No.
The text was updated successfully, but these errors were encountered: