Skip to content

Regression in Julia 1.11: Cannot create fresh base sysimage (incremental=false) containing Pkg #976

@DilumAluthge

Description

@DilumAluthge

MWE

import PackageCompiler

sysimage_stdlibs = ["Pkg"]

base_sysimage = PackageCompiler.create_fresh_base_sysimage(
    sysimage_stdlibs;
    cpu_target = PackageCompiler.default_app_cpu_target(),
    sysimage_build_args = ``,
)

Expected behavior: no exception is thrown.

Actual behavior:

✔ [01m:35s] PackageCompiler: creating compiler .ji image (incremental=false)
⣄ [00m:55s] PackageCompiler: compiling fresh sysimage (incremental=false)error during bootstrap:
⠇ [00m:55s] PackageCompiler: compiling fresh sysimage (incremental=false)

LoadError("/var/folders/lp/2fm0z_wn3wqf__vj6lc1tcgh0000gq/T/jl_QNNqc5/sysimage_packagecompiler_fdb8261a-8ca⠋ [00m:55s] PackageCompiler: compiling fresh sysimage (incremental=false)57, LoadError("/myjuliapath/julia/1.11.0/share/julia/stdlib/v1.11/Pkg/src/Pkg.jl", 3, LoadError("/myjuliapath/julia/1.11.0/share/julia/stdlib/v1.11/Pkg/src/precompile.jl", 101, Base.IOError("could not spawn setenv(`'' a registries/Registry.tar.gz -tgzip registries/Registry.tar`,[... long list of environment variables ...]): permission denied (EACCES)", -13))))

_spawn_primitive at ./process.jl:140
[... very long stack trace ...]

✖ [00m:56s] PackageCompiler: compiling fresh sysimage (incremental=false)
ERROR: failed process: Process(setenv(`/myjuliapath/julia/1.11.0/bin/julia --color=yes --startup-file=no --pkgimages=no --cpu-target generic --sysimage=/var/folders/lp/2fm0z_wn3wqf__vj6lc1tcgh0000gq/T/jl_QNNqc5/corecompiler.ji --output-o=/var/folders/lp/2fm0z_wn3wqf__vj6lc1tcgh0000gq/T/jl_QNNqc5/sys-o.a /var/folders/lp/2fm0z_wn3wqf__vj6lc1tcgh0000gq/T/jl_QNNqc5/sysimage_packagecompiler_fdb8261a-8cae-11ef-3b3f-f5debedf65d6.jl`,[... long list of environment variables]), ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:598 [inlined]
  [2] read(cmd::Cmd)
    @ Base ./process.jl:482
  [3] macro expansion
    @ /mydir/PackageCompiler.jl/src/PackageCompiler.jl:270 [inlined]
  [4] (::PackageCompiler.var"#12#17"{String, Cmd, Vector{String}, String, String, String, String})()
    @ PackageCompiler /mydir/PackageCompiler.jl/ext/TerminalSpinners.jl:157
  [5] spin(f::PackageCompiler.var"#12#17"{…}, s::PackageCompiler.TerminalSpinners.Spinner{…})
    @ PackageCompiler.TerminalSpinners /mydir/PackageCompiler.jl/ext/TerminalSpinners.jl:164
  [6] macro expansion
    @ /mydir/PackageCompiler.jl/ext/TerminalSpinners.jl:157 [inlined]
  [7] (::PackageCompiler.var"#10#15"{String, Cmd, Vector{String}, String, String, String, String, String})()
    @ PackageCompiler /mydir/PackageCompiler.jl/src/PackageCompiler.jl:256
  [8] cd(f::PackageCompiler.var"#10#15"{String, Cmd, Vector{String}, String, String, String, String, String}, dir::String)
    @ Base.Filesystem ./file.jl:112
  [9] create_fresh_base_sysimage(stdlibs::Vector{String}; cpu_target::String, sysimage_build_args::Cmd)
    @ PackageCompiler /mydir/PackageCompiler.jl/src/PackageCompiler.jl:243
 [10] top-level scope
    @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.

The actual error message is difficult to see above, because the line is really long and thus you have to scroll so far to the right. So here is the error message itself as a Markdown quote:

LoadError("/var/folders/lp/2fm0z_wn3wqf__vj6lc1tcgh0000gq/T/jl_QNNqc5/sysimage_packagecompiler_fdb8261a-8ca⠋ [00m:55s] PackageCompiler: compiling fresh sysimage (incremental=false)57, LoadError("/myjuliapath/julia/1.11.0/share/julia/stdlib/v1.11/Pkg/src/Pkg.jl", 3, LoadError("/myjuliapath/julia/1.11.0/share/julia/stdlib/v1.11/Pkg/src/precompile.jl", 101, Base.IOError("could not spawn setenv('' a registries/Registry.tar.gz -tgzip registries/Registry.tar,[... long list of environment variables ...]): permission denied (EACCES)", -13))))

Julia versioninfo:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.0 (2024-10-07)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> versioninfo()
Julia Version 1.11.0
Commit 501a4f25c2b (2024-10-07 11:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

I can reproduce this bug on both Linux and macOS (Apple Silicon).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugregression Julia 1.11Represents a regression between Julia 1.10 and Julia 1.11

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions