@@ -208,14 +208,11 @@ let mod = Base.include(Base.__toplevel__, inputfile)
208
208
end
209
209
210
210
# Additional method patches depending on whether user code loads certain stdlibs
211
- let loaded = Base. loaded_modules_array ()
212
- function find_loaded_module (name)
213
- idx = findfirst ((m) -> Symbol (m) === name, loaded)
214
- idx === nothing && return nothing
215
- return loaded[idx]
216
- end
211
+ let
212
+ find_loaded_root_module (key:: Base.PkgId ) = Base. maybe_root_module (key)
217
213
218
- SparseArrays = find_loaded_module (:SparseArrays )
214
+ SparseArrays = find_loaded_root_module (Base. PkgId (
215
+ Base. UUID (" 2f01184e-e22b-5df5-ae63-d93ebab69eaf" ), " SparseArrays" ))
219
216
if SparseArrays != = nothing
220
217
@eval SparseArrays. CHOLMOD begin
221
218
function __init__ ()
@@ -231,10 +228,20 @@ let loaded = Base.loaded_modules_array()
231
228
end
232
229
end
233
230
234
- Artifacts = find_loaded_module (:Artifacts )
231
+ Artifacts = find_loaded_root_module (Base. PkgId (
232
+ Base. UUID (" 56f22d72-fd6d-98f1-02f0-08ddc0907c33" ), " Artifacts" ))
235
233
if Artifacts != = nothing
236
234
@eval Artifacts begin
237
- function _artifact_str (__module__, artifacts_toml, name, path_tail, artifact_dict, hash, platform, _:: Val{lazyartifacts} ) where lazyartifacts
235
+ function _artifact_str (
236
+ __module__,
237
+ artifacts_toml,
238
+ name,
239
+ path_tail,
240
+ artifact_dict,
241
+ hash,
242
+ platform,
243
+ _:: Val{LazyArtifacts}
244
+ ) where LazyArtifacts
238
245
# If the artifact exists, we're in the happy path and we can immediately
239
246
# return the path to the artifact:
240
247
dirs = artifacts_dirs (bytes2hex (hash. bytes))
@@ -248,28 +255,32 @@ let loaded = Base.loaded_modules_array()
248
255
end
249
256
end
250
257
251
- Pkg = find_loaded_module (:Pkg )
258
+ Pkg = find_loaded_root_module (Base. PkgId (
259
+ Base. UUID (" 44cfe95a-1eb2-52ea-b672-e2afdf69b78f" ), " Pkg" ))
252
260
if Pkg != = nothing
253
261
@eval Pkg begin
254
262
__init__ () = rand () # TODO , methods that do nothing don't get codegened
255
263
end
256
264
end
257
265
258
- StyledStrings = find_loaded_module (:StyledStrings )
266
+ StyledStrings = find_loaded_root_module (Base. PkgId (
267
+ Base. UUID (" f489334b-da3d-4c2e-b8f0-e476e12c162b" ), " StyledStrings" ))
259
268
if StyledStrings != = nothing
260
269
@eval StyledStrings begin
261
270
__init__ () = rand ()
262
271
end
263
272
end
264
273
265
- Markdown = find_loaded_module (:Markdown )
274
+ Markdown = find_loaded_root_module (Base. PkgId (
275
+ Base. UUID (" d6f4376e-aef5-505a-96c1-9c027394607a" ), " Markdown" ))
266
276
if Markdown != = nothing
267
277
@eval Markdown begin
268
278
__init__ () = rand ()
269
279
end
270
280
end
271
281
272
- JuliaSyntaxHighlighting = find_loaded_module (:JuliaSyntaxHighlighting )
282
+ JuliaSyntaxHighlighting = find_loaded_root_module (Base. PkgId (
283
+ Base. UUID (" ac6e5ff7-fb65-4e79-a425-ec3bc9c03011" ), " JuliaSyntaxHighlighting" ))
273
284
if JuliaSyntaxHighlighting != = nothing
274
285
@eval JuliaSyntaxHighlighting begin
275
286
__init__ () = rand ()
0 commit comments