On 2023-12-29 04:58, Maxim Cournoyer wrote:
Hi,
Apoorv via "Development of GNU Guix and the GNU System distribution."
<guix-devel@gnu.org> writes:
I want to make a suggestion for a feature for guix shell.
I was recently writing guix.scm files for my projects and was having
problem with the libraries I added, not being found inside the
shell. After struggling for hours I finally learned that that the
LD_LIBRARY_PATH is not being updated automatically inside the guix
shell environment so the libraries can be found easily.
So my feature suggestion is that maybe we can have a flag or a option
for guix shell, something like --add-ld-path or --update-ld-path for
example, to add all libraries specified in the guix.scm or even as
sub-command guix shell --add-ld-path mesa as an example, to
automatically update the LD_LIBRARY_PATH environment variable to
contain the correct paths to these libraries so they can be found
easily inside the shell.
Guix doesn't/shouldn't make use of LD_LIBRARY_PATH, except in rare cases
to wrap binaries. It's better to patch the dlopen calls to use the
absolute shared library file name.
Perhaps you are missing the package configuring LIBRARY_PATH and other
useful environment variables for finding libraries? That'd be
gcc-toolchain, if I recall correctly.
Hi,
I have a similar issue. I have a project that links GLFW statically, but
I still need to use its dependencies, like x11 and so on. If I make a
shell like:
guix shell -D glfw
I don't have access to those libraries, but they are in my GUIX_PROFILE.
The only way to access them is setting LD_LIBRARY_PATH. It doesn't
matter if I have `gcc-toolchain` installed or not. Why is this?
The search path is hardcoded in the statically built GLFW?
How can we make this usecase simpler (mostly for development)?
Thanks,
Ekaitz