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

[release-1.10] Remove incomplete support for precompile configs #4145

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Jan 31, 2025

Fixes this error on 1.10.8 reported by @fredrikekre
The error was introduced in backport #4107 but I'm not sure why tests didn't catch it as we do test for pidlocked precompilation

Pkg.jl/test/api.jl

Lines 235 to 261 in 6390ea9

@testset "pidlocked precompile" begin
proj = joinpath(pwd(), "packages", "SlowPrecompile")
cmd = addenv(`$(Base.julia_cmd()) --color=no --startup-file=no --project="$(pkgdir(Pkg))" -e "
using Pkg
Pkg.activate(\"$(escape_string(proj))\")
Pkg.precompile()
"`,
"JULIA_PKG_PRECOMPILE_AUTO" => "0")
iob1 = IOBuffer()
iob2 = IOBuffer()
try
Base.Experimental.@sync begin
@async run(pipeline(cmd, stderr=iob1, stdout=iob1))
@async run(pipeline(cmd, stderr=iob2, stdout=iob2))
end
catch
println("pidlocked precompile tests failed:")
println("process 1:\n", String(take!(iob1)))
println("process 2:\n", String(take!(iob2)))
rethrow()
end
s1 = String(take!(iob1))
s2 = String(take!(iob2))
@test occursin("Precompiling", s1)
@test occursin("Precompiling", s2)
@test any(contains("Being precompiled by another process (pid: "), (s1, s2))
end

  ◐ PkgServer Being precompiled by another process (pid: 981928, pidfile: /home/fredrik/.julia/compiled/v1.10/PkgServer/6eohG_aD2qu.ji.pidfile)
        InfoUnhandled Task ERROR: MethodError: no method matching isprecompiled(::Base.PkgId; ignore_loaded::Bool, flags::Base.CacheFlags)

Closest candidates are:
  isprecompiled(::Base.PkgId; ignore_loaded, stale_cache, cachepaths, sourcepath) got unsupported keyword argument "flags"
   @ Base loading.jl:1459

Stacktrace:
 [1] kwerr(::@NamedTuple{ignore_loaded::Bool, flags::Base.CacheFlags}, ::Function, ::Base.PkgId)
   @ Base ./error.jl:165
 [2] (::Pkg.API.Precompilation.var"#77#79"{Pkg.API.Precompilation.var"#27#67"{Pipe, Dict{Base.PkgId, Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}, String, Base.PkgId}, Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Base.CacheFlags, Base.PkgId})()
   @ Pkg.API.Precompilation ~/.julia/juliaup/julia-1.10.8+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/precompilation.jl:1073
 [3] mkpidlock(f::Pkg.API.Precompilation.var"#77#79"{Pkg.API.Precompilation.var"#27#67"{Pipe, Dict{Base.PkgId, Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}, String, Base.PkgId}, Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Base.CacheFlags, Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.8+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [4] #mkpidlock#6
   @ ~/.julia/juliaup/julia-1.10.8+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [5] precompile_pkgs_maybe_cachefile_lock(f::Pkg.API.Precompilation.var"#27#67"{Pipe, Dict{Base.PkgId, Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}, String, Base.PkgId}, io::IOContext{IO}, print_lock::ReentrantLock, fancyprint::Bool, pkg_config::Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, pkgspidlocked::Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, hascolor::Bool)
   @ Pkg.API.Precompilation ~/.julia/juliaup/julia-1.10.8+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/precompilation.jl:1071
 [6] macro expansion
   @ ./timing.jl:395 [inlined]
 [7] (::Pkg.API.Precompilation.var"#24#64"{Bool, Bool, Vector{Task}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, IOBuffer}, Base.Event, Base.Event, ReentrantLock, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Vector{Base.PkgId}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Base.Event}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Pkg.API.Precompilation.var"#describe_pkg#37"{Dict{Base.PkgId, Base.PkgId}, Pkg.API.Precompilation.var"#color_string#36"{Bool}, Int64}, Dict{Base.PkgId, Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}, Dict{Tuple{Base.PkgId, UInt128, String, String}, Bool}, Pkg.API.Precompilation.var"#color_string#36"{Bool}, Bool, Base.Semaphore, Bool, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId, Base.CacheFlags, Cmd, Pair{Cmd, Base.CacheFlags}, Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}})()
   @ Pkg.API.Precompilation ~/.julia/juliaup/julia-1.10.8+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/precompilation.jl:864

@IanButterworth IanButterworth force-pushed the ib/1.10_fix_isprecompiled branch from c4c9eb9 to 4fb825e Compare January 31, 2025 17:40
@IanButterworth IanButterworth merged commit 0b3af45 into JuliaLang:release-1.10 Jan 31, 2025
10 of 11 checks passed
@IanButterworth IanButterworth deleted the ib/1.10_fix_isprecompiled branch January 31, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants