I was trying to compile an app using JuliaC and kept getting an error on the juliac step. I kept removing everything while keeping the error and until I was left with just one import. Here’s the MVE:
module Thing
import HDF5
function @main(args)
println(Core.stdout, "hello")
return 0
end
end
Here’s the error:
Precompiling packages finished.
1 dependency successfully precompiled in 1 seconds. 60 already precompiled.
◒ Compiling...Error #1: unresolved call from statement !(
isprecompiling()::Any
)::Any
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/Requires/1eCOK/src/require.jl:97 [inlined]
[2] __init__()
@ HDF5 ~/.julia/packages/HDF5/Xsdf5/src/HDF5.jl:120
Error #2: unresolved call from statement !(
isprecompiling()::Any
)::Any
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/Requires/1eCOK/src/require.jl:97 [inlined]
[2] __init__()
@ HDF5 ~/.julia/packages/HDF5/Xsdf5/src/HDF5.jl:122
Error #3: unresolved call from statement (f::Any)()::Any
Stacktrace:
[1] unknown scope
@ ~/.julia/packages/Requires/1eCOK/src/require.jl:20
[2] macro expansion
@ ~/.julia/packages/Requires/1eCOK/src/require.jl:98 [inlined]
[3] __init__()
@ HDF5 ~/.julia/packages/HDF5/Xsdf5/src/HDF5.jl:120
Error #4: unresolved call from statement push!(
callbacks(pkg::Base.PkgId)::Any,
f::Any
)::Any
Stacktrace:
[1] unknown scope
@ ~/.julia/packages/Requires/1eCOK/src/require.jl:20
[2] macro expansion
@ ~/.julia/packages/Requires/1eCOK/src/require.jl:98 [inlined]
[3] __init__()
@ HDF5 ~/.julia/packages/HDF5/Xsdf5/src/HDF5.jl:120
Trim verify finished with 4 errors, 0 warnings.
✓ Compiling...
ERROR: Failed to compile Thing
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:44
[2] compile_products(recipe::JuliaC.ImageRecipe)
@ JuliaC ~/.julia/packages/JuliaC/CQ4OE/src/compiling.jl:267
[3] _main_cli(args::Vector{String}; io::Base.TTY)
@ JuliaC ~/.julia/packages/JuliaC/CQ4OE/src/JuliaC.jl:228
[4] _main_cli(args::Vector{String})
@ JuliaC ~/.julia/packages/JuliaC/CQ4OE/src/JuliaC.jl:219
[5] main(ARGS::Vector{String})
@ JuliaC ~/.julia/packages/JuliaC/CQ4OE/src/JuliaC.jl:234
[6] _start()
@ Base ./client.jl:583
ERROR: failed process: Process(`juliac Thing --output-exe Thing.exe --bundle build --trim`, ProcessExited(1)) [1]
Stacktrace:
[1] pipeline_error
@ ./process.jl:610 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:525
[3] run(::Cmd)
@ Base ./process.jl:522
[4] top-level scope
@ REPL[2]:1
This is in the REPL, I’ve followed this example Self-contained juliac demonstration
Julia Version 1.13.2
Commit 45b6d15e34b (2026-10-14 20:33 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 4 × Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
WORD_SIZE: 64
LLVM: libLLVM-20.1.8 (ORCJIT, haswell)
GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores)
Environment:
JULIA_PKG_USE_CLI_GIT = true
The setup is correct; if I remove the import it works.