From c30e22d18d69d1d74b2afe27a2c27b6de983f7f3 Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Thu, 17 Oct 2024 13:11:01 -0600 Subject: [PATCH 1/3] Fix TestEnv for subpackages: precompile only the new test Project --- src/julia-1.11/activate_set.jl | 5 +++++ src/julia-1.11/common.jl | 2 +- src/julia-1.9/activate_set.jl | 5 +++++ src/julia-1.9/common.jl | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/julia-1.11/activate_set.jl b/src/julia-1.11/activate_set.jl index 20cc47f..3d107f8 100644 --- a/src/julia-1.11/activate_set.jl +++ b/src/julia-1.11/activate_set.jl @@ -69,6 +69,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true) @debug "Using _clean_ dep graph" end + # Now that we have set up the sandbox environment, precompile all its packages: + # (Reconnect the `io` back to the original context so the caller can see the + # precompilation progress.) + Pkg.precompile(temp_ctx; io=ctx.io) + write_env(temp_ctx.env; update_undo=false) return Base.active_project() diff --git a/src/julia-1.11/common.jl b/src/julia-1.11/common.jl index 3e5ccf5..96fa755 100644 --- a/src/julia-1.11/common.jl +++ b/src/julia-1.11/common.jl @@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString) pkgspec = deepcopy(PackageSpec(pkg)) ctx = Context() isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻")) - Pkg.instantiate(ctx) + Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox return ctx, pkgspec end diff --git a/src/julia-1.9/activate_set.jl b/src/julia-1.9/activate_set.jl index 20cc47f..3d107f8 100644 --- a/src/julia-1.9/activate_set.jl +++ b/src/julia-1.9/activate_set.jl @@ -69,6 +69,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true) @debug "Using _clean_ dep graph" end + # Now that we have set up the sandbox environment, precompile all its packages: + # (Reconnect the `io` back to the original context so the caller can see the + # precompilation progress.) + Pkg.precompile(temp_ctx; io=ctx.io) + write_env(temp_ctx.env; update_undo=false) return Base.active_project() diff --git a/src/julia-1.9/common.jl b/src/julia-1.9/common.jl index 3e5ccf5..96fa755 100644 --- a/src/julia-1.9/common.jl +++ b/src/julia-1.9/common.jl @@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString) pkgspec = deepcopy(PackageSpec(pkg)) ctx = Context() isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻")) - Pkg.instantiate(ctx) + Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox return ctx, pkgspec end From 190dd786341e29d030baa9cfca9e144cf1a07c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Drvo=C5=A1t=C4=9Bp?= Date: Tue, 10 Feb 2026 11:35:16 +0100 Subject: [PATCH 2/3] Add the fix to 1.12 and 1.13, assume the env is instantiated --- src/julia-1.11/activate_set.jl | 2 +- src/julia-1.12/activate_set.jl | 5 +++++ src/julia-1.12/common.jl | 2 +- src/julia-1.13/activate_set.jl | 5 +++++ src/julia-1.13/common.jl | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/julia-1.11/activate_set.jl b/src/julia-1.11/activate_set.jl index 16ce3cc..fbffb3d 100644 --- a/src/julia-1.11/activate_set.jl +++ b/src/julia-1.11/activate_set.jl @@ -87,7 +87,7 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true) # Now that we have set up the sandbox environment, precompile all its packages: # (Reconnect the `io` back to the original context so the caller can see the # precompilation progress.) - Pkg.precompile(temp_ctx; io=ctx.io) + Pkg.precompile(temp_ctx; io=ctx.io, already_instantiated=true) write_env(temp_ctx.env; update_undo=false) diff --git a/src/julia-1.12/activate_set.jl b/src/julia-1.12/activate_set.jl index f8918bf..10a931b 100644 --- a/src/julia-1.12/activate_set.jl +++ b/src/julia-1.12/activate_set.jl @@ -84,6 +84,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true) @debug "Using _clean_ dep graph" end + # Now that we have set up the sandbox environment, precompile all its packages: + # (Reconnect the `io` back to the original context so the caller can see the + # precompilation progress.) + Pkg.precompile(temp_ctx; io=ctx.io, already_instantiated=true) + write_env(temp_ctx.env; update_undo=false) return Base.active_project() diff --git a/src/julia-1.12/common.jl b/src/julia-1.12/common.jl index 4e521e9..af969ac 100644 --- a/src/julia-1.12/common.jl +++ b/src/julia-1.12/common.jl @@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString) pkgspec = deepcopy(PackageSpec(pkg)) ctx = Context() isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻")) - Pkg.instantiate(ctx) + Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox return ctx, pkgspec end diff --git a/src/julia-1.13/activate_set.jl b/src/julia-1.13/activate_set.jl index f8918bf..10a931b 100644 --- a/src/julia-1.13/activate_set.jl +++ b/src/julia-1.13/activate_set.jl @@ -84,6 +84,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true) @debug "Using _clean_ dep graph" end + # Now that we have set up the sandbox environment, precompile all its packages: + # (Reconnect the `io` back to the original context so the caller can see the + # precompilation progress.) + Pkg.precompile(temp_ctx; io=ctx.io, already_instantiated=true) + write_env(temp_ctx.env; update_undo=false) return Base.active_project() diff --git a/src/julia-1.13/common.jl b/src/julia-1.13/common.jl index 4e521e9..af969ac 100644 --- a/src/julia-1.13/common.jl +++ b/src/julia-1.13/common.jl @@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString) pkgspec = deepcopy(PackageSpec(pkg)) ctx = Context() isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻")) - Pkg.instantiate(ctx) + Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox return ctx, pkgspec end From ca78f978097dd1af4ed47d74a9a3503c791a651d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Drvo=C5=A1t=C4=9Bp?= Date: Tue, 10 Feb 2026 11:35:28 +0100 Subject: [PATCH 3/3] v1.103.3 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 16d486f..711d5df 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "TestEnv" uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b" -version = "1.103.2" +version = "1.103.3" [deps] Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"