JuliaLang / JuliaLang/PackageCompiler.jl

Create app with conda dependencies

Open
#752 2 comments 4 reactions 0 assignees View on GitHub
question
Dominant language
Julia
Stars
1.6k
Forks
205
Avg merge
18h 37m
Merged PRs (30d)
7

Description

I'm trying to create a relocatable app that has Python/Conda dependencies. E.g., in the simplest case, I'm creating an app that has PyPlot as the only dependency:

```name = "TestApp"
uuid = "60e04576-4d8c-4856-bc57-482afded9445"
authors = ["user"]
version = "0.1.0"

[deps]
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
```

The app itself looks like this (i.e. a simplified version of the example from PackageCompiler.jl):

```
module TestApp

using PyPlot

function julia_main()::Cint
try
real_main()
catch
Base.invokelatest(Base.display_error, Base.catch_stack())
return 1
end
return 0
end

function real_main()
@show ARGS
@show Base.PROGRAM_FILE
@show DEPOT_PATH
@show LOAD_PATH
@show pwd()
@show Base.active_project()
@show Sys.BINDIR

@show Base.JLOptions().opt_level
@show Base.JLOptions().nthreads
@show Base.JLOptions().check_bounds

display(Base.loaded_modules)
println()

println("Running a jll package:")

return
end

end # module
```

Creating the app with `create_app("TestApp", "TestAppCompiled")` works as expected and I can run the binary. However, once I zip the compiled app and run it on a different machine, I'm getting a library error:

`InitError(mod=:PyCall, error=ErrorException("could not load library "/home/user/.julia/conda/3/lib/libpython3.9.so.1.0"`

So, it looks like conda was not included in the app and instead the library file from my local Julia installation is used. Any suggestions on how to address this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the create_app("TestApp", "TestAppCompiled") entry point and trace how the compiled app handles the PyCall library and its Conda dependency. Reproduce the failure by moving the zipped app to another machine, then verify that it no longer resolves libpython3.9.so.1.0 from the original local Julia installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia, python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.