Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use atomic writes when binding artifacts #3235

Merged
merged 2 commits into from
Oct 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ function bind_artifact!(artifacts_toml::String, name::String, hash::SHA1;

# Spit it out onto disk
let artifact_dict = artifact_dict
open(artifacts_toml, "w") do io
temp_artifacts_toml = tempname(dirname(artifacts_toml))
open(temp_artifacts_toml, "w") do io
TOML.print(io, artifact_dict, sorted=true)
end
mv(temp_artifacts_toml, artifacts_toml; force=true)
end

# Mark that we have used this Artifact.toml
Expand Down