From 5f86f2b9d83b1e53e034d13b4848f2f7aef7ad43 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 24 Oct 2022 09:23:16 -0700 Subject: [PATCH] Drop Base TOML cache when binding artifacts We need to clear this cache when modifying the TOML file. This should fix https://github.com/JuliaLang/Pkg.jl/issues/3212. It might be nice to expose a `Base.drop_parsed_toml(path::String)` API so that I don't have to manually reach into `TOML_CACHE.d` here like this. --- src/Artifacts.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Artifacts.jl b/src/Artifacts.jl index d08cf0b593..13dad723c0 100644 --- a/src/Artifacts.jl +++ b/src/Artifacts.jl @@ -226,6 +226,8 @@ function bind_artifact!(artifacts_toml::String, name::String, hash::SHA1; open(artifacts_toml, "w") do io TOML.print(io, artifact_dict, sorted=true) end + # Drop any base caches that refer to this file + delete!(Base.TOML_CACHE.d, artifacts_toml) end # Mark that we have used this Artifact.toml