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

Precompiling GLMakie fails with ImageIO 0.4 #3461

Closed
2 tasks
felixcremer opened this issue Dec 11, 2023 · 2 comments · Fixed by #4401
Closed
2 tasks

Precompiling GLMakie fails with ImageIO 0.4 #3461

felixcremer opened this issue Dec 11, 2023 · 2 comments · Fixed by #4401
Labels
bug dependencies Related to a package used by Makie

Comments

@felixcremer
Copy link
Contributor

  • [x ] are you running newest version (version from docs) ?
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
    No
  • What platform + GPU are you on?

When I am trying to load GLMakie with ImageIO v.0.4 in the environment I get the following precompile error. Updating ImageIO to 0.5 fixes the problem.

Should we increase the lower bound of ImageIO to at least 0.5?

julia> using GLMakie
[ Info: Precompiling GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]
Errors encountered while load FileIO.File{FileIO.DataFormat{:PNG}, String}("/home/fcremer/.julia/packages/Makie/6NLuU/assets/icons/icon-128.png").
All errors:
===========================================
Evaluation into the closed module `ImageIO` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `ImageIO` with `eval` during precompilation - don't do this.
===========================================
ArgumentError: Package ImageMagick [6218d12a-5da1-5696-b52f-db25d2ecc6d1] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

===========================================

Fatal error:
ERROR: LoadError: Evaluation into the closed module `ImageIO` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `ImageIO` with `eval` during precompilation - don't do this.
Stacktrace:
  [1] eval
    @ ./boot.jl:370 [inlined]
  [2] (::ImageIO.var"#1#2"{Symbol})()
    @ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:19
  [3] lock(f::ImageIO.var"#1#2"{Symbol}, l::ReentrantLock)
    @ Base ./lock.jl:229
  [4] checked_import
    @ ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:8 [inlined]
  [5] load(f::FileIO.File{FileIO.DataFormat{:PNG}, String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:27
  [6] load(f::FileIO.File{FileIO.DataFormat{:PNG}, String})
    @ ImageIO ~/.julia/packages/ImageIO/uPn5K/src/ImageIO.jl:26
  [7] #invokelatest#2
    @ ./essentials.jl:819 [inlined]
  [8] invokelatest
    @ ./essentials.jl:816 [inlined]
  [9] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:219
 [10] action
    @ ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:196 [inlined]
 [11] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:185
 [12] action
    @ ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:185 [inlined]
 [13] load(::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:113
 [14] load
    @ ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:109 [inlined]
 [15] _broadcast_getindex_evalf
    @ ./broadcast.jl:683 [inlined]
 [16] _broadcast_getindex
    @ ./broadcast.jl:656 [inlined]
 [17] getindex
    @ ./broadcast.jl:610 [inlined]
 [18] copy
    @ ./broadcast.jl:912 [inlined]
 [19] materialize
    @ ./broadcast.jl:873 [inlined]
 [20] icon()
    @ Makie ~/.julia/packages/Makie/6NLuU/src/Makie.jl:312
 [21] empty_screen(debugging::Bool; reuse::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:260
 [22] empty_screen
    @ ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:222 [inlined]
 [23] singleton_screen(debugging::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:329
 [24] macro expansion
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:21 [inlined]
 [25] macro expansion
    @ ~/.julia/packages/PrecompileTools/kmH5L/src/workloads.jl:78 [inlined]
 [26] macro expansion
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:18 [inlined]
 [27] macro expansion
    @ ~/.julia/packages/PrecompileTools/kmH5L/src/workloads.jl:140 [inlined]
 [28] top-level scope
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:16
Stacktrace:
  [1] handle_error(e::ErrorException, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/error_handling.jl:61
  [2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/error_handling.jl:56
  [3] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:228
  [4] action
    @ ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:196 [inlined]
  [5] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:185
  [6] action
    @ ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:185 [inlined]
  [7] load(::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:113
  [8] load
    @ ~/.julia/packages/FileIO/BE7iZ/src/loadsave.jl:109 [inlined]
  [9] _broadcast_getindex_evalf
    @ ./broadcast.jl:683 [inlined]
 [10] _broadcast_getindex
    @ ./broadcast.jl:656 [inlined]
 [11] getindex
    @ ./broadcast.jl:610 [inlined]
 [12] copy
    @ ./broadcast.jl:912 [inlined]
 [13] materialize
    @ ./broadcast.jl:873 [inlined]
 [14] icon()
    @ Makie ~/.julia/packages/Makie/6NLuU/src/Makie.jl:312
 [15] empty_screen(debugging::Bool; reuse::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:260
 [16] empty_screen
    @ ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:222 [inlined]
 [17] singleton_screen(debugging::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:329
 [18] macro expansion
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:21 [inlined]
 [19] macro expansion
    @ ~/.julia/packages/PrecompileTools/kmH5L/src/workloads.jl:78 [inlined]
 [20] macro expansion
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:18 [inlined]
 [21] macro expansion
    @ ~/.julia/packages/PrecompileTools/kmH5L/src/workloads.jl:140 [inlined]
 [22] top-level scope
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:16
 [23] include(mod::Module, _path::String)
    @ Base ./Base.jl:457
 [24] include(x::String)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/GLMakie.jl:1
 [25] top-level scope
    @ ~/.julia/packages/GLMakie/29Rzq/src/GLMakie.jl:66
 [26] include
    @ ./Base.jl:457 [inlined]
 [27] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2049
 [28] top-level scope
    @ stdin:3
in expression starting at /home/fcremer/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:15
in expression starting at /home/fcremer/.julia/packages/GLMakie/29Rzq/src/GLMakie.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/home/fcremer/.julia/compiled/v1.9/GLMakie/jl_a0nhsB".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2294
  [3] compilecache
    @ ./loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] eval
    @ ./boot.jl:370 [inlined]
 [10] eval
    @ ./Base.jl:68 [inlined]
 [11] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.61.2/scripts/packages/VSCodeServer/src/repl.jl:229
 [12] (::VSCodeServer.var"#110#112"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.61.2/scripts/packages/VSCodeServer/src/repl.jl:192
 [13] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:514
 [14] with_logger
    @ ./logging.jl:626 [inlined]
 [15] (::VSCodeServer.var"#109#111"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.61.2/scripts/packages/VSCodeServer/src/repl.jl:193
 [16] #invokelatest#2
    @ ./essentials.jl:819 [inlined]
 [17] invokelatest(::Any)
    @ Base ./essentials.jl:816
 [18] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.61.2/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [19] (::VSCodeServer.var"#62#63")()
    @ VSCodeServer ./task.jl:514
@xlxs4
Copy link

xlxs4 commented Dec 11, 2023

Can reproduce with ImageIO 0.4.1. The problem indeed goes away when using later versions

julia> versioninfo()
Julia Version 1.10.0-rc2
Commit dbb9c46795b (2023-12-03 15:25 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M2 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 6 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

@xlxs4
Copy link

xlxs4 commented Dec 11, 2023

btw you might find something like SciML/SciMLBase.jl#553 useful

@t-bltg t-bltg added the dependencies Related to a package used by Makie label Dec 11, 2023
SimonDanisch added a commit that referenced this issue Sep 24, 2024
SimonDanisch added a commit that referenced this issue Sep 24, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Internal Improvements Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Related to a package used by Makie
Projects
Development

Successfully merging a pull request may close this issue.

3 participants