comonicon / Comonicon.jl

Your best CLI generator in JuliaLang

Home Page:https://comonicon.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sysimage precompilation error on Github CI / Docker image

olivierlabayle opened this issue · comments

Hi,

I am trying to build an app with Comonicon but the sysimage creation fails when loading my Package in the Julia script generated by PackageCompiler. (This line:)

Base.require(Base.PkgId(Base.UUID("2573d147-4098-46ba-9db2-8608d210ccac"), "TargetedEstimation"))

This is apparently (see stacktrace below) because of the following Comonicon line: src/frontend/cast.jl#L529

$doc = @doc(COMMAND_ENTRY_DOC_STUB)

I can successfuly build the app on a local linux machine but it fails on both a Github CI runner (Ubuntu 22.04.3 LTS) and a Julia official docker container on the same github CI runner. This makes me think it must be due to some environment variable but can't really figure it out. I think I understood that bandwith is low and would be grateful for any help or hint for what is happening if any idea comes to mind.

The full stacktrace:

- PackageCompiler: compiling incremental system image
ERROR: LoadError: UndefRefError: access to undefined reference
Stacktrace:
  [1] getproperty
    @ ./Base.jl:37 [inlined]
  [2] getindex
    @ ./refvalue.jl:56 [inlined]
  [3] docm(source::LineNumberNode, mod::Module, ex::Any)
    @ Base.Docs ./docs/Docs.jl:522
  [4] var"@doc"(__source__::LineNumberNode, __module__::Module, x::Vararg{Any})
    @ Core ./boot.jl:539
  [5] include
    @ ./Base.jl:457 [inlined]
  [6] _require(pkg::Base.PkgId, env::Nothing)
    @ Base ./loading.jl:1840
  [7] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)                                                                                                                                           [0/89]
    @ Base ./loading.jl:1660
  [8] _require_prelocked
    @ ./loading.jl:1658 [inlined]
  [9] macro expansion
    @ ./lock.jl:267 [inlined]
 [10] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1655
 [11] top-level scope
    @ /tmp/jl_KtIZE74vMr:268
in expression starting at /home/runner/.julia/packages/Comonicon/AXDxW/src/frontend/cast.jl:529
in expression starting at /home/runner/work/TargetedEstimation.jl/TargetedEstimation.jl/src/TargetedEstimation.jl:1
in expression starting at /tmp/jl_KtIZE74vMr:268
ERROR: failed process: Process(`/opt/hostedtoolcache/julia/1.9.4/x64/bin/julia --color=yes --startup-file=no --pkgimages=no --cpu-target=native --sysimage=/opt/hostedtoolcache/julia/1.9.4/x64/lib/julia/sy
s.so --project=/home/runner/work/TargetedEstimation.jl/TargetedEstimation.jl --output-o=/tmp/jl_wHqZoTgvsv.o /tmp/jl_KtIZE74vMr`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] #20
    @ ~/.julia/packages/PackageCompiler/1fx6C/ext/TerminalSpinners.jl:157 [inlined]
  [5] spin(f::PackageCompiler.var"#20#22"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners ~/.julia/packages/PackageCompiler/1fx6C/ext/TerminalSpinners.jl:164
  [6] macro expansion
    @ ~/.julia/packages/PackageCompiler/1fx6C/ext/TerminalSpinners.jl:157 [inlined]
  [7] create_sysimg_object_file(object_file::String, packages::Vector{String}, packages_sysimg::Set{Base.PkgId}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompi
le_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/1fx6C/src/PackageCompiler.jl:134
  [8] create_sysimg_object_file
    @ ~/.julia/packages/PackageCompiler/1fx6C/src/PackageCompiler.jl:310 [inlined]
  [9] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_std
libs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, julia_init_h_file::Nothing, version::N
othing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/1fx6C/src/PackageCompiler.jl:620
 [10] top-level scope
    @ REPL[5]:1

Version of the package:

Comonicon v1.0.6
Julia 1.9.4