Closed grahamgill closed 4 years ago
Thanks for filing the issue. I think https://github.com/JuliaPy/PyCall.jl/pull/841 should fix this.
Can I control the version of PyCall that is pulled in to make a sysimage? Can I use an existing PyCall installation rather than always downloading a version to the temporary environment?
@tkf Would it be feasible to allow pulling a Project and/or Manifest, if supplied, into the temporary environment used for creating a sysimage including PyCall, and then Pkg.add
ing or Pkg.instantiate
ing to control versions of PyCall and its dependencies? We have a mixed python and julia project with a build process we'd like to be able to lock down. If you think that's a reasonable approach I would take a stab at it.
Yeah, I agree that's a great idea. We'll have it once #422 is merged.
Thanks @tkf. The custom sysimage builds for me with PyCall 1.92.1 and is usable in the context of the julia module in python.
Now I'm back to a set of warnings when building the custom sysimage that look like the following. This is with Julia 1.4.2. Is this considered normal?
>>> build_sysimage("lib/pj_rr_sys.so", base_sysimage="lib/rr_sys.so", compiler_env=".")
Activating new environment at `/tmp/tmp.pyjulia.sysimage.9cemj3bm/Project.toml`
[ Info: Loading PackageCompiler...
[ Info: Installing PyCall...
Activating new environment at `/tmp/tmp.pyjulia.sysimage.9cemj3bm/Project.toml`
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Installed PyCall ─ v1.92.1
Updating `/tmp/tmp.pyjulia.sysimage.9cemj3bm/Project.toml`
[438e738f] + PyCall v1.92.1
Updating `/tmp/tmp.pyjulia.sysimage.9cemj3bm/Manifest.toml`
[8f4d0f93] + Conda v1.4.1
[682c06a0] + JSON v0.21.1
[1914dd2f] + MacroTools v0.5.5
[69de0a69] + Parsers v1.0.10
[438e738f] + PyCall v1.92.1
[81def892] + VersionParsing v1.2.0
[2a0f44e3] + Base64
[ade2ca70] + Dates
[8ba89e20] + Distributed
[b77e0a4c] + InteractiveUtils
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[56ddb016] + Logging
[d6f4376e] + Markdown
[a63ad114] + Mmap
[de0858da] + Printf
[9a3f8284] + Random
[9e88b42a] + Serialization
[6462fe0b] + Sockets
[8dfed614] + Test
[4ec0a83e] + Unicode
Building PyCall → `~/.julia/packages/PyCall/BcTLp/deps/build.log`
[ Info: Compiling system image...
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):33 =#, Expr(:function, Expr(:call, :package_slug, Expr(:::, :uuid, :UUID), Expr(:kw, Expr(:::, :p, :Int), 5)), Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):34 =#, :crc = Expr(:call, :_crc32c, :uuid), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):35 =#, :crc = Expr(:call, :_crc32c, "/home/graham/.local/bin/julia-py", :crc), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):36 =#, Expr(:return, Expr(:call, :slug, :crc, :p)))))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID, Int64) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, Expr(:call, :julia_exename) = Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, "/home/graham/.local/bin/julia-py"))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition julia_exename() in module Base at util.jl:497 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:52.
** incremental compilation may be fatally broken for this module **
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0]
│ exception = Required dependency MacroTools [1914dd2f-81c6-5fcd-8719-6d5c9610ff09] failed to load from a cache file.
└ @ Base loading.jl:1041
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):33 =#, Expr(:function, Expr(:call, :package_slug, Expr(:::, :uuid, :UUID), Expr(:kw, Expr(:::, :p, :Int), 5)), Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):34 =#, :crc = Expr(:call, :_crc32c, :uuid), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):35 =#, :crc = Expr(:call, :_crc32c, "/home/graham/.local/bin/julia-py", :crc), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):36 =#, Expr(:return, Expr(:call, :slug, :crc, :p)))))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID, Int64) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, Expr(:call, :julia_exename) = Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, "/home/graham/.local/bin/julia-py"))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition julia_exename() in module Base at util.jl:497 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:52.
** incremental compilation may be fatally broken for this module **
┌ Warning: Module VersionParsing with build ID 23786452100182 is missing from the cache.
│ This may mean VersionParsing [81def892-9a0e-5fdd-b105-ffc91e053289] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1016
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):33 =#, Expr(:function, Expr(:call, :package_slug, Expr(:::, :uuid, :UUID), Expr(:kw, Expr(:::, :p, :Int), 5)), Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):34 =#, :crc = Expr(:call, :_crc32c, :uuid), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):35 =#, :crc = Expr(:call, :_crc32c, "/home/graham/.local/bin/julia-py", :crc), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):36 =#, Expr(:return, Expr(:call, :slug, :crc, :p)))))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID, Int64) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, Expr(:call, :julia_exename) = Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, "/home/graham/.local/bin/julia-py"))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition julia_exename() in module Base at util.jl:497 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:52.
** incremental compilation may be fatally broken for this module **
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):33 =#, Expr(:function, Expr(:call, :package_slug, Expr(:::, :uuid, :UUID), Expr(:kw, Expr(:::, :p, :Int), 5)), Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):34 =#, :crc = Expr(:call, :_crc32c, :uuid), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):35 =#, :crc = Expr(:call, :_crc32c, "/home/graham/.local/bin/julia-py", :crc), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):36 =#, Expr(:return, Expr(:call, :slug, :crc, :p)))))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID, Int64) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, Expr(:call, :julia_exename) = Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, "/home/graham/.local/bin/julia-py"))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition julia_exename() in module Base at util.jl:497 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:52.
** incremental compilation may be fatally broken for this module **
┌ Warning: Module MacroTools with build ID 23803869645542 is missing from the cache.
│ This may mean MacroTools [1914dd2f-81c6-5fcd-8719-6d5c9610ff09] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1016
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):33 =#, Expr(:function, Expr(:call, :package_slug, Expr(:::, :uuid, :UUID), Expr(:kw, Expr(:::, :p, :Int), 5)), Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):34 =#, :crc = Expr(:call, :_crc32c, :uuid), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):35 =#, :crc = Expr(:call, :_crc32c, "/home/graham/.local/bin/julia-py", :crc), #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):36 =#, Expr(:return, Expr(:call, :slug, :crc, :p)))))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: Method definition package_slug(Base.UUID, Int64) in module Base at loading.jl:144 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:34.
** incremental compilation may be fatally broken for this module **
WARNING: eval into closed module Base:
Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, Expr(:call, :julia_exename) = Expr(:block, #= Symbol("/home/graham/.local/lib/python3.8/site-packages/julia/patch.jl"):52 =#, "/home/graham/.local/bin/julia-py"))
** incremental compilation may be fatally broken for this module **
WARNING: Method definition julia_exename() in module Base at util.jl:497 overwritten at /home/graham/.local/lib/python3.8/site-packages/julia/patch.jl:52.
** incremental compilation may be fatally broken for this module **
┌ Warning: Module VersionParsing with build ID 23786452100182 is missing from the cache.
│ This may mean VersionParsing [81def892-9a0e-5fdd-b105-ffc91e053289] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1016
[ Info: PackageCompiler: creating system image object file, this might take a while...
[ Info: System image is created at /home/graham/projects/julia/RecommendRebalance/lib/pj_rr_sys.so
>>>
Hmm... I thought I suppressed these warnings (but I'm not sure). These warnings are expected. I think they should be harmless.
Thanks @tkf
I see PyCall 1.92.0 was just released.
Now my system image build, of the pyjulia system image on top of a custom sysimage, is failing. See the output.
I've tried under both Julia 1.4.2 and 1.5.2, Python 3.8.5, Pyjulia 0.5.6.
Actually building on top of the standard julia sysimage breaks also, with the same errors produced, using
build_sysimage("lib/test.so", compiler_env=".")
andbuild_sysimage("lib/test.so")
.When PyCall 1.91.4 was the latest version, that was used, and the build succeeded, although with warnings about "incremental precompilation of this module may be fatally broken" or similar when I was building the pyjulia sysimage on top of the custom sysimage.
Can I control the version of PyCall that is pulled in to make a sysimage? Can I use an existing PyCall installation rather than always downloading a version to the temporary environment?
At worst I can simply not do the pyjulia sysimage build on top of the custom sysimage, since using the custom sysimage directly with e.g.
jl = Julia(sysimage="lib/rr_sys.so")
seems to work, just giving a moderately slower startup time.