Skip to content
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

Closed
Felix-Gauthier opened this issue Oct 1, 2021 · 7 comments
Closed

Comments

@Felix-Gauthier
Copy link

Felix-Gauthier commented Oct 1, 2021

Hello,

I seem to be encountering a strange error when compiling a module which list PackageCompiler and CodecZstd as dependencies

Please consider :

module Foo

using Pkg, CodecZstd, PackageCompiler

julia_main()::Cint = 0

create_app_Foo(; kwargs...) = create_app(pkgdir(Foo), normpath(joinpath(pkgdir(Foo), "..", "$(Foo)_App")); kwargs...)

end # end Foo

When running

julia> using Foo; Foo.create_app_Foo(; force=true)

I get the following error

Stacktrace
[ 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] max_clevel()
    @ CodecZstd ~/.julia/packages/CodecZstd/vGFup/src/libzstd.jl:14
  [2] top-level scope
    @ ~/.julia/packages/CodecZstd/vGFup/src/libzstd.jl:17
  [3] include(mod::Module, _path::String)
    @ Base ./Base.jl:386
  [4] include(x::String)
    @ CodecZstd ~/.julia/packages/CodecZstd/vGFup/src/CodecZstd.jl:1
  [5] top-level scope
    @ ~/.julia/packages/CodecZstd/vGFup/src/CodecZstd.jl:20
  [6] include
    @ ./Base.jl:386 [inlined]
  [7] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1050
  [8] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [9] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
 [10] include
    @ ./Base.jl:386 [inlined]
 [11] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1050
 [12] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
 [13] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
in expression starting at /home/user/.julia/packages/CodecZstd/vGFup/src/libzstd.jl:17
in expression starting at /home/user/.julia/packages/CodecZstd/vGFup/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_du3rkN/tmp_sys.so --project=/home/user/.julia/dev/Foo --output-o=/tmp/jl_Xnt4NN.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_QBYBSN\"
    ]
    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[1]:1

Of note:

  • This does not seem to be a problem for PackageCompiler.create_sysimage()
  • I'm not having any problems when Foo.jl doesn't list PackageCompiler directly + using PackageCompiler from the v1.6 env.This note was a mistake, please see message bellow
  • I've not tried this with any other TranscodingStreams.jl codec packages

Version
julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, haswell)
Project
name = "Foo"
uuid = "f2f46d47-1d1a-4e6d-96f8-220910b5324c"
authors = ["= <user> and contributors"]
version = "0.1.0"

[deps]
CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[compat]
julia = "1"

Manifest
# This file is machine-generated - editing it directly is not advised

[[ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"

[[Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[CodecZstd]]
deps = ["TranscodingStreams", "Zstd_jll"]
git-tree-sha1 = "d19cd9ae79ef31774151637492291d75194fc5fa"
uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
version = "0.7.0"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[JLLWrappers]]
deps = ["Preferences"]
git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.3.0"

[[LazyArtifacts]]
deps = ["Artifacts", "Pkg"]
uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"

[[LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"

[[LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"

[[LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"

[[MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"

[[NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"

[[PackageCompiler]]
deps = ["LazyArtifacts", "Libdl", "Pkg", "UUIDs"]
git-tree-sha1 = "d2f93cc940b4a3d1aba77b266cbd7c7d404568c7"
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
version = "1.6.0"

[[Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Preferences]]
deps = ["TOML"]
git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.2.2"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[[Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"

[[Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[TranscodingStreams]]
deps = ["Random", "Test"]
git-tree-sha1 = "216b95ea110b5972db65aa90f88d8d89dcb8851c"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.9.6"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"

[[Zstd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "cc4bf3fdde8b7e3e9fa0351bdeedba1cf3b7f6e6"
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
version = "1.5.0+0"

[[nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"

[[p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

Please let me know if you need additional details.

@Felix-Gauthier
Copy link
Author

Felix-Gauthier commented Oct 4, 2021

I'm very sorry, I missed something when investigating this bug last Friday evening: my general v1.6 environment is using PackageCompiler#v1.5.0 but the project env for Foo is using PacakgeCompiler#v1.6.0

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 LazyArtifacts.. somehow. Still mysterious, but less weird.

I'll change to title of this issue accordingly.

@Felix-Gauthier Felix-Gauthier changed the title Compilation error with CodecZstd.jl and PackageCompiler.jl in same Environment Compilation error with CodecZstd.jl and PackageCompiler#v1.6.0 Oct 4, 2021
@mkitti
Copy link
Member

mkitti commented Oct 13, 2021

  1. Could you confirm that this is still an issue with CodecZstd.jl v0.7.1 or later?
  2. Are you using the Artifacts system?
    https://docs.juliahub.com/PackageCompiler/MMV8C/1.2.1/apps.html#Artifacts-1

@Felix-Gauthier
Copy link
Author

Felix-Gauthier commented Oct 13, 2021

Could you confirm that this is still an issue with CodecZstd.jl v0.7.1 or later?

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 v0.7.1 didn't seem to improve things, however, with the most recent version of PackageCompiler (v1.7.0) :

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 CodecZstd in the stacktrace.

Are you using the Artifacts system?

Not directly. But, yes, the issue does seem to be related to the Artifact system.

Thanks for the reply, and your time.
I'm getting this issue while compiling an app with Arrow.jl as direct dep (which in turn lists CodecZstd as dep) so this is very appreciated.

@mkitti
Copy link
Member

mkitti commented Oct 13, 2021

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.

@Felix-Gauthier
Copy link
Author

Understood, thanks for looking into it.

@KristofferC
Copy link
Member

Could you try with the latest PackageCompiler version now?

@Felix-Gauthier
Copy link
Author

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

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

No branches or pull requests

3 participants