Package compiler fails when using Julia 1.7.1

Package compiler fails when using Julia 1.7.1. There is a problem with the use of data in the Images package, but not sure if this is the cause of the error. That warning message pops up a minute or so before the error occurs.

Anybody have any idea what is going wrong?

Julia version:

Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, tigerlake)

Package dependencies:

Status `C:\Users\seatt\Source\Emoji\Project.toml`
  [6e4b80f9] BenchmarkTools v1.2.2
  [3da002f7] ColorTypes v0.11.0
  [5ae59095] Colors v0.12.8
  [5789e2e9] FileIO v1.11.2
  [82e4d734] ImageIO v0.5.9
  [916415d5] Images v0.25.0
  [b4f0291d] LazySets v1.53.4
  [a03496cd] PlotlyBase v0.8.18
  [91a5bcdd] Plots v1.25.3
  [295af30f] Revise v3.3.0
  [fdea26ae] SIMD v3.3.1
  [2913bbd2] StatsBase v0.33.13
  [1986cc42] Unitful v1.9.2
  [37e2e46d] LinearAlgebra
  [9a3f8284] Random
  [ea8e919c] SHA
  [10745b16] Statistics

Error message:

[ Info: Now building a custom sysimage for the environment 'c:\Users\seatt\Source\Emoji', excluding dev packages 'Symbol[]'.
β”Œ Info: Included packages: 
β”‚       - Statistics
β”‚       - Revise
β”‚       - Random
β”‚       - BenchmarkTools
β”‚       - SHA
β”‚       - LinearAlgebra
β”‚       - PlotlyBase
β”‚       - SIMD
β”‚       - StatsBase
β”‚       - ColorTypes
β”‚       - ImageIO
β”‚       - Images
β”‚       - LazySets
β”‚       - Plots
β”‚       - Colors
β”‚       - FileIO
β””       - Unitful
[ Info: Precompile statement files: String[]
[ Info: Precompile execution files: String[]
[ Info: PackageCompiler: creating system image object file, this might take a while...
WARNING: both ImageMetadata and ImageAxes export "data"; uses of it in module Images must be qualified
fatal: error thrown and no exception handler available.
StackOverflowError()
_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE at C:\Users\seatt\AppData\Local\Programs\Julia-1.7.1\bin\libLLVM.dll (unknown line)
_ZNK4llvm11LLVMContext11getMDKindIDENS_9StringRefE at C:\Users\seatt\AppData\Local\Programs\Julia-1.7.1\bin\libLLVM.dll (unknown line)
_ZNK4llvm5Value11getMetadataENS_9StringRefE at C:\Users\seatt\AppData\Local\Programs\Julia-1.7.1\bin\libLLVM.dll (unknown line)
ERROR: LoadError: failed process: Process(`'C:\Users\seatt\AppData\Local\Programs\Julia-1.7.1\bin\julia.exe' --color=yes --startup-file=no --cpu-target=native '--sysimage=C:\Users\seatt\AppData\Local\Programs\Julia-1.7.1\lib\julia\sys.dll' '--project=c:\Users\seatt\Source\Emoji' '--output-o=C:\Users\seatt\AppData\Local\Temp\jl_J3kowiky3v.o' -e 'Base.reinit_stdio()
@eval Sys BINDIR = ccall(:jl_get_julia_bindir, Any, ())::String
@eval Sys STDLIB = "C:\\Users\\seatt\\AppData\\Local\\Programs\\Julia-1.7.1\\share\\julia\\stdlib\\v1.7"
Base.init_load_path()
if isdefined(Base, :init_active_project)
    Base.init_active_project()
end
Base.init_depot_path()
import Statistics
import Revise
import Random
import BenchmarkTools
import SHA
import LinearAlgebra
import PlotlyBase
import SIMD
import StatsBase
import ColorTypes
import ImageIO
import Images
import LazySets
import Plots
import Colors
import FileIO
import Unitful
# This @eval prevents symbols from being put into Main
@eval Module() begin
    PrecompileStagingArea = Module()
    for (_pkgid, _mod) in Base.loaded_modules
        if !(_pkgid.name in ("Main", "Core", "Base"))
            eval(PrecompileStagingArea, :(const $(Symbol(_mod)) = $_mod))
        end
    end
    precompile_files = String[
        "C:\\Users\\seatt\\AppData\\Local\\Temp\\jl_3W623zN9Ti"
    ]
    for file in precompile_files, statement in eachline(file)
        # println(statement)
        # The compiler has problem caching signatures with \`Vararg{?, N}\`. Replacing
        # N with a large number seems to work around it.
        statement = replace(statement, r"Vararg{(.*?), N} where N" => s"Vararg{\1, 100}")
        try
            Base.include_string(PrecompileStagingArea, statement)
        catch
            # See julia issue #28808
            @debug "failed to execute $statement"
        end
    end
end # module
empty!(LOAD_PATH)
empty!(DEPOT_PATH)
'`, ProcessExited(3221225477)) [3221225477]

Stacktrace:
 [1] pipeline_error
   @ .\process.jl:531 [inlined]
 [2] run(::Cmd; wait::Bool)
   @ Base .\process.jl:446
 [3] run
   @ .\process.jl:444 [inlined]
 [4] create_sysimg_object_file(object_file::String, packages::Vector{String}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, isapp::Bool)
   @ PackageCompiler c:\Users\seatt\.vscode\extensions\julialang.language-julia-1.5.8\scripts\packages\PackageCompiler\src\PackageCompiler.jl:376
 [5] create_sysimage(packages::Vector{Symbol}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, replace_default::Bool, base_sysimage::Nothing, isapp::Bool, julia_init_c_file::Nothing, version::Nothing, compat_level::String, soname::Nothing, cpu_target::String, script::Nothing)
   @ PackageCompiler c:\Users\seatt\.vscode\extensions\julialang.language-julia-1.5.8\scripts\packages\PackageCompiler\src\PackageCompiler.jl:535       
 [6] top-level scope
   @ c:\Users\seatt\.vscode\extensions\julialang.language-julia-1.5.8\scripts\tasks\task_compileenv.jl:85
in expression starting at c:\Users\seatt\.vscode\extensions\julialang.language-julia-1.5.8\scripts\tasks\task_compileenv.jl:85
The terminal process "C:\Users\seatt\AppData\Local\Programs\Julia-1.7.1\bin\julia.exe '--color=yes', '--project=c:\Users\seatt\.vscode\extensions\julialang.language-julia-1.5.8\scripts\environments\sysimagecompile', '--startup-file=no', '--history-file=no', 'c:\Users\seatt\.vscode\extensions\julialang.language-julia-1.5.8\scripts\tasks\task_compileenv.jl', 'c:\Users\seatt\Source\Emoji'" terminated with exit code: 1.

Can you try to fix this warning:

WARNING: both ImageMetadata and ImageAxes export "data"; uses of it in module Images must be qualified
fatal: error thrown and no exception handler available.

Search for data in your code and replace it with ImageMetadata.data or ImageAxes.data depending on which one you need…

1 Like

There are no uses of data, either ImageMetadata.data or ImageAxes.data, anywhere in my code.

The uses are somewhere in the Images.jl package which I don’t control.

Should I file an issue on that github repo?

You can file an issue, but it would be helpful to provide a minimal example that shows the problem.

Since the error is thrown from LLVM it’s unlikely this has a simple fix. I would open an issue on the Julia repo. If possible, reducing the number of packages required to make this happen would be helpful.

1 Like