From b56bad549f00ceeb33f690a944bccb8e4d3c6a20 Mon Sep 17 00:00:00 2001 From: Fabian Zickgraf Date: Sat, 21 May 2022 03:09:47 +0000 Subject: [PATCH] Use root module when determining UUID in @artifact_str (#45392) Otherwise, overrides do not trigger when using `artifact"..."` inside a submodule. (cherry picked from commit 9b106adcdff120cdfc1fb0c0d6c50b68a787ce95) --- stdlib/Artifacts/src/Artifacts.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/Artifacts/src/Artifacts.jl b/stdlib/Artifacts/src/Artifacts.jl index fd65494782d92d..d4e2f7369f9ded 100644 --- a/stdlib/Artifacts/src/Artifacts.jl +++ b/stdlib/Artifacts/src/Artifacts.jl @@ -524,9 +524,10 @@ function jointail(dir, tail) end function _artifact_str(__module__, artifacts_toml, name, path_tail, artifact_dict, hash, platform, @nospecialize(lazyartifacts)) - if haskey(Base.module_keys, __module__) + moduleroot = Base.moduleroot(__module__) + if haskey(Base.module_keys, moduleroot) # Process overrides for this UUID, if we know what it is - process_overrides(artifact_dict, Base.module_keys[__module__].uuid) + process_overrides(artifact_dict, Base.module_keys[moduleroot].uuid) end # If the artifact exists, we're in the happy path and we can immediately