Skip to content
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

Closed
mrkkrp opened this issue Feb 22, 2018 · 5 comments
Closed
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request

Comments

@mrkkrp
Copy link
Contributor

mrkkrp commented Feb 22, 2018

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 like ln and grep, we could perform some actions (such as symlink creation) without resorting to ctx.actions.run_shell or use_default_shell_env = True (for ctx.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 their PATH, it's not in standard location, and so we have to enable use_default_shell_env for our run actions or equivalently resort to ctx.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.

@aehlig aehlig added type: feature request P1 I'll work on this now. (Assignee required) category: extensibility > skylark labels Feb 26, 2018
mrkkrp added a commit to tweag/rules_haskell that referenced this issue Mar 12, 2018
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.
mrkkrp added a commit to tweag/rules_haskell that referenced this issue Mar 12, 2018
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.
@jin jin added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Feb 20, 2019
@jin
Copy link
Member

jin commented Feb 20, 2019

@gregestren assigning this to configurability, please re-prioritize if it's not a P1. Thanks!

@gregestren
Copy link
Contributor

@laszlocsomor - would #5265 cover this need?

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Feb 21, 2019

@gregestren -- Even though they are closely related, I don't think so. #5265 provides the foundation, this issue asks for the interface.

@gregestren
Copy link
Contributor

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 ctx.fragments, which we're trying to move away from.

@gregestren gregestren added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed P1 I'll work on this now. (Assignee required) labels Feb 21, 2019
@aiuto
Copy link
Contributor

aiuto commented Oct 6, 2021

Closing. We don't want to add to fragments, and a shell toolchain would solve the problems.

@aiuto aiuto closed this as completed Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request
Projects
None yet
Development

No branches or pull requests

7 participants