|
export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" |
Why does buildFHSEnv include /usr/lib and /usr/lib64 in LD_LIBRARY_PATH? Having them mounted at those locations should be sufficient for apps built for FHS systems to work.
Including them in LD_LIBRARY_PATH causes these libraries to be used even for nix-built packages with proper dependencies on store paths, leading to runtime crashes. An example of this sort of crash occurs when running nix inside a shell inside vscode-fhs as it runs against incorrect libraries.
Is there a case where FHS binaries require LD_LIBRARY_PATH as well?
I've tested vscode-fhs and steam with a small patch to remove these two entries and they work fine but I'd assume there was some reason for including these and I've just not tested it.
@Atemu
Some examples of issues I've ran into that had this as a root cause, when running programs inside a FHS shell:
$ fish: Job 5, 'whoami' terminated by signal SIGSEGV (Address boundary error)
fish: Job 4, 'basename (string trim -l -c '-'…' terminated by signal SIGSEGV (Address boundary error)
fish: Process 352878, 'wc' from job 3, 'jobs -c | command wc -l' terminated by signal SIGSEGV (Address boundary error)
fish: Process 352841, 'sed' from job 2, '__fish_git_prompt | command sed…' terminated by signal SIGSEGV (Address boundar
$ nixpkgs-fmt .
*** stack smashing detected ***: terminated
fish: Job 1, 'nixpkgs-fmt .' terminated by signal SIGABRT (Abort)
nixpkgs/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix
Line 86 in f2efc7f
Why does
buildFHSEnvinclude /usr/lib and /usr/lib64 in LD_LIBRARY_PATH? Having them mounted at those locations should be sufficient for apps built for FHS systems to work.Including them in LD_LIBRARY_PATH causes these libraries to be used even for nix-built packages with proper dependencies on store paths, leading to runtime crashes. An example of this sort of crash occurs when running nix inside a shell inside vscode-fhs as it runs against incorrect libraries.
Is there a case where FHS binaries require LD_LIBRARY_PATH as well?
I've tested vscode-fhs and steam with a small patch to remove these two entries and they work fine but I'd assume there was some reason for including these and I've just not tested it.
@Atemu
Some examples of issues I've ran into that had this as a root cause, when running programs inside a FHS shell: