-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
buildFHSUserEnv: extend PATH and LD_LIBRARY_PATH #62040
Conversation
This allows one to run applications from PATH and override libraries for applications inside chrootenv. Useful for development environments.
I'll merge it in several days if there are no objections. |
I think it make sense to match the behavior of |
@Mic92 What exactly do you mean? |
I mean that a |
Ah, yes. No `--pure` flag for now but buildFHSUserEnv isn't generally suited for isolation.
…On May 25, 2019 12:01:40 PM GMT+03:00, "Jörg Thalheim" ***@***.***> wrote:
I mean that a `nix-shell` environment would also keep `PATH` unmodified
unless the `--pure` flag is used.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#62040 (comment)
--
Nikolay.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this would e.g. also make #61839 possible.
If it should be configurable we could introduce an attribute like pure ? false
that can be passed to env.nix
via buildFHSUserEnv
(@Mic92 would that be enough?).
(Or we could do something like nix-shell
does and store the original PATH
to another environment variable like HOST_PATH
.)
@@ -52,8 +52,8 @@ let | |||
etcProfile = writeText "profile" '' | |||
export PS1='${name}-chrootenv:\u@\h:\w\$ ' | |||
export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive' | |||
export LD_LIBRARY_PATH='/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32' | |||
export PATH='/run/wrappers/bin:/usr/bin:/usr/sbin' | |||
export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32:$LD_LIBRARY_PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lose the "
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Care to elaborate? I would keep them as they don't cause any harm (and I personally prefer quoting everything by default). While it shouldn't make a difference for Bash, there are or at least where shell where it does make a difference (IIRC).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section 2.3 Token Recognition from http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03 specifies this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter much, I'll merge
This pull request has been mentioned on Nix community. There might be relevant details there: |
This allows one to run applications from PATH and override libraries for
applications inside chrootenv.
Motivation for this change
Useful for development environments.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Tested by running Steam and my local development environments.