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 precompilation Julia 1.11 #3054

Merged
merged 1 commit into from
Oct 14, 2024
Merged
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
16 changes: 10 additions & 6 deletions src/packages/Packages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ function sync_nbpkg_core(
used_tier = tier

try
Pkg.add(notebook.nbpkg_ctx, [
Pkg.PackageSpec(name=p)
for p in to_add
]; preserve=used_tier)
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do
Pkg.add(notebook.nbpkg_ctx, [
Pkg.PackageSpec(name=p)
for p in to_add
]; preserve=used_tier)
end

break
catch e
Expand Down Expand Up @@ -581,10 +583,12 @@ function update_nbpkg_core(
phasemessage(iolistener, "Updating packages")
# We temporarily clear the "semver-compatible" [deps] entries, because it is difficult to update them after the update 🙈. TODO
PkgCompat.clear_auto_compat_entries!(notebook.nbpkg_ctx)

try
###
Pkg.update(notebook.nbpkg_ctx; level=level)
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do
Pkg.update(notebook.nbpkg_ctx; level=level)
end
###
finally
PkgCompat.write_auto_compat_entries!(notebook.nbpkg_ctx)
Expand Down
7 changes: 6 additions & 1 deletion src/packages/PkgCompat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ end

# I'm a pirate harrr 🏴‍☠️
@static if isdefined(Pkg, :can_fancyprint)
Pkg.can_fancyprint(io::Union{IOContext{IOBuffer},IOContext{Base.BufferStream}}) = get(io, :sneaky_enable_tty, false) === true
Pkg.can_fancyprint(io::Union{IOContext{IOBuffer},IOContext{Base.BufferStream}}) =
get(io, :sneaky_enable_tty, false) === true
end
@static if isdefined(Base, :Precompilation) && isdefined(Base.Precompilation, :can_fancyprint)
Base.Precompilation.can_fancyprint(io::Union{IOContext{IOBuffer},IOContext{Base.BufferStream}}) =
get(io, :sneaky_enable_tty, false) === true
end

###
Expand Down
3 changes: 3 additions & 0 deletions src/packages/precompile_isolated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ function precompile_isolated(
@static if isdefined(Pkg, :can_fancyprint)
Pkg.can_fancyprint(io::IO) = true
end
@static if isdefined(Base, :Precompilation) && isdefined(Base.Precompilation, :can_fancyprint)
Base.Precompilation.can_fancyprint(io::IO) = true
end

Pkg.activate($(repr(environment)); io=out_stream)
Pkg.precompile(; already_instantiated=true, io=out_stream)
Expand Down
Loading