-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error with CodecZstd.jl
and PackageCompiler#v1.6.0
#32
Comments
I'm very sorry, I missed something when investigating this bug last Friday evening: my general Missing this key detail lead me to believe it was somehow related to having both packages in the same env(which was very weird) but now it appears to only be version issue linked to the addition of I'll change to title of this issue accordingly. |
CodecZstd.jl
and PackageCompiler.jl
in same EnvironmentCodecZstd.jl
and PackageCompiler#v1.6.0
|
Of course : CodecZstd v0.7.1 + PackageCompiler v1.6.0(Foo) pkg> st
Project Foo v0.1.0
Status `~/.julia/dev/Foo/Project.toml`
[6b39b394] CodecZstd v0.7.1
[9b87118b] PackageCompiler v1.6.0 `https://github.com/JuliaLang/PackageCompiler.jl.git#v1.6.0`
[44cfe95a] Pkg
julia> using Foo; Foo.create_app_Foo(;force=true)
[ Info: Precompiling Foo [f2f46d47-1d1a-4e6d-96f8-220910b5324c]
[ Info: PackageCompiler: creating base system image (incremental=false)...
[ Info: PackageCompiler: creating system image object file, this might take a while...
[ Info: PackageCompiler: creating system image object file, this might take a while...
ERROR: LoadError: LoadError: LoadError: could not load symbol "ZSTD_maxCLevel":
/home/user/julia-1.6.1/bin/julia: undefined symbol: ZSTD_maxCLevel
Stacktrace:
[1] ZSTD_maxCLevel
@ ~/.julia/packages/CodecZstd/UeOyf/src/libzstd/LibZstd.jl:87 [inlined]
[2] max_clevel()
@ CodecZstd ~/.julia/packages/CodecZstd/UeOyf/src/libzstd.jl:14
[3] top-level scope
@ ~/.julia/packages/CodecZstd/UeOyf/src/libzstd.jl:17
[4] include(mod::Module, _path::String)
@ Base ./Base.jl:386
[5] include(x::String)
@ CodecZstd ~/.julia/packages/CodecZstd/UeOyf/src/CodecZstd.jl:1
[6] top-level scope
@ ~/.julia/packages/CodecZstd/UeOyf/src/CodecZstd.jl:21
[7] include
@ ./Base.jl:386 [inlined]
[8] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1050
[9] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:914
[10] require(into::Module, mod::Symbol)
@ Base ./loading.jl:901
[11] include
@ ./Base.jl:386 [inlined]
[12] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1050
[13] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:914
[14] require(into::Module, mod::Symbol)
@ Base ./loading.jl:901
in expression starting at /home/user/.julia/packages/CodecZstd/UeOyf/src/libzstd.jl:17
in expression starting at /home/user/.julia/packages/CodecZstd/UeOyf/src/CodecZstd.jl:1
in expression starting at /home/user/.julia/dev/Foo/src/Foo.jl:1
ERROR: failed process: Process(`/home/user/julia-1.6.1/bin/julia --color=yes --startup-file=no '--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)' --sysimage=/tmp/jl_JaFrsv/tmp_sys.so --project=/home/user/.julia/dev/Foo --output-o=/tmp/jl_jzzVJt.o -e "Base.reinit_stdio()
@eval Sys BINDIR = ccall(:jl_get_julia_bindir, Any, ())::String
@eval Sys STDLIB = \"/home/user/julia-1.6.1/share/julia/stdlib/v1.6\"
Base.init_load_path()
if isdefined(Base, :init_active_project)
Base.init_active_project()
end
Base.init_depot_path()
import Foo
# This @eval prevents symbols from being put into Main
@eval Module() begin
using Base.Meta
PrecompileStagingArea = Module()
for (_pkgid, _mod) in Base.loaded_modules
if !(_pkgid.name in (\"Main\", \"Core\", \"Base\"))
eval(PrecompileStagingArea, :(const \$(Symbol(_mod)) = \$_mod))
end
end
precompile_files = String[
\"/tmp/jl_HVGiBu\"
]
for file in precompile_files, statement in eachline(file)
try
# println(statement)
# This is taken from https://github.com/JuliaLang/julia/blob/2c9e051c460dd9700e6814c8e49cc1f119ed8b41/contrib/generate_precompile.jl#L375-L393
ps = Meta.parse(statement)
isexpr(ps, :call) || continue
popfirst!(ps.args) # precompile(...)
ps.head = :tuple
l = ps.args[end]
if (isexpr(l, :tuple) || isexpr(l, :curly)) && length(l.args) > 0 # Tuple{...} or (...)
# XXX: precompile doesn't currently handle overloaded Vararg arguments very well.
# Replacing N with a large number works around it.
l = l.args[end]
if isexpr(l, :curly) && length(l.args) == 2 && l.args[1] === :Vararg # Vararg{T}
push!(l.args, 100) # form Vararg{T, 100} instead
end
end
# println(ps)
ps = Core.eval(PrecompileStagingArea, ps)
# XXX: precompile doesn't currently handle overloaded nospecialize arguments very well.
# Skipping them avoids the warning.
ms = length(ps) == 1 ? Base._methods_by_ftype(ps[1], 1, Base.get_world_counter()) : Base.methods(ps...)
ms isa Vector || continue
precompile(ps...)
catch e
# See julia issue #28808
@debug \"failed to execute \$statement\"
end
end
end # module
Base.@ccallable function julia_main()::Cint
try
Foo.julia_main()
catch
Core.print(\"julia_main() threw an unhandled exception\")
return 1
end
end
empty!(LOAD_PATH)
empty!(DEPOT_PATH)
"`, ProcessExited(1)) [1]
Stacktrace:
[1] pipeline_error
@ ./process.jl:525 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:440
[3] run
@ ./process.jl:438 [inlined]
[4] create_sysimg_object_file(object_file::String, packages::Vector{String}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, isapp::Bool, sysimage_build_args::Cmd)
@ PackageCompiler ~/.julia/packages/PackageCompiler/r8Xcy/src/PackageCompiler.jl:371
[5] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, replace_default::Bool, base_sysimage::String, isapp::Bool, julia_init_c_file::Nothing, version::Nothing, compat_level::String, soname::String, cpu_target::String, script::Nothing, sysimage_build_args::Cmd)
@ PackageCompiler ~/.julia/packages/PackageCompiler/r8Xcy/src/PackageCompiler.jl:538
[6] (::PackageCompiler.var"#14#16"{Bool, Nothing, Nothing, String, Cmd, String, Vector{String}, Vector{String}, Bool, Bool, String, String, String, String, Bool})()
@ PackageCompiler ~/.julia/packages/PackageCompiler/r8Xcy/src/PackageCompiler.jl:978
[7] cd(f::PackageCompiler.var"#14#16"{Bool, Nothing, Nothing, String, Cmd, String, Vector{String}, Vector{String}, Bool, Bool, String, String, String, String, Bool}, dir::String)
@ Base.Filesystem ./file.jl:106
[8] _create_app(package_dir::String, dest_dir::String, name::Nothing, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, audit::Bool, force::Bool, cpu_target::String; library_only::Bool, c_driver_program::String, julia_init_c_file::Nothing, header_files::Vector{String}, version::Nothing, compat_level::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd)
@ PackageCompiler ~/.julia/packages/PackageCompiler/r8Xcy/src/PackageCompiler.jl:968
[9] #create_app#11
@ ~/.julia/packages/PackageCompiler/r8Xcy/src/PackageCompiler.jl:771 [inlined]
[10] create_app_Foo(; kwargs::Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:force,), Tuple{Bool}}})
@ Foo ~/.julia/dev/Foo/src/Foo.jl:7
[11] top-level scope
@ REPL[2]:1 So CodecZstd v0.7.1 + PackageCompiler v1.7.0(Foo) pkg> st
Project Foo v0.1.0
Status `~/.julia/dev/Foo/Project.toml`
[6b39b394] CodecZstd v0.7.1
[9b87118b] PackageCompiler v1.7.0
[44cfe95a] Pkg
julia> using Foo; Foo.create_app_Foo(;force=true)
[ Info: Precompiling Foo [f2f46d47-1d1a-4e6d-96f8-220910b5324c]
[ Info: PackageCompiler: creating base system image (incremental=false)...
[ Info: PackageCompiler: creating system image object file, this might take a while...
ERROR: type Dict has no field deps
Stacktrace:
[1] getproperty(x::Dict{Base.UUID, Pkg.Types.PackageEntry}, f::Symbol)
@ Base ./Base.jl:33
[2] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, replace_default::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::String, isapp::Bool, julia_init_c_file::Nothing, version::Nothing, compat_level::String, soname::String)
@ PackageCompiler ~/.julia/packages/PackageCompiler/r1Ahd/src/PackageCompiler.jl:583
[3] (::PackageCompiler.var"#16#18"{Bool, Nothing, Nothing, String, Cmd, Bool, String, Vector{String}, Vector{String}, Bool, Bool, String, String, String, String, Bool})()
@ PackageCompiler ~/.julia/packages/PackageCompiler/r1Ahd/src/PackageCompiler.jl:1039
[4] cd(f::PackageCompiler.var"#16#18"{Bool, Nothing, Nothing, String, Cmd, Bool, String, Vector{String}, Vector{String}, Bool, Bool, String, String, String, String, Bool}, dir::String)
@ Base.Filesystem ./file.jl:106
[5] _create_app(package_dir::String, dest_dir::String, name::Nothing, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, audit::Bool, force::Bool, cpu_target::String; library_only::Bool, c_driver_program::String, julia_init_c_file::Nothing, header_files::Vector{String}, version::Nothing, compat_level::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool)
@ PackageCompiler ~/.julia/packages/PackageCompiler/r1Ahd/src/PackageCompiler.jl:1029
[6] #create_app#13
@ ~/.julia/packages/PackageCompiler/r1Ahd/src/PackageCompiler.jl:819 [inlined]
[7] create_app_Foo(; kwargs::Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:force,), Tuple{Bool}}})
@ Foo ~/.julia/dev/Foo/src/Foo.jl:7
[8] top-level scope
@ REPL[6]:1 Gives us what seems to be a very fixable error, if a bit more obscure since we lose reference to
Not directly. But, yes, the issue does seem to be related to the Artifact system. Thanks for the reply, and your time. |
If the error remains the same, I'm pretty sure that PacakageCompiler.jl is unable to find a LibZstd to link. For PackagerCompiler to do this, you need to create an Artifacts.toml as specified in the link above. This is really more than a PackageCompiler.jl issue than a CodecZstd.jl. I'll ping @KristofferC for you though in case he's willing to help you on this issue here. Otherwise, I would suggest either creating an issue there if you still have problems trying Artifacts.toml or posting on Discourse. |
Understood, thanks for looking into it. |
Could you try with the latest PackageCompiler version now? |
Works now!(Foo) pkg> st
Project Foo v0.1.0
Status `~/.julia/dev/Foo/Project.toml`
[6b39b394] CodecZstd v0.7.1
[9b87118b] PackageCompiler v1.7.4
[44cfe95a] Pkg
julia> using Foo; Foo.create_app_Foo(;force=true)
[ Info: PackageCompiler: creating base system image (incremental=false)...
[ Info: PackageCompiler: creating system image object file, this might take a while...
Precompiling project...
13 dependencies successfully precompiled in 11 seconds
[ Info: PackageCompiler: creating system image object file, this might take a while... @KristofferC Looks good, many thanks! 😄 @mkitti closing this now since using the latest version of both packages will prevent the issue |
Hello,
I seem to be encountering a strange error when compiling a module which list
PackageCompiler
andCodecZstd
as dependenciesPlease consider :
When running
I get the following error
Stacktrace
Of note:
PackageCompiler.create_sysimage()
I'm not having any problems whenThis note was a mistake, please see message bellowFoo.jl
doesn't listPackageCompiler
directly + usingPackageCompiler
from thev1.6
env.TranscodingStreams.jl
codec packagesVersion
Project
Manifest
Please let me know if you need additional details.
The text was updated successfully, but these errors were encountered: