Skip to content

Julia 1.9: precompile prints fatal error in type inference (type bound) when mixing pkgimages=yes and pkgimages=no #48397

@fonsp

Description

@fonsp

If you precompile the same package environment twice, once with julia --pkgimages=yes, and once with julia --pkgimages=no, then calling Pkg.precompile() a third time will print lots of errors:

➜   julia19 --pkgimages=no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-beta3 (2023-01-18)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.9) pkg> activate hellohello
  Activating new project at `~/temp/hellohello`

(hellohello) pkg> add HTTP
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `~/temp/hellohello/Project.toml`
  [cd3eb016] + HTTP v1.7.3
    Updating `~/temp/hellohello/Manifest.toml`
  [d1d4a3ce] + BitFlags v0.1.7
  [944b1d66] + CodecZlib v0.7.0
  [cd3eb016] + HTTP v1.7.3
  [83e8ac13] + IniFile v0.5.1
  [692b3bcd] + JLLWrappers v1.4.1
  [e6f89c97] + LoggingExtras v1.0.0
...
Precompiling environment...
  16 dependencies successfully precompiled in 3 seconds

(hellohello) pkg> 
➜  julia19 --pkgimages=yes
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-beta3 (2023-01-18)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.9) pkg> activate hellohello
  Activating project at `~/temp/hellohello`

(hellohello) pkg> precompile
Precompiling environment...
  16 dependencies successfully precompiled in 8 seconds

(hellohello) pkg> 
➜  julia19 --pkgimages=no 
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-beta3 (2023-01-18)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.9) pkg> activate hellohello
  Activating project at `~/temp/hellohello`

(hellohello) pkg> precompile

(hellohello) pkg> ┌ Error: Pkg.precompile error
│   exception =
│    fatal error in type inference (type bound)
│    Stacktrace:
│     [1] get!(default::Pkg.API.var"#212#213"{UInt128, Base.PkgId, String, String}, h::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, key::Tuple{Base.PkgId, UInt128, String, String})
│       @ Base ./dict.jl:468
│     [2] _is_stale!(stale_cache::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, paths::Vector{String}, sourcepath::String)
│       @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1051
│     [3] macro expansion
│       @ /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1371 [inlined]
│     [4] (::Pkg.API.var"#235#264"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#256"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#254", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, String, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, String}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│       @ Pkg.API ./task.jl:514
└ @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1260
┌ Error: Pkg.precompile error
│   exception =
│    fatal error in type inference (type bound)
│    Stacktrace:
│     [1] get!(default::Pkg.API.var"#212#213"{UInt128, Base.PkgId, String, String}, h::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, key::Tuple{Base.PkgId, UInt128, String, String})
│       @ Base ./dict.jl:468
│     [2] _is_stale!(stale_cache::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, paths::Vector{String}, sourcepath::String)
│       @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1051
│     [3] macro expansion
│       @ /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1371 [inlined]
│     [4] (::Pkg.API.var"#235#264"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#256"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#254", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, String, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, String}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│       @ Pkg.API ./task.jl:514
└ @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1260
┌ Error: Pkg.precompile error
│   exception =
│    fatal error in type inference (type bound)
│    Stacktrace:
│     [1] get!(default::Pkg.API.var"#212#213"{UInt128, Base.PkgId, String, String}, h::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, key::Tuple{Base.PkgId, UInt128, String, String})
│       @ Base ./dict.jl:468
│     [2] _is_stale!(stale_cache::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, paths::Vector{String}, sourcepath::String)
│       @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1051
│     [3] macro expansion
│       @ /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1371 [inlined]
│     [4] (::Pkg.API.var"#235#264"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#256"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#254", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, String, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, String}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│       @ Pkg.API ./task.jl:514
└ @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1260
┌ Error: Pkg.precompile error
│   exception =
│    fatal error in type inference (type bound)
│    Stacktrace:
│     [1] get!(default::Pkg.API.var"#212#213"{UInt128, Base.PkgId, String, String}, h::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, key::Tuple{Base.PkgId, UInt128, String, String})
│       @ Base ./dict.jl:468
│     [2] _is_stale!(stale_cache::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, paths::Vector{String}, sourcepath::String)
│       @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1051
│     [3] macro expansion
│       @ /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1371 [inlined]
│     [4] (::Pkg.API.var"#235#264"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#256"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#254", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, String, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, String}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│       @ Pkg.API ./task.jl:514
└ @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1260
┌ Error: Pkg.precompile error
│   exception =
│    fatal error in type inference (type bound)
│    Stacktrace:
│     [1] get!(default::Pkg.API.var"#212#213"{UInt128, Base.PkgId, String, String}, h::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, key::Tuple{Base.PkgId, UInt128, String, String})
│       @ Base ./dict.jl:468
│     [2] _is_stale!(stale_cache::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, paths::Vector{String}, sourcepath::String)
│       @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1051
│     [3] macro expansion
│       @ /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1371 [inlined]
│     [4] (::Pkg.API.var"#235#264"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#256"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#254", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, String, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, String}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│       @ Pkg.API ./task.jl:514
└ @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1260
┌ Error: Pkg.precompile error
│   exception =
│    fatal error in type inference (type bound)
│    Stacktrace:
│     [1] get!(default::Pkg.API.var"#212#213"{UInt128, Base.PkgId, String, String}, h::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, key::Tuple{Base.PkgId, UInt128, String, String})
│       @ Base ./dict.jl:468
│     [2] _is_stale!(stale_cache::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, paths::Vector{String}, sourcepath::String)
│       @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1051
│     [3] macro expansion
│       @ /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1371 [inlined]
│     [4] (::Pkg.API.var"#235#264"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#256"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#254", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, String, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, String}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│       @ Pkg.API ./task.jl:514
└ @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1260
┌ Error: Pkg.precompile error
│   exception =
│    fatal error in type inference (type bound)
│    Stacktrace:
│     [1] get!(default::Pkg.API.var"#212#213"{UInt128, Base.PkgId, String, String}, h::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, key::Tuple{Base.PkgId, UInt128, String, String})
│       @ Base ./dict.jl:468
│     [2] _is_stale!(stale_cache::Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, paths::Vector{String}, sourcepath::String)
│       @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1051
│     [3] macro expansion
│       @ /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1371 [inlined]
│     [4] (::Pkg.API.var"#235#264"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#256"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#254", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, String, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, String}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Union{Bool, Tuple{Vector{Any}, String}}}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│       @ Pkg.API ./task.jl:514
└ @ Pkg.API /Applications/Julia-1.9 ARM.app/Contents/Resources/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1260
(hellohello) pkg> 

julia> 1+1
2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions