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

UndefRefError in docker image #898

Closed
olivierlabayle opened this issue Dec 7, 2023 · 2 comments
Closed

UndefRefError in docker image #898

olivierlabayle opened this issue Dec 7, 2023 · 2 comments

Comments

@olivierlabayle
Copy link

Hi,

I am trying to build a sysimage for my project. When I do it locally it works fine, however when I try to do it in a docker image PackageCompiler crashes with the following:

create_sysimage(["TargetedEstimation"]; sysimage_path="TargetedEstimationSysimage.so")
⡆ [00m:26s] PackageCompiler: compiling incremental system imageUndefRefError: access to undefined reference
Stacktrace:
  [1] getproperty
⠇ [00m:26s] PackageCompiler: compiling incremental system imageBase.jl:37 [inlined]
  [2] getindex
    @ ./refvalue.jl:56 [inlined]
⠸ [00m:26s] PackageCompiler: compiling incremental system imageLineNumberNode, mod::Module, ex::Any)
    @ Base.Docs ./docs/Docs.jl:522
⣄ [00m:27s] PackageCompiler: compiling incremental system imageVararg{Any})
    @ Core ./boot.jl:539
  [5] #macroexpand#63
    @ ./expr.jl:119 [inlined]
  [6] macroexpand
    @ ./expr.jl:117 [inlined]
  [7] docm(source::LineNumberNode, mod::Module, meta::Any, ex::Any, define::Bool)
    @ Base.Docs ./docs/Docs.jl:539
  [8] docm(source::LineNumberNode, mod::Module, meta::Any, ex::Any)
    @ Base.Docs ./docs/Docs.jl:539
  [9] var"@doc"(::LineNumberNode, ::Module, ::String, ::Vararg{Any})
    @ Core ./boot.jl:539
 [10] include
    @ ./Base.jl:457 [inlined]
 [11] _require(pkg::Base.PkgId, env::Nothing)
    @ Base ./loading.jl:1840
 [12] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)
    @ Base ./loading.jl:1660
 [13] _require_prelocked
    @ ./loading.jl:1658 [inlined]
 [14] macro expansion
    @ ./lock.jl:267 [inlined]
 [15] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1655
 [16] top-level scope
    @ /tmp/jl_feJYb05EDG:270
in expression starting at /TargetedEstimation.jl/src/TargetedEstimation.jl:48
in expression starting at /TargetedEstimation.jl/src/TargetedEstimation.jl:1
in expression starting at /tmp/jl_feJYb05EDG:270
✖ [00m:27s] PackageCompiler: compiling incremental system image
ERROR: failed process: Process(`/usr/local/julia/bin/julia --color=yes --startup-file=no --pkgimages=no --cpu-target=native --sysimage=/usr/local/julia/lib/julia/sys.so --project=/TargetedEstimation.jl --output-o=/tmp/jl_xWnQzURkpK.o /tmp/jl_feJYb05EDG`, 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] #19
    @ /opt/packages/PackageCompiler/Na90o/ext/TerminalSpinners.jl:157 [inlined]
  [5] spin(f::PackageCompiler.var"#19#21"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners /opt/packages/PackageCompiler/Na90o/ext/TerminalSpinners.jl:164
  [6] macro expansion
    @ /opt/packages/PackageCompiler/Na90o/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}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler /opt/packages/PackageCompiler/Na90o/src/PackageCompiler.jl:135
  [8] create_sysimg_object_file
    @ /opt/packages/PackageCompiler/Na90o/src/PackageCompiler.jl:297 [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_stdlibs::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::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler /opt/packages/PackageCompiler/Na90o/src/PackageCompiler.jl:599
 [10] top-level scope
    @ REPL[2]:1

Any idea what could be the reason and how I could debug that further?

DockerFile: https://github.com/TARGENE/TargetedEstimation.jl/blob/cv_tmle/docker/Dockerfile
Julia version: 1.9.4
PackageCompiler version: 2.1.15

Many thanks!

@olivierlabayle
Copy link
Author

It seems the error is coming from here.

REPL = Base.REPL_MODULE_REF[]

I've noticed that the first line of the script generated by PackageCompiler does Base.reinit_stdio() could it be linked? Is the REPL even accessible from the script executed to generate the sysimage object file?

@olivierlabayle
Copy link
Author

unlikely to be duer to PackageCompiler, closing

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

1 participant