From 830f23bbae77e81903d4f10201b35e92ca937989 Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Mon, 15 Apr 2024 16:37:49 +0200 Subject: [PATCH 1/4] Fix `JULIA_CPU_TARGET` being propagated to workers precompiling stdlib pkgimages Apparently (thanks ChatGPT) each line in a make file is executed in a separate shell so adding an `export` line on one line does not propagate to the next line. --- pkgimage.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgimage.mk b/pkgimage.mk index 740b9760cab48..0bc035ee03b08 100644 --- a/pkgimage.mk +++ b/pkgimage.mk @@ -25,8 +25,7 @@ print-depot-path: @$(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e '@show Base.DEPOT_PATH') $(BUILDDIR)/stdlib/%.image: $(JULIAHOME)/stdlib/Project.toml $(JULIAHOME)/stdlib/Manifest.toml $(INDEPENDENT_STDLIBS_SRCS) $(JULIA_DEPOT_PATH)/compiled - export JULIA_CPU_TARGET="$(JULIA_CPU_TARGET)" - @$(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e 'Base.Precompilation.precompilepkgs(;configs=[``=>Base.CacheFlags(), `--check-bounds=yes`=>Base.CacheFlags(;check_bounds=1)])') + @$(call PRINT_JULIA, JULIA_CPU_TARGET="$(JULIA_CPU_TARGET)" $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e 'Base.Precompilation.precompilepkgs(;configs=[``=>Base.CacheFlags(), `--check-bounds=yes`=>Base.CacheFlags(;check_bounds=1)])') touch $@ $(BUILDDIR)/stdlib/release.image: $(build_private_libdir)/sys.$(SHLIB_EXT) From 0bc1842bde89ff32c78490b2fa522451b6bdcc77 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Tue, 14 May 2024 15:36:57 +0200 Subject: [PATCH 2/4] show some printouts --- base/loading.jl | 4 ++++ pkgimage.mk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/base/loading.jl b/base/loading.jl index ec90015350d7a..c66e686c63d7c 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -2831,6 +2831,10 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o:: opts = `-O0 --output-ji $(output) --output-incremental=yes` end + @show output_o + @show cpu_target + @show julia_cmd(;cpu_target) + trace = isassigned(PRECOMPILE_TRACE_COMPILE) ? `--trace-compile=$(PRECOMPILE_TRACE_COMPILE[])` : `` io = open(pipeline(addenv(`$(julia_cmd(;cpu_target)::Cmd) $(flags) diff --git a/pkgimage.mk b/pkgimage.mk index 0bc035ee03b08..41508c05ac6cd 100644 --- a/pkgimage.mk +++ b/pkgimage.mk @@ -25,7 +25,7 @@ print-depot-path: @$(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e '@show Base.DEPOT_PATH') $(BUILDDIR)/stdlib/%.image: $(JULIAHOME)/stdlib/Project.toml $(JULIAHOME)/stdlib/Manifest.toml $(INDEPENDENT_STDLIBS_SRCS) $(JULIA_DEPOT_PATH)/compiled - @$(call PRINT_JULIA, JULIA_CPU_TARGET="$(JULIA_CPU_TARGET)" $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e 'Base.Precompilation.precompilepkgs(;configs=[``=>Base.CacheFlags(), `--check-bounds=yes`=>Base.CacheFlags(;check_bounds=1)])') + @$(call PRINT_JULIA, JULIA_CPU_TARGET="$(JULIA_CPU_TARGET)" $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e 'Base.Precompilation.precompilepkgs(;timing=true, configs=[``=>Base.CacheFlags(), `--check-bounds=yes`=>Base.CacheFlags(;check_bounds=1)])') touch $@ $(BUILDDIR)/stdlib/release.image: $(build_private_libdir)/sys.$(SHLIB_EXT) From 5919fca4f69a48ab2a4dbf37cfd52048bc0787de Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 14 Oct 2024 14:08:26 +0200 Subject: [PATCH 3/4] Update loading.jl --- base/loading.jl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index c66e686c63d7c..ec90015350d7a 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -2831,10 +2831,6 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o:: opts = `-O0 --output-ji $(output) --output-incremental=yes` end - @show output_o - @show cpu_target - @show julia_cmd(;cpu_target) - trace = isassigned(PRECOMPILE_TRACE_COMPILE) ? `--trace-compile=$(PRECOMPILE_TRACE_COMPILE[])` : `` io = open(pipeline(addenv(`$(julia_cmd(;cpu_target)::Cmd) $(flags) From b505f7542a48097bee44b34e25fafcf352a3f455 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 14 Oct 2024 14:12:49 +0200 Subject: [PATCH 4/4] remove timing --- pkgimage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgimage.mk b/pkgimage.mk index 41508c05ac6cd..0bc035ee03b08 100644 --- a/pkgimage.mk +++ b/pkgimage.mk @@ -25,7 +25,7 @@ print-depot-path: @$(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e '@show Base.DEPOT_PATH') $(BUILDDIR)/stdlib/%.image: $(JULIAHOME)/stdlib/Project.toml $(JULIAHOME)/stdlib/Manifest.toml $(INDEPENDENT_STDLIBS_SRCS) $(JULIA_DEPOT_PATH)/compiled - @$(call PRINT_JULIA, JULIA_CPU_TARGET="$(JULIA_CPU_TARGET)" $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e 'Base.Precompilation.precompilepkgs(;timing=true, configs=[``=>Base.CacheFlags(), `--check-bounds=yes`=>Base.CacheFlags(;check_bounds=1)])') + @$(call PRINT_JULIA, JULIA_CPU_TARGET="$(JULIA_CPU_TARGET)" $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no -e 'Base.Precompilation.precompilepkgs(;configs=[``=>Base.CacheFlags(), `--check-bounds=yes`=>Base.CacheFlags(;check_bounds=1)])') touch $@ $(BUILDDIR)/stdlib/release.image: $(build_private_libdir)/sys.$(SHLIB_EXT)