@@ -668,7 +668,20 @@ function manifest_uuid_path(env::String, pkg::PkgId)::Union{Nothing,String,Missi
668
668
return explicit_manifest_uuid_path (project_file, pkg)
669
669
elseif project_file
670
670
# if env names a directory, search it
671
- return implicit_manifest_uuid_path (env, pkg)
671
+ proj = implicit_manifest_uuid_path (env, pkg)
672
+ proj === nothing || return proj
673
+ # if not found
674
+ parentid = get (EXT_PRIMED, pkg, nothing )
675
+ if parentid != = nothing
676
+ _, parent_project_file = entry_point_and_project_file (env, parentid. name)
677
+ if parent_project_file != = nothing
678
+ parentproj = project_file_name_uuid (parent_project_file, parentid. name)
679
+ if parentproj == parentid
680
+ mby_ext = project_file_ext_path (parent_project_file, pkg. name)
681
+ mby_ext === nothing || return mby_ext
682
+ end
683
+ end
684
+ end
672
685
end
673
686
return nothing
674
687
end
@@ -1221,11 +1234,19 @@ end
1221
1234
1222
1235
function insert_extension_triggers (env:: String , pkg:: PkgId ):: Union{Nothing,Missing}
1223
1236
project_file = env_project_file (env)
1224
- if project_file isa String
1237
+ if project_file isa String || project_file
1238
+ implicit_project_file = project_file
1239
+ if ! (implicit_project_file isa String)
1240
+ # if env names a directory, search it for an implicit project file (for stdlibs)
1241
+ path, implicit_project_file = entry_point_and_project_file (env, pkg. name)
1242
+ if ! (implicit_project_file isa String)
1243
+ return nothing
1244
+ end
1245
+ end
1225
1246
# Look in project for extensions to insert
1226
- proj_pkg = project_file_name_uuid (project_file , pkg. name)
1247
+ proj_pkg = project_file_name_uuid (implicit_project_file , pkg. name)
1227
1248
if pkg == proj_pkg
1228
- d_proj = parsed_toml (project_file )
1249
+ d_proj = parsed_toml (implicit_project_file )
1229
1250
weakdeps = get (d_proj, " weakdeps" , nothing ):: Union{Nothing, Vector{String}, Dict{String,Any}}
1230
1251
extensions = get (d_proj, " extensions" , nothing ):: Union{Nothing, Dict{String, Any}}
1231
1252
extensions === nothing && return
@@ -1236,6 +1257,7 @@ function insert_extension_triggers(env::String, pkg::PkgId)::Union{Nothing,Missi
1236
1257
end
1237
1258
1238
1259
# Now look in manifest
1260
+ project_file isa String || return nothing
1239
1261
manifest_file = project_file_manifest_path (project_file)
1240
1262
manifest_file === nothing && return
1241
1263
d = get_deps (parsed_toml (manifest_file))
@@ -2371,6 +2393,22 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
2371
2393
depot_path = map (abspath, DEPOT_PATH )
2372
2394
dl_load_path = map (abspath, DL_LOAD_PATH)
2373
2395
load_path = map (abspath, Base. load_path ())
2396
+ # if pkg is a stdlib, append its parent Project.toml to the load path
2397
+ parentid = get (EXT_PRIMED, pkg, nothing )
2398
+ if parentid != = nothing
2399
+ for env in load_path
2400
+ project_file = env_project_file (env)
2401
+ if project_file === true
2402
+ _, parent_project_file = entry_point_and_project_file (env, parentid. name)
2403
+ if parent_project_file != = nothing
2404
+ parentproj = project_file_name_uuid (parent_project_file, parentid. name)
2405
+ if parentproj == parentid
2406
+ push! (load_path, parent_project_file)
2407
+ end
2408
+ end
2409
+ end
2410
+ end
2411
+ end
2374
2412
path_sep = Sys. iswindows () ? ' ;' : ' :'
2375
2413
any (path -> path_sep in path, load_path) &&
2376
2414
error (" LOAD_PATH entries cannot contain $(repr (path_sep)) " )
0 commit comments