Skip to content

Commit 80e3754

Browse files
authored
Merge pull request #90 from JuliaTesting/nhd-test-env-subprojects
Fix TestEnv for subpackages: precompile only the new test Project
2 parents e97b393 + ca78f97 commit 80e3754

9 files changed

Lines changed: 25 additions & 5 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "TestEnv"
22
uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b"
3-
version = "1.103.2"
3+
version = "1.103.3"
44

55
[deps]
66
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

src/julia-1.11/activate_set.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true)
8484
@debug "Using _clean_ dep graph"
8585
end
8686

87+
# Now that we have set up the sandbox environment, precompile all its packages:
88+
# (Reconnect the `io` back to the original context so the caller can see the
89+
# precompilation progress.)
90+
Pkg.precompile(temp_ctx; io=ctx.io, already_instantiated=true)
91+
8792
write_env(temp_ctx.env; update_undo=false)
8893

8994
return Base.active_project()

src/julia-1.11/common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString)
2222
pkgspec = deepcopy(PackageSpec(pkg))
2323
ctx = Context()
2424
isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻"))
25-
Pkg.instantiate(ctx)
25+
Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox
2626
return ctx, pkgspec
2727
end
2828

src/julia-1.12/activate_set.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true)
8484
@debug "Using _clean_ dep graph"
8585
end
8686

87+
# Now that we have set up the sandbox environment, precompile all its packages:
88+
# (Reconnect the `io` back to the original context so the caller can see the
89+
# precompilation progress.)
90+
Pkg.precompile(temp_ctx; io=ctx.io, already_instantiated=true)
91+
8792
write_env(temp_ctx.env; update_undo=false)
8893

8994
return Base.active_project()

src/julia-1.12/common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString)
2222
pkgspec = deepcopy(PackageSpec(pkg))
2323
ctx = Context()
2424
isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻"))
25-
Pkg.instantiate(ctx)
25+
Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox
2626
return ctx, pkgspec
2727
end
2828

src/julia-1.13/activate_set.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true)
8484
@debug "Using _clean_ dep graph"
8585
end
8686

87+
# Now that we have set up the sandbox environment, precompile all its packages:
88+
# (Reconnect the `io` back to the original context so the caller can see the
89+
# precompilation progress.)
90+
Pkg.precompile(temp_ctx; io=ctx.io, already_instantiated=true)
91+
8792
write_env(temp_ctx.env; update_undo=false)
8893

8994
return Base.active_project()

src/julia-1.13/common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString)
2222
pkgspec = deepcopy(PackageSpec(pkg))
2323
ctx = Context()
2424
isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻"))
25-
Pkg.instantiate(ctx)
25+
Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox
2626
return ctx, pkgspec
2727
end
2828

src/julia-1.9/activate_set.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ function activate(pkg::AbstractString=current_pkg_name(); allow_reresolve=true)
6969
@debug "Using _clean_ dep graph"
7070
end
7171

72+
# Now that we have set up the sandbox environment, precompile all its packages:
73+
# (Reconnect the `io` back to the original context so the caller can see the
74+
# precompilation progress.)
75+
Pkg.precompile(temp_ctx; io=ctx.io)
76+
7277
write_env(temp_ctx.env; update_undo=false)
7378

7479
return Base.active_project()

src/julia-1.9/common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function ctx_and_pkgspec(pkg::AbstractString)
2222
pkgspec = deepcopy(PackageSpec(pkg))
2323
ctx = Context()
2424
isinstalled!(ctx, pkgspec) || throw(TestEnvError("$pkg not installed 👻"))
25-
Pkg.instantiate(ctx)
25+
Pkg.instantiate(ctx; allow_autoprecomp = false) # do precomp later within sandbox
2626
return ctx, pkgspec
2727
end
2828

0 commit comments

Comments
 (0)