Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TestEnv for subpackages: precompile only the new test Project #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/julia-1.11/activate_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
@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)

Check warning on line 75 in src/julia-1.11/activate_set.jl

View check run for this annotation

Codecov / codecov/patch

src/julia-1.11/activate_set.jl#L75

Added line #L75 was not covered by tests

write_env(temp_ctx.env; update_undo=false)

return Base.active_project()
Expand Down
2 changes: 1 addition & 1 deletion src/julia-1.11/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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

Check warning on line 25 in src/julia-1.11/common.jl

View check run for this annotation

Codecov / codecov/patch

src/julia-1.11/common.jl#L25

Added line #L25 was not covered by tests
return ctx, pkgspec
end

Expand Down
5 changes: 5 additions & 0 deletions src/julia-1.9/activate_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/julia-1.9/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading