Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Control what is added to the library path #180

Closed
morris25 opened this issue Sep 16, 2019 · 2 comments
Closed

Control what is added to the library path #180

morris25 opened this issue Sep 16, 2019 · 2 comments

Comments

@morris25
Copy link

morris25 commented Sep 16, 2019

It might be a good idea to use more granularity in what we include in "LD_LIBRARY_PATH" when installing executables.

My use-case is this:
I have a private package that installs an openssl dependency using a version of the build script supplied by Yggdrasil. Initially I installed openssl as an ExecutableProduct. This worked perfectly until I created a system image of my project using PackageCompiler.jl. After that every time I would run a curl command through julia I would get an error like:

ERROR: failed process: Process(`curl http://google.com`, ProcessExited(48)) [48]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:705 [inlined]
 [3] read(::Base.CmdRedirect) at ./process.jl:636
 [4] read(::Base.CmdRedirect, ::Type{String}) at ./process.jl:645
 [5] top-level scope at none:0

When I install openssl as a FileProduct the problem no longer occurs, but if any other package builds an ExcecutableProduct the error starts reoccurring.

It seems this problem could be easily fixed by adding the directory of the individual ExcecutableProducts instead of the julia_libdir to the "LD_LIBRARY_PATH" when writing the deps file.

@morris25
Copy link
Author

Apparently I missed this.

When providing ExecutableProducts to a client package, BinaryProvider will automatically append Julia's private library directory to LD_LIBRARY_PATH on Linux, and DYLD_LIBRARY_PATH on macOS. This is due to the fact that the compiled binaries may be dependent on libraries such as libgfortran, which ship with Julia and must be found by the system linker or else the binaries will not function.

It seems like we can't just take the julia_libdir off the path. 😕

@morris25
Copy link
Author

It seems I was mistaken about the source of my problem. The issue actually has nothing to do with openssl at all. The problem seems to be that when julia_libdir("/usr/local/julia/bin/../lib/julia") is added to the LD_LIBRARY_PATH, it pulls in its own curl library.

I'm pretty sure I've seen a similar problem in another issue, so I'm going to close this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant