diff --git a/base/loading.jl b/base/loading.jl index 02bbd6fcff7f8..0d26912a12e7b 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1112,7 +1112,6 @@ function insert_extension_triggers(pkg::PkgId) pkg.uuid === nothing && return for env in load_path() insert_extension_triggers(env, pkg) - break # For now, only insert triggers for packages in the first load_path. end end diff --git a/test/loading.jl b/test/loading.jl index a7e48d6b02160..f98f08103c9d7 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -1000,24 +1000,37 @@ end try tmp = mktempdir() push!(empty!(DEPOT_PATH), joinpath(tmp, "depot")) - proj = joinpath(@__DIR__, "project", "Extensions", "HasDepWithExtensions.jl") - for compile in (`--compiled-modules=no`, ``, ``) # Once when requiring precomilation, once where it is already precompiled - cmd = `$(Base.julia_cmd()) $compile --project=$proj --startup-file=no -e ' - begin - using HasExtensions - # Base.get_extension(HasExtensions, :Extension) === nothing || error("unexpectedly got an extension") - HasExtensions.ext_loaded && error("ext_loaded set") - using HasDepWithExtensions - # Base.get_extension(HasExtensions, :Extension).extvar == 1 || error("extvar in Extension not set") - HasExtensions.ext_loaded || error("ext_loaded not set") - HasExtensions.ext_folder_loaded && error("ext_folder_loaded set") - HasDepWithExtensions.do_something() || error("do_something errored") - using ExtDep2 - HasExtensions.ext_folder_loaded || error("ext_folder_loaded not set") + function gen_extension_cmd(compile) + ```$(Base.julia_cmd()) $compile --startup-file=no -e ' + begin + using HasExtensions + # Base.get_extension(HasExtensions, :Extension) === nothing || error("unexpectedly got an extension") + HasExtensions.ext_loaded && error("ext_loaded set") + using HasDepWithExtensions + # Base.get_extension(HasExtensions, :Extension).extvar == 1 || error("extvar in Extension not set") + HasExtensions.ext_loaded || error("ext_loaded not set") + HasExtensions.ext_folder_loaded && error("ext_folder_loaded set") + HasDepWithExtensions.do_something() || error("do_something errored") + using ExtDep2 + HasExtensions.ext_folder_loaded || error("ext_folder_loaded not set") end - '` + ' + ``` + end + + for compile in (`--compiled-modules=no`, ``, ``) # Once when requiring precomilation, once where it is already precompiled + cmd = gen_extension_cmd(compile) + withenv("JULIA_LOAD_PATH" => proj) do + @test success(cmd) + end + end + + # 48351 + sep = Sys.iswindows() ? ';' : ':' + withenv("JULIA_LOAD_PATH" => join([mktempdir(), proj], sep)) do + cmd = gen_extension_cmd(``) @test success(cmd) end finally