DYLD_LIBRARY_PATH should be updated with pixi path
Checks
-
[x] I have checked that this issue has not already been reported.
-
[x] I have confirmed this bug exists on the latest version of pixi, using
pixi --version.
Reproducible example
build some binary in mac os that depends on python using pixi and then run the binary
pixi add python
pixi r make
pixi r some-binary-depends-on-python
it will output error:
dyld[97647]: Library not loaded: @rpath/libpython3.12.dylib
Issue description
update the env manually could fix the issue
[project]
channels = ["conda-forge"]
name = "abc"
platforms = ["osx-arm64"]
[dependencies]
python = "==3.12.10"
[tasks]
xmake = {cmd="xmake", env={DYLD_LIBRARY_PATH="$PIXI_PROJECT_ROOT/.pixi/envs/default/lib:$DYLD_LIBRARY_PATH"}}
Expected behavior
pixi run command should setup DYLD_LIBRARY_PATH prepended with $PIXI_PROJECT_ROOT/.pixi/envs/default/lib automatically, just as PATH env variable
In general this sounds like a binary was built in a wrong way. Usually the rpath is injected in the dylib so that it is relative to the path of the library, whcih makes it unecessary to do anything with the DYLD_LIBRARY_PATH.
If your software is open source I would be happy to take a look at the package / the recipe.
If not, you can use otool to find out what's wrong and look in the recipe wheter relocation patching was disabled.
There is nothing actionable here for us, but feel free to reopen if you have more questions!