Makie and PackageCompiler error on Windows

In a fresh environment

Julia Version 1.8.4
Commit 00177ebc4f (2022-12-23 21:32 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 4 × Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 4 virtual cores

Status `C:\Users\stephan\AppData\Local\Temp\jl_E9jkpp\Project.toml`
  [e9467ef8] GLMakie v0.8.1
  [ee78f7c6] Makie v0.19.1
  [9b87118b] PackageCompiler v2.1.2

building a sysimage with Makie and GLMakie fails because allegedly a font file cannot be found

julia> PackageCompiler.create_sysimage(["Makie", "GLMakie"]; sysimage_path=joinpath(homedir(),".julia","sysimages","plotting.so"))
⡆ [01m:11s] PackageCompiler: compiling incremental system imageCould not load font file "C:\Users\stephan\.julia\packages\Makie\Za3LL\assets\fonts\TeXGyreHerosMakie-Regular.otf"

However that file exists and is valid.

Normal precompilation and usage of Makie works fine.

Has anybody encountered this, and would I file an issue with PackageCompiler or Makie?

Full stacktrace
julia> PackageCompiler.create_sysimage(["Makie", "GLMakie"]; sysimage_path=joinpath(homedir(),".julia","sysimages","plotting.so"))
⡆ [01m:11s] PackageCompiler: compiling incremental system imageCould not load font file "C:\Users\stephan\.julia\packages\Makie\Za3LL\assets\fonts\TeXGyreHerosMakie-Regular.otf"
Stacktrace:
⠙ [01m:11s] PackageCompiler: compiling incremental system imageString)
    @ Base .\error.jl:35
  [2] load_font
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\conversions.jl:921 [inlined]
  [3] (::Makie.var"#206#207"{String})()
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\conversions.jl:938
  [4] get!(default::Makie.var"#206#207"{String}, h::Dict{String, FreeTypeAbstraction.FTFont}, key::String)
⠸ [01m:11s] PackageCompiler: compiling incremental system image    @ Base .\dict.jl:481
  [5] to_font(str::String)
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\conversions.jl:935
  [6] to_font(fonts::MakieCore.Attributes, s::Symbol)
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\conversions.jl:969
  [7] (::Makie.var"#1875#1878"{Base.RefValue{Vector{Int64}}, Observables.Observable{Vector{ColorTypes.RGBA{Float32}}}, Observables.Observable{Vector{Float32}}, Observables.Observable{Vector{GeometryBasics.Point{2, Float32}}}, Observables.Observable{Vector{Makie.GlyphCollection}}})(str::String, ts::Float64, f::Symbol, fs::MakieCore.Attributes, al::Tuple{Symbol, Symbol}, rot::Float32, jus::MakieCore.Automatic, lh::Float64, col::ColorTypes.RGBA{Float32}, scol::Tuple{Symbol, Float64}, swi::Int64, www::Int64)
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\basic_recipes\text.jl:15
⢰ [01m:12s] PackageCompiler: compiling incremental system imageBase.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base .\essentials.jl:729
  [9] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base .\essentials.jl:726
 [10] (::Observables.OnAny)(value::Any)
    @ Observables C:\Users\stephan\.julia\packages\Observables\PHGQ8\src\Observables.jl:415
 [11] #invokelatest#2
    @ .\essentials.jl:729 [inlined]
 [12] invokelatest
    @ .\essentials.jl:726 [inlined]
 [13] notify(observable::Observables.AbstractObservable)
    @ Observables C:\Users\stephan\.julia\packages\Observables\PHGQ8\src\Observables.jl:169
 [14] plot!(plot::MakieCore.Text{Tuple{Vector{GeometryBasics.Point{2, Float32}}}})
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\basic_recipes\text.jl:65
 [15] plot!(scene::Makie.Scene, P::Type{MakieCore.Text{Tuple{GeometryBasics.Point{2, Float32}}}}, attributes::MakieCore.Attributes, input::Tuple{Observables.Observable{GeometryBasics.Point{2, Float32}}}, args::Observables.Observable{Tuple{Vector{GeometryBasics.Point{2, Float32}}}})
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\interfaces.jl:421
 [16] plot!(scene::Makie.Scene, P::Type{MakieCore.Text}, attributes::MakieCore.Attributes, args::Observables.Observable{GeometryBasics.Point{2, Float32}}; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\interfaces.jl:336
 [17] plot!
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\interfaces.jl:303 [inlined]
 [18] #plot!#164
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\interfaces.jl:287 [inlined]
 [19] text!(::Makie.Scene, ::Vararg{Any}; attributes::Base.Pairs{Symbol, Any, NTuple{9, Symbol}, NamedTuple{(:text, :fontsize, :color, :visible, :align, :rotation, :font, :markerspace, :inspectable), Tuple{Observables.Observable{Any}, Observables.Observable{Any}, Observables.Observable{Any}, Observables.Observable{Any}, Observables.Observable{Tuple{Symbol, Symbol}}, Observables.Observable{Float32}, Observables.Observable{Any}, Symbol, Bool}}})
    @ MakieCore C:\Users\stephan\.julia\packages\MakieCore\bV281\src\recipes.jl:38
 [20] Makie.LineAxis(parent::Makie.Scene, attrs::MakieCore.Attributes)
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\lineaxis.jl:384
 [21] #LineAxis#1231
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\lineaxis.jl:3 [inlined]
 [22] initialize_block!(ax::Makie.Axis; palette::Nothing)
⣠ [01m:12s] PackageCompiler: compiling incremental system imageC:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\blocks\axis.jl:316
 [23] initialize_block!(ax::Makie.Axis)
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\blocks\axis.jl:166
 [24] _block(::Type{Makie.Axis}, ::Makie.Figure; bbox::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\blocks.jl:408
 [25] _block
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\blocks.jl:298 [inlined]
 [26] #_#1079
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\blocks.jl:279 [inlined]
 [27] Block
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\makielayout\blocks.jl:278 [inlined]
 [28] plot(P::Type{MakieCore.Poly}, args::GeometryBasics.HyperRectangle{2, Int64}; axis::NamedTuple{(), Tuple{}}, figure::NamedTuple{(), Tuple{}}, kw_attributes::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:strokewidth, :strokecolor, :color), Tuple{Int64, Symbol, Tuple{Symbol, Float64}}}})
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\figureplotting.jl:50
 [29] #poly#55
    @ C:\Users\stephan\.julia\packages\MakieCore\bV281\src\recipes.jl:34 [inlined]
 [30] top-level scope
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\precompiles.jl:6
 [31] include(mod::Module, _path::String)
    @ Base .\Base.jl:419
 [32] include
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\Makie.jl:1 [inlined]
 [33] macro expansion
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\precompiles.jl:15 [inlined]
 [34] macro expansion
    @ C:\Users\stephan\.julia\packages\SnoopPrecompile\UWvXF\src\SnoopPrecompile.jl:51 [inlined]
 [35] top-level scope
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\precompiles.jl:12
 [36] include(mod::Module, _path::String)
    @ Base .\Base.jl:419
 [37] include(x::String)
    @ Makie C:\Users\stephan\.julia\packages\Makie\Za3LL\src\Makie.jl:1
 [38] top-level scope
    @ C:\Users\stephan\.julia\packages\Makie\Za3LL\src\Makie.jl:340
 [39] include
    @ .\Base.jl:419 [inlined]
 [40] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1367
 [41] _require_prelocked(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1200
 [42] macro expansion
    @ .\loading.jl:1180 [inlined]
 [43] macro expansion
    @ .\lock.jl:223 [inlined]
 [44] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1144
 [45] include
    @ .\Base.jl:419 [inlined]
 [46] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1367
 [47] _require_prelocked(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1200
 [48] macro expansion
    @ .\lock.jl:223 [inlined]
 [49] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1195
 [50] top-level scope
⣄ [01m:12s] PackageCompiler: compiling incremental system imageC:\Users\stephan\AppData\Local\Temp\jl_GHATMlebcj:126
in expression starting at C:\Users\stephan\.julia\packages\Makie\Za3LL\precompile\shared-precompile.jl:4
in expression starting at C:\Users\stephan\.julia\packages\Makie\Za3LL\src\precompiles.jl:11
in expression starting at C:\Users\stephan\.julia\packages\Makie\Za3LL\src\Makie.jl:1
in expression starting at C:\Users\stephan\.julia\packages\GLMakie\6Blp9\src\GLMakie.jl:1
in expression starting at C:\Users\stephan\AppData\Local\Temp\jl_GHATMlebcj:126
✖ [01m:12s] PackageCompiler: compiling incremental system image
ERROR: failed process: Process(`'C:\Users\stephan\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\julia.exe' --color=yes --startup-file=no --cpu-target=native -O3 '--sysimage=C:\Users\stephan\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\lib\julia\sys.dll' '--project=C:\Users\stephan\AppData\Local\Temp\jl_E9jkpp' '--output-o=C:\Users\stephan\AppData\Local\Temp\jl_QrufiF6tad.o' 'C:\Users\stephan\AppData\Local\Temp\jl_GHATMlebcj'`, ProcessExited(1)) [1]

I have encountered something similar (but with CairoMakie). There’s a potentially related open issue in the Makie repo.

It’s suddenly working now.

I had a couple other Julia processes running before. I think quitting those might have been the remedy, but I’m not certain. And neither do I understand what was happening, which is a frustrating :confused: Probably some strange issue with filehandles on Windows.

Thanks for linking that issue though!