-
Notifications
You must be signed in to change notification settings - Fork 696
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
Dependency executables aren't in PATH #3417
Comments
Yes, proper handling of executables and the path, both for build tools and also for the things you're building is a significant missing feature. The plan is roughly: have a ./dist/bin dir where all the built exes from this project go. For binaries of dependencies there's a couple things we can do. One is just extend the $PATH for only when we're building things, but the other is to have an env that you can use from your shell and be able to run these tools too. So that way we can support a If anyone wants to help with this it'd be much appreciated. There's plenty to do. |
A number of comments:
So, it's a bit fiddly, needs to be tested properly, but shouldn't be very much code. CC @acfoltzer |
I consider the current practice of expecting executables to be built for dependencies mentioned in So I strongly support to have executables only being (possibly) built and brought into PATH via Allowing transitive leakage would break the general design principle followed in |
@hvr I have considered this in #2965. I think it is the right way to go about doing it, but one trouble is that there is no necessary correspondence between a
Duncan has suggested that we hard-code a mapping into Cabal from build-tools to package names for legacy purposes. I have suggested that we introduce a new field And yes, it would be a simple matter to solve these separately ala setup dependencies. |
@ezyang I like the idea to hard-code (or rather make the legacy mapping a config setting with a default-value in Maybe we should try to come up with one or two concrete specifications, write them down, and decide which one qualifies as the best way forward. I believe we should tackle this rather sooner than later, and I'd like to help with implementing this one once we have decided on a plan. Also, some packages are already adapting to |
OK I wrote in a proposal to the top of #220 |
Note: modifying |
This is fixed in HEAD. |
I should note that the ProgramDb and that infrastructure has quite good support for altering the $PATH (or other env vars) of programs that will be invoked. We should use this (or extend as needed) and try to avoid mutating process state like our own env or cwd. |
To fix #1541, we have to set PATH. Additionally, internal build-tools that are built separately via per-component build won't have entries in the ProgramDb, which can only be setup by Custom setup scripts. So in that case, we must use PATH, and then there's not much reason not to use PATH for everything else. |
Summary @ezyang. There's an easy fix for this which should only take an afternoon to implement: for each direct dependency, if it contains any executables, add the PATH of the executables to the environment when we are building. There are two primary risks: (1) how do you actually add the PATH to the environment, and (2) if there is a PATH limitation that we butt into.
While trying to use
cabal new-build
onservant
:The executable is clearly not in
$PATH
:(The text was updated successfully, but these errors were encountered: