@@ -2501,51 +2501,52 @@ function _require_from_serialized(uuidkey::PkgId, path::String, ocachepath::Unio
2501
2501
end
2502
2502
2503
2503
# load a serialized file directly from append_bundled_depot_path for uuidkey without stalechecks
2504
- function require_stdlib (uuidkey :: PkgId , ext:: Union{Nothing, String} = nothing )
2504
+ function require_stdlib (package_uuidkey :: PkgId , ext:: Union{Nothing, String} = nothing )
2505
2505
@lock require_lock begin
2506
- if root_module_exists (uuidkey)
2507
- return loaded_modules[uuidkey]
2506
+ # the PkgId of the ext, or package if not an ext
2507
+ this_uuidkey = ext isa String ? PkgId (uuid5 (package_uuidkey. uuid, ext), ext) : package_uuidkey
2508
+ if root_module_exists (this_uuidkey)
2509
+ return loaded_modules[this_uuidkey]
2508
2510
end
2509
2511
# first since this is a stdlib, try to look there directly first
2510
2512
env = Sys. STDLIB
2511
2513
# sourcepath = ""
2512
2514
if ext === nothing
2513
- sourcepath = normpath (env, uuidkey . name, " src" , uuidkey . name * " .jl" )
2515
+ sourcepath = normpath (env, this_uuidkey . name, " src" , this_uuidkey . name * " .jl" )
2514
2516
else
2515
- sourcepath = find_ext_path (normpath (joinpath (env, uuidkey. name)), ext)
2516
- uuidkey = PkgId (uuid5 (uuidkey. uuid, ext), ext)
2517
+ sourcepath = find_ext_path (normpath (joinpath (env, package_uuidkey. name)), ext)
2517
2518
end
2518
- # mbypath = manifest_uuid_path(env, uuidkey )
2519
+ # mbypath = manifest_uuid_path(env, this_uuidkey )
2519
2520
# if mbypath isa String && isfile_casesensitive(mbypath)
2520
2521
# sourcepath = mbypath
2521
2522
# else
2522
2523
# # if the user deleted the stdlib folder, we next try using their environment
2523
- # sourcepath = locate_package_env(uuidkey )
2524
+ # sourcepath = locate_package_env(this_uuidkey )
2524
2525
# if sourcepath !== nothing
2525
2526
# sourcepath, env = sourcepath
2526
2527
# end
2527
2528
# end
2528
2529
# if sourcepath === nothing
2529
2530
# throw(ArgumentError("""
2530
- # Package $(repr("text/plain", uuidkey )) is required but does not seem to be installed.
2531
+ # Package $(repr("text/plain", this_uuidkey )) is required but does not seem to be installed.
2531
2532
# """))
2532
2533
# end
2533
- set_pkgorigin_version_path (uuidkey , sourcepath)
2534
+ set_pkgorigin_version_path (this_uuidkey , sourcepath)
2534
2535
depot_path = append_bundled_depot_path! (empty (DEPOT_PATH ))
2535
- newm = start_loading (uuidkey )
2536
+ newm = start_loading (this_uuidkey )
2536
2537
newm === nothing || return newm
2537
2538
try
2538
- newm = _require_search_from_serialized (uuidkey , sourcepath, UInt128 (0 ), false ; DEPOT_PATH = depot_path)
2539
+ newm = _require_search_from_serialized (this_uuidkey , sourcepath, UInt128 (0 ), false ; DEPOT_PATH = depot_path)
2539
2540
finally
2540
- end_loading (uuidkey , newm)
2541
+ end_loading (this_uuidkey , newm)
2541
2542
end
2542
2543
if newm isa Module
2543
2544
# After successfully loading, notify downstream consumers
2544
- insert_extension_triggers (env, uuidkey )
2545
- run_package_callbacks (uuidkey )
2545
+ insert_extension_triggers (env, this_uuidkey )
2546
+ run_package_callbacks (this_uuidkey )
2546
2547
else
2547
2548
# if the user deleted their bundled depot, next try to load it completely normally
2548
- newm = _require_prelocked (uuidkey )
2549
+ newm = _require_prelocked (this_uuidkey )
2549
2550
end
2550
2551
return newm
2551
2552
end
0 commit comments