-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
PATH should prioritize user defined packages #38657
Comments
/cc @Ericson2314 who knows about this stdenv stuff Here's the full PATH if it helps:
It appears to be macOS only. |
Yeah the way we do these sorts of things is all screwed up. |
#31414 started to fix it but I ran into errors with libcs and the like. Yet another thing that would be easier if compilers never built their own libraries. |
Now the nix-shell will generate a nix expression that looks like this: with import <nixpkgs> {}; runCommand "shell" { nativeBuildInputs = [ (...) (...) (...) ]; } from $ nix-shell --packages ... ... ... Fixes the issue described in NixOS/nixpkgs#38657.
Now the nix-shell will generate a nix expression that looks like this: with import <nixpkgs> {}; runCommand "shell" { nativeBuildInputs = [ (...) (...) (...) ]; } from $ nix-shell --packages ... ... ... Fixes the issue described in NixOS/nixpkgs#38657.
I think the core issue is just that we always process native build inputs (even default ones) before buildInputs. I think the easiest solution is to just use nativeBuildInputs here. I've opened a PR to fix this in nix-shell: |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
When I'm trying to run a script using
nix-shell
,$PATH
contains several folders starting withcoreutils
from standard environment:Unfortunately, since
coreutils
is in front, it will be looked into first. That means, in case of a conflict, binaries fromcoreutils
will always be picked.In the case above,
shell_cmds
containsmktemp
for Mac OS which is slightly different from GNU's one, but there is no easy way to make the script insidenix-shell
to usemktemp
fromshell_cmds
.I think a solution here is to always put packages defined by user in front of the
PATH
and put all the default stuff in the end.The text was updated successfully, but these errors were encountered: