Skip to content

Commit 0f2d3b7

Browse files
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 JuliaLang#963 and especially JuliaLang#990 containing a `git bisect` to the commit introducing the problem) Fixes JuliaLang#963 and JuliaLang#990
1 parent a32fe6b commit 0f2d3b7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/PackageCompiler.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,15 @@ function create_sysimg_object_file(object_file::String,
462462
write(outputo_file, julia_code)
463463
# Read the input via stdin to avoid hitting the maximum command line limit
464464

465-
cmd = `$(get_julia_cmd()) --cpu-target=$cpu_target $sysimage_build_args
466-
--sysimage=$base_sysimage --project=$project --output-o=$(object_file)
467-
$outputo_file`
468-
@debug "running $cmd"
465+
# Make sure, that the final system image is built single-threaded and
466+
# override any values set by "-t", "--threads" in `sysimage_build_args`
467+
# or provided via JULIA_NUM_THREADS.
468+
# This is needed until the underlying bug is fixed (see #963 and especially
469+
# #990 containing a `git bisect` to the commit introducing the problem)
470+
cmd = `$(get_julia_cmd()) --cpu-target=$cpu_target $sysimage_build_args
471+
--sysimage=$base_sysimage --project=$project --output-o=$(object_file)
472+
--threads=1 $outputo_file`
473+
@debug "running $cmd"
469474

470475
non = incremental ? "" : "non"
471476
spinner = TerminalSpinners.Spinner(msg = "PackageCompiler: compiling $(non)incremental system image")

0 commit comments

Comments
 (0)