# Makie and PackageCompiler error on Windows

**URL:** https://discourse.julialang.org/t/makie-and-packagecompiler-error-on-windows/92663
**Category:** General Usage
**Tags:** package-compiler
**Created:** [January 8, 2023, 9:59am UTC](https://discourse.julialang.org/t/makie-and-packagecompiler-error-on-windows/92663 "2023-01-08T09:59:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)
#### Post date: [January 8, 2023, 9:59am UTC](https://discourse.julialang.org/t/makie-and-packagecompiler-error-on-windows/92663/1 "2023-01-08T09:59:59Z")

</div>

In a fresh environment

```julia
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
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
> 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]
> 
> ```

---

<div class="post-metadata">

### Author: ![lmshk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmshk/32/29632_2.png) [@lmshk](https://discourse.julialang.org/u/lmshk)
#### Post date: [January 8, 2023, 3:37pm UTC](https://discourse.julialang.org/t/makie-and-packagecompiler-error-on-windows/92663/2 "2023-01-08T15:37:33Z")

</div>

I have encountered something similar (but with CairoMakie). There’s a potentially related [open issue](https://github.com/MakieOrg/Makie.jl/issues/2409) in the Makie repo.

---

<div class="post-metadata">

### Author: ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)
#### Post date: [January 8, 2023, 4:51pm UTC](https://discourse.julialang.org/t/makie-and-packagecompiler-error-on-windows/92663/3 "2023-01-08T16:51:24Z")

</div>

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 😕 Probably some strange issue with filehandles on Windows.

Thanks for linking that issue though!

---

<div class="post-metadata">

### Author: ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)
#### Post date: [February 17, 2023, 4:22pm UTC](https://discourse.julialang.org/t/makie-and-packagecompiler-error-on-windows/92663/4 "2023-02-17T16:22:29Z")

</div>

For me the issue with `TeXGyreHerosMakie-Regular.otf` depends on two things:

- Which Julia version (v1.8.5 or v1.6.7), for me `v1.6.7` works better
- the `create_app()` parameter: `incremental` (`false` seems to be preferable)
