I’m trying to create an app with LLVM.jl in it.
The create_app
call runs successfully, but I get an error when I try to run the app itself because the LLVMExtra
artifact is apparently not downloaded and set up while the app is getting created.
How can I fix this?
Stacktrace
~ ❯ MyAppCompiled/bin/MyApp
Downloaded artifact: LLVMExtra
Downloaded artifact: LLVMExtra
fatal: error thrown and no exception handler available.
InitError(mod=:LLVMExtra_jll, error=ErrorException("Unable to automatically install 'LLVMExtra' from '/home/thazhemadam/.julia/packages/LLVMExtra_jll/y3M2E/Artifacts.toml'"))
error at ./error.jl:33
#ensure_artifact_installed#23 at /home/thazhemadam/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Pkg/src/Artifacts.jl:441
ensure_artifact_installed##kw at /home/thazhemadam/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Pkg/src/Artifacts.jl:413
unknown function (ip: 0x7f8352022a3d)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#ensure_artifact_installed#22 at /home/thazhemadam/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Pkg/src/Artifacts.jl:404
unknown function (ip: 0x7f8352014faa)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
ensure_artifact_installed##kw at /home/thazhemadam/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Pkg/src/Artifacts.jl:399
unknown function (ip: 0x7f8352014c98)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
_artifact_str at /home/thazhemadam/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:547
unknown function (ip: 0x7f8352012247)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_f__call_latest at /buildworker/worker/package_linux64/build/src/builtins.c:757
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
do_apply at /buildworker/worker/package_linux64/build/src/builtins.c:713
#invokelatest#2 at ./essentials.jl:716
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
do_apply at /buildworker/worker/package_linux64/build/src/builtins.c:713
invokelatest at ./essentials.jl:714
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:126
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:215
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:166 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:587
jl_fptr_interpret_call at /buildworker/worker/package_linux64/build/src/interpreter.c:675
macro expansion at /home/thazhemadam/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:689 [inlined]
find_artifact_dir at /home/thazhemadam/.julia/packages/JLLWrappers/QpMQW/src/wrapper_generators.jl:13
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
__init__ at /home/thazhemadam/.julia/packages/LLVMExtra_jll/y3M2E/src/wrappers/x86_64-linux-gnu-cxx11-llvm_version+12.jl:7
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_module_run_initializer at /buildworker/worker/package_linux64/build/src/toplevel.c:73
_finish_julia_init at /buildworker/worker/package_linux64/build/src/init.c:796
julia_init at /buildworker/worker/package_linux64/build/src/init.c:730
jl_init_with_image at /buildworker/worker/package_linux64/build/src/jlapi.c:74
jl_init at /buildworker/worker/package_linux64/build/src/jlapi.c:90
main at MyAppCompiled/bin/MyApp (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at MyAppCompiled/bin/MyApp (unknown line)
Reproducer
julia> using Pkg, PackageCompiler;
julia> Pkg.generate("MyApp");
julia> Pkg.activate("MyApp");
julia> Pkg.add("LLVM");
julia> open("MyApp/src/MyApp.jl", "w") do io
write(io,
"""
module MyApp
using LLVM
function julia_main()::Cint
@info "Hello World from LLVM!"
return 0
end
end
"""
)
end
julia> create_app("MyApp", "MyAppCompiled");