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
make-wrapper: prevent duplicate path entries #104665
base: staging
Are you sure you want to change the base?
make-wrapper: prevent duplicate path entries #104665
Conversation
Dependencies such as GTK are widely used and set by both WMs and X applications. Due to cascading effects, these paths can get quite long with many duplicates, and exceed `PATH_MAX`. This is turn causes some applications to break (e.g. `firejail` with recent security patches). This patch makes the wrapper script test whether the entry is already in the path, and extends the path only for new entries.
a1297a8
to
41f320e
Compare
So will this have quadratic runtime in the length of |
All this patch does is prevent duplicate entries on any of the path variables ( Also it's quite harmless to remove duplicate entries from the path. |
If I parse this correctly, this will make And, thanks to bash, the code is even less legible than before 😿 |
|
Yes that's correct. I don't see any good way to solve that automatically. However I could preserve the existing behavior of prefixing when the value is already in the variable. Albeit at the cost of more crazy bash in the wrappers, as we'd then have to rewrite the variables completely.
Sadly so |
I marked this as stale due to inactivity. → More info |
Related: NixOS/rfcs#75
Perhaps what should happen when
With
|
I marked this as stale due to inactivity. → More info |
Motivation for this change
Dependencies such as GTK are widely used and set by both WMs and X
applications. Due to cascading effects, these paths can get quite long with many
duplicates, and exceed
PATH_MAX
. This is turn causes some applications tobreak (e.g.
firejail
with recent security patches).This patch makes the wrapper script test whether the entry is already in the
path, and extends the path only for new entries.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)