Errors when using sysimage with Makie master

I’m trying to stay on the bleeding edge with Makie master, yet minimize my TTFP. I’m creating a sysimage with basically the following (the Pkg.activate(temp=true) is an attempt to make this as reproducible as possible):

using Pkg
Pkg.activate(temp=true)
devdir=ARGS[2]

pkgs = ["Makie", "Makie/GLMakie", "Makie/WGLMakie", "Makie/CairoMakie"]
for pkg in pkgs
  Pkg.develop(path=devdir * "/" * pkg)
end

Pkg.add("PackageCompiler")
using PackageCompiler
pkgs = ["Makie", "GLMakie", "WGLMakie", "CairoMakie"]
PackageCompiler.create_sysimage(pkgs; sysimage_path=ARGS[1])

On exiting a session using the generated sysimage I get some interesting errors:

Julia 1.8.5 errors
julia --startup-file=no --project=. -J ../makie.julia-1.8.20230223132623.dylib
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.5 (2023-01-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using GLMakie

julia> f = Figure()

julia>
error in running finalizer: GLFW.GLFWError(code=GLFW.ErrorCode(0x00010001), description="The GLFW library is not initialized")
jl_f_throw at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
_ErrorCallbackWrapper at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.8.20230223132623.dylib (unknown line)
jfptr__ErrorCallbackWrapper_144054 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.8.20230223132623.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
jlcapi__ErrorCallbackWrapper_144101 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.8.20230223132623.dylib (unknown line)
_glfwInputError at /Users/patrick/.julia/artifacts/7f4d1479db8bfb628aff3806c483e5fec617271a/lib/libglfw.3.3.dylib (unknown line)
glfwHideWindow at /Users/patrick/.julia/artifacts/7f4d1479db8bfb628aff3806c483e5fec617271a/lib/libglfw.3.3.dylib (unknown line)
YY.closeYY.54 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.8.20230223132623.dylib (unknown line)
close at /Users/patrick/dev/makiedev/dev/Makie/GLMakie/src/screen.jl:589 [inlined]
#1021 at /Users/patrick/dev/makiedev/dev/Makie/src/display.jl:45
unknown function (ip: 0x16e4101b3)
ijl_apply_generic at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
jl_f__call_latest at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
emptyNOT. at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.8.20230223132623.dylib (unknown line)
jfptr_emptyNOT._74827 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.8.20230223132623.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
run_finalizer at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
jl_gc_run_finalizers_in_list at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
run_finalizers at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
ijl_atexit_hook at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
jl_repl_entrypoint at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)

With Julia 1.9.0-beta4 it’s worse: it seems I can’t use Revise at all with the sysimage; note that in this case I don’t even do using GLMakie. Interestingly there’s a segfault in there yet the Julia session continues m:

Julia 1.9.0-beta4 errors
julia-1.9 --project=. -J ./makie.julia-1.9.20230223142325.dylib --startup-file=no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-beta4 (2023-02-07)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Revise
[ Info: Precompiling Revise [295af30f-e4ad-537b-8983-00126c2a3abe]

[13872] signal (11.2): Segmentation fault: 11
in expression starting at /Users/patrick/.julia/packages/Revise/P8ITN/src/Revise.jl:36
jl_object_id__cold at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
type_hash at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_cache_type_ at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_restore_system_image_from_stream_ at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_restore_package_image_from_stream at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
ijl_restore_package_image_from_file at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jlplt_ijl_restore_package_image_from_file_63177 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
_include_from_serialized at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
jfptr__include_from_serialized_63169 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
tojlinvoke135567 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
j__include_from_serialized_48851 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
_require_search_from_serialized at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
_require at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
jfptr__require_53403 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
tojlinvoke135151 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
j__require_51043 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
_require_prelocked at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
require at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
jfptr_require_55665 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
eval_import_path at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
ijl_toplevel_eval_in at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
include_string at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
_include at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
include_package_for_output at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
jfptr_include_package_for_output_52937 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
do_call at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
eval_body at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_interpret_toplevel_thunk at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
ijl_toplevel_eval_in at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
include_string at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
exec_options at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
jfptr_exec_options_77872 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
tojlinvoke134350 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
j_exec_options_61531 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
_start at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
jfptr__start_61529 at /Users/patrick/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
true_main at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_repl_entrypoint at /Applications/Julia-1.9.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.9.dylib (unknown line)
Allocations: 6318 (Pool: 6291; Big: 27); GC: 0
ERROR: Failed to precompile Revise [295af30f-e4ad-537b-8983-00126c2a3abe] to "/Users/patrick/.julia/compiled/v1.9/Revise/jl_j9bGZf".
Stacktrace:
  [1] error(s::String)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [3] _require(pkg::Base.PkgId, env::String)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [4] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [5] require(into::Module, mod::Symbol)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [6] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)
    @ REPL ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [7] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
    @ REPL ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [8] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
    @ REPL ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
  [9] kwcall(::Any, ::typeof(REPL.start_repl_backend), backend::REPL.REPLBackend, consumer::Any)
    @ REPL ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
 [10] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
    @ REPL ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
 [11] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
 [12] (::Base.var"#1017#1019"{Bool, Bool, Bool})(REPL::Module)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
 [13] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
 [14] exec_options(opts::Base.JLOptions)
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1
 [15] _start()
    @ Base ~/dev/makiedev/sysimage/makie.julia-1.9.20230223142325.dylib:-1

julia>

FYI, for v1.9 beta I think it’s a known issue:

1 Like

Thanks, I added my observations to that issue.