@@ -2453,51 +2453,52 @@ function _require_from_serialized(uuidkey::PkgId, path::String, ocachepath::Unio
2453
2453
end
2454
2454
2455
2455
# load a serialized file directly from append_bundled_depot_path for uuidkey without stalechecks
2456
- function require_stdlib (uuidkey :: PkgId , ext:: Union{Nothing, String} = nothing )
2456
+ function require_stdlib (package_uuidkey :: PkgId , ext:: Union{Nothing, String} = nothing )
2457
2457
@lock require_lock begin
2458
- if root_module_exists (uuidkey)
2459
- return loaded_modules[uuidkey]
2458
+ # the PkgId of the ext, or package if not an ext
2459
+ this_uuidkey = ext isa String ? PkgId (uuid5 (package_uuidkey. uuid, ext), ext) : package_uuidkey
2460
+ if root_module_exists (this_uuidkey)
2461
+ return loaded_modules[this_uuidkey]
2460
2462
end
2461
2463
# first since this is a stdlib, try to look there directly first
2462
2464
env = Sys. STDLIB
2463
2465
# sourcepath = ""
2464
2466
if ext === nothing
2465
- sourcepath = normpath (env, uuidkey . name, " src" , uuidkey . name * " .jl" )
2467
+ sourcepath = normpath (env, this_uuidkey . name, " src" , this_uuidkey . name * " .jl" )
2466
2468
else
2467
- sourcepath = find_ext_path (normpath (joinpath (env, uuidkey. name)), ext)
2468
- uuidkey = PkgId (uuid5 (uuidkey. uuid, ext), ext)
2469
+ sourcepath = find_ext_path (normpath (joinpath (env, package_uuidkey. name)), ext)
2469
2470
end
2470
- # mbypath = manifest_uuid_path(env, uuidkey )
2471
- # if mbypath isa String
2472
- # sourcepath = entry_path( mbypath, uuidkey.name)
2471
+ # mbypath = manifest_uuid_path(env, this_uuidkey )
2472
+ # if mbypath isa String && isfile_casesensitive(mbypath)
2473
+ # sourcepath = mbypath
2473
2474
# else
2474
2475
# # if the user deleted the stdlib folder, we next try using their environment
2475
- # sourcepath = locate_package_env(uuidkey )
2476
+ # sourcepath = locate_package_env(this_uuidkey )
2476
2477
# if sourcepath !== nothing
2477
2478
# sourcepath, env = sourcepath
2478
2479
# end
2479
2480
# end
2480
2481
# if sourcepath === nothing
2481
2482
# throw(ArgumentError("""
2482
- # Package $(repr("text/plain", uuidkey )) is required but does not seem to be installed.
2483
+ # Package $(repr("text/plain", this_uuidkey )) is required but does not seem to be installed.
2483
2484
# """))
2484
2485
# end
2485
- set_pkgorigin_version_path (uuidkey , sourcepath)
2486
+ set_pkgorigin_version_path (this_uuidkey , sourcepath)
2486
2487
depot_path = append_bundled_depot_path! (empty (DEPOT_PATH ))
2487
- newm = start_loading (uuidkey )
2488
+ newm = start_loading (this_uuidkey )
2488
2489
newm === nothing || return newm
2489
2490
try
2490
- newm = _require_search_from_serialized (uuidkey , sourcepath, UInt128 (0 ), false ; DEPOT_PATH = depot_path)
2491
+ newm = _require_search_from_serialized (this_uuidkey , sourcepath, UInt128 (0 ), false ; DEPOT_PATH = depot_path)
2491
2492
finally
2492
- end_loading (uuidkey , newm)
2493
+ end_loading (this_uuidkey , newm)
2493
2494
end
2494
2495
if newm isa Module
2495
2496
# After successfully loading, notify downstream consumers
2496
- insert_extension_triggers (env, uuidkey )
2497
- run_package_callbacks (uuidkey )
2497
+ insert_extension_triggers (env, this_uuidkey )
2498
+ run_package_callbacks (this_uuidkey )
2498
2499
else
2499
2500
# if the user deleted their bundled depot, next try to load it completely normally
2500
- newm = _require_prelocked (uuidkey )
2501
+ newm = _require_prelocked (this_uuidkey )
2501
2502
end
2502
2503
return newm
2503
2504
end
0 commit comments