diff --git a/Project.toml b/Project.toml index 95007614b..26ffd86e3 100644 --- a/Project.toml +++ b/Project.toml @@ -10,6 +10,7 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +Preferences = "21216c6a-2e73-6563-6e65-726566657250" Reseau = "802f3686-a58f-41ce-bb0c-3c43c75bba36" SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" @@ -19,6 +20,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" CodecZlib = "0.7" EnumX = "1" PrecompileTools = "1.2.1" +Preferences = "1" Reseau = "1.1.1" URIs = "1.6.1" julia = "1.10" diff --git a/src/precompile.jl b/src/precompile.jl index 848ff325e..45e4b3288 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -1,4 +1,5 @@ using PrecompileTools: @setup_workload, @compile_workload +using Preferences: load_preference # Shared high-level workload used by package precompilation. @@ -313,7 +314,7 @@ end function _run_precompile_workload!()::Nothing task = Threads.@spawn _run_precompile_workload_inner!() try - status = IOPoll.timedwait(() -> istaskdone(task), 20.0; pollint = 0.01) + status = Base.timedwait(() -> istaskdone(task), 20.0; pollint = 0.01) if status == :timed_out @try_ignore begin IOPoll.shutdown!() @@ -321,7 +322,7 @@ function _run_precompile_workload!()::Nothing @try_ignore begin Base.throwto(task, InterruptException()) end - _ = IOPoll.timedwait(() -> istaskdone(task), 2.0; pollint = 0.01) + _ = Base.timedwait(() -> istaskdone(task), 2.0; pollint = 0.01) error("HTTP precompile workload timed out") end fetch(task) @@ -335,6 +336,10 @@ end function _precompile_workload_enabled()::Bool Base.JLOptions().code_coverage == 0 || return false + # See JuliaWeb/HTTP.jl#1252: on Linux Julia 1.11+, the live precompile + # workload can hang in the Reseau/epoll path, so keep it opt-in there. + default_enabled = !(Sys.islinux() && VERSION >= v"1.11") + load_preference(@__MODULE__, "precompile_workload", default_enabled) || return false try return !isempty(HostResolvers.resolve_tcp_addrs("tcp", "localhost:0")) catch