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
244244 @static if VERSION >= v " 1.11.0-"
245245 if ! ondisk_hit && path != = nothing && disk_cache_enabled ()
246246 @debug " Writing out on-disk cache" job path
247- tmppath, io = mktemp (;cleanup = false )
247+ mkpath ( dirname (path) )
248248 entry = DiskCacheEntry (src. specTypes, cfg, asm)
249+
250+ # atomic write to disk
251+ tmppath, io = mktemp (dirname (path); cleanup= false )
249252 serialize (io, entry)
250253 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
254259 end
255260 end
256261
Original file line number Diff line number Diff line change @@ -153,7 +153,11 @@ const runtime_lock = ReentrantLock()
153153 temp_path, io = mktemp (dirname (path); cleanup= false )
154154 write (io, lib)
155155 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
157161 end
158162
159163 return lib
You can’t perform that action at this time.
0 commit comments