From 0f2d3b70cff4a72fd77d0af68de93e2491abd346 Mon Sep 17 00:00:00 2001 From: PatrickHaecker <152268010+PatrickHaecker@users.noreply.github.com> Date: Tue, 22 Apr 2025 10:19:36 +0200 Subject: [PATCH 1/2] Fix hanging system image creation if multiple threads are set Make sure, that the final system image is built single-threaded and override any values set by "-t", "--threads" in sysimage_build_args` or provided via JULIA_NUM_THREADS. This is needed until the underlying bug is fixed (see #963 and especially #990 containing a `git bisect` to the commit introducing the problem) Fixes #963 and #990 --- src/PackageCompiler.jl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/PackageCompiler.jl b/src/PackageCompiler.jl index c58ddf5f..cf3ddec7 100644 --- a/src/PackageCompiler.jl +++ b/src/PackageCompiler.jl @@ -462,10 +462,15 @@ function create_sysimg_object_file(object_file::String, write(outputo_file, julia_code) # Read the input via stdin to avoid hitting the maximum command line limit - cmd = `$(get_julia_cmd()) --cpu-target=$cpu_target $sysimage_build_args - --sysimage=$base_sysimage --project=$project --output-o=$(object_file) - $outputo_file` - @debug "running $cmd" + # Make sure, that the final system image is built single-threaded and + # override any values set by "-t", "--threads" in `sysimage_build_args` + # or provided via JULIA_NUM_THREADS. + # This is needed until the underlying bug is fixed (see #963 and especially + # #990 containing a `git bisect` to the commit introducing the problem) + cmd = `$(get_julia_cmd()) --cpu-target=$cpu_target $sysimage_build_args + --sysimage=$base_sysimage --project=$project --output-o=$(object_file) + --threads=1 $outputo_file` + @debug "running $cmd" non = incremental ? "" : "non" spinner = TerminalSpinners.Spinner(msg = "PackageCompiler: compiling $(non)incremental system image") From 9f25ce97c4a306f26b0460f9e9c24130ef60bd65 Mon Sep 17 00:00:00 2001 From: PatrickHaecker <152268010+PatrickHaecker@users.noreply.github.com> Date: Wed, 28 May 2025 06:26:14 +0200 Subject: [PATCH 2/2] Include the whole issue URL Co-authored-by: Dilum Aluthge --- src/PackageCompiler.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PackageCompiler.jl b/src/PackageCompiler.jl index cf3ddec7..fc447915 100644 --- a/src/PackageCompiler.jl +++ b/src/PackageCompiler.jl @@ -465,8 +465,8 @@ function create_sysimg_object_file(object_file::String, # Make sure, that the final system image is built single-threaded and # override any values set by "-t", "--threads" in `sysimage_build_args` # or provided via JULIA_NUM_THREADS. - # This is needed until the underlying bug is fixed (see #963 and especially - # #990 containing a `git bisect` to the commit introducing the problem) + # This is needed until the underlying bug is fixed (see https://github.com/JuliaLang/PackageCompiler.jl/issues/963 and especially + # https://github.com/JuliaLang/PackageCompiler.jl/issues/990 containing a `git bisect` to the commit introducing the problem) cmd = `$(get_julia_cmd()) --cpu-target=$cpu_target $sysimage_build_args --sysimage=$base_sysimage --project=$project --output-o=$(object_file) --threads=1 $outputo_file`