File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -244,13 +244,18 @@ end
244
244
@static if VERSION >= v " 1.11.0-"
245
245
if ! ondisk_hit && path != = nothing && disk_cache_enabled ()
246
246
@debug " Writing out on-disk cache" job path
247
- tmppath, io = mktemp (;cleanup = false )
247
+ mkpath ( dirname (path) )
248
248
entry = DiskCacheEntry (src. specTypes, cfg, asm)
249
+
250
+ # atomic write to disk
251
+ tmppath, io = mktemp (dirname (path); cleanup= false )
249
252
serialize (io, entry)
250
253
close (io)
251
- # atomic move
252
- mkpath (dirname (path))
253
- Base. rename (tmppath, path, force= true )
254
+ @static if VERSION >= v " 1.12.0-DEV.1023"
255
+ mv (tmppath, path; force= true )
256
+ else
257
+ Base. rename (tmppath, path, force= true )
258
+ end
254
259
end
255
260
end
256
261
Original file line number Diff line number Diff line change @@ -153,7 +153,11 @@ const runtime_lock = ReentrantLock()
153
153
temp_path, io = mktemp (dirname (path); cleanup= false )
154
154
write (io, lib)
155
155
close (io)
156
- Base. rename (temp_path, path; force= true )
156
+ @static if VERSION >= v " 1.12.0-DEV.1023"
157
+ mv (temp_path, path; force= true )
158
+ else
159
+ Base. rename (temp_path, path, force= true )
160
+ end
157
161
end
158
162
159
163
return lib
You can’t perform that action at this time.
0 commit comments