Skip to content

Commit 61e1f55

Browse files
committed
remove builtin async os.rm
1 parent 8099a2d commit 61e1f55

File tree

6 files changed

+15
-20
lines changed

6 files changed

+15
-20
lines changed

xmake/core/base/os.lua

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -874,15 +874,10 @@ function os.runv(program, argv, opt)
874874
errors = string.format("cannot runv(%s), %s", cmd, errors and errors or "unknown reason")
875875
end
876876

877-
-- remove the temporary log file
878-
os.rm(logfile, {async = true, detach = true})
879-
880-
-- failed
877+
os.rm(logfile)
881878
return false, errors
882879
end
883-
884-
-- remove the temporary log file
885-
os.rm(logfile, {async = true, detach = true})
880+
os.rm(logfile)
886881
return true
887882
end
888883

@@ -1105,8 +1100,8 @@ function os.iorunv(program, argv, opt)
11051100
local errdata = io.readfile(errfile)
11061101

11071102
-- remove the temporary output and error file
1108-
os.rm(outfile, {async = true, detach = true})
1109-
os.rm(errfile, {async = true, detach = true})
1103+
os.rm(outfile)
1104+
os.rm(errfile)
11101105
return ok == 0, outdata, errdata, errors
11111106
end
11121107

xmake/modules/core/tools/cl.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
714714

715715
-- remove preprocess file
716716
local cppfile = _get_cppfile(sourcefile, objectfile)
717-
os.tryrm(cppfile, {async = true, detach = true})
717+
os.tryrm(cppfile)
718718

719719
-- use cl/stdout as errors first from vstool.iorunv()
720720
if type(errors) == "table" then
@@ -777,7 +777,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
777777
if depfile and os.isfile(depfile) then
778778
dependinfo.depfiles_format = "cl_json"
779779
dependinfo.depfiles = io.readfile(depfile)
780-
os.tryrm(depfile, {async = true, detach = true})
780+
os.tryrm(depfile)
781781
elseif outdata then
782782
dependinfo.depfiles_format = "cl"
783783
dependinfo.depfiles = outdata

xmake/modules/core/tools/gcc.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
10181018

10191019
-- remove preprocess file
10201020
local cppfile = _get_cppfile(sourcefile, objectfile)
1021-
os.tryrm(cppfile, {async = true, detach = true})
1021+
os.tryrm(cppfile)
10221022

10231023
-- parse and strip errors
10241024
local lines = errors and tostring(errors):split('\n', {plain = true}) or {}
@@ -1070,7 +1070,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
10701070
end
10711071

10721072
-- remove the temporary dependent file
1073-
os.tryrm(depfile, {async = true, detach = true})
1073+
os.tryrm(depfile)
10741074
end
10751075
end
10761076
}

xmake/modules/lib/detect/check_cxsnippets.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ function main(snippets, opt)
273273
}
274274

275275
-- remove some files
276-
os.tryrm(objectfile, {async = true, detach = true})
277-
os.tryrm(binaryfile, {async = true, detach = true})
276+
os.tryrm(objectfile)
277+
os.tryrm(binaryfile)
278278

279279
-- trace
280280
if opt.verbose or option.get("verbose") or option.get("diagnosis") then

xmake/modules/private/cache/build_cache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ function build(program, argv, opt)
339339
_g.cache_miss_total_time = (_g.cache_miss_total_time or 0) + (os.mclock() - cache_miss_start_time)
340340
end
341341
end
342-
os.tryrm(cppinfo.cppfile, {async = true, detach = true})
342+
os.tryrm(cppinfo.cppfile)
343343
else
344344
_g.preprocess_error_count = (_g.preprocess_error_count or 0) + 1
345345
end

xmake/modules/private/tools/vstool.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ function runv(program, argv, opt)
7777
end
7878

7979
-- remove the files
80-
os.tryrm(outpath, {async = true, detach = true})
81-
os.tryrm(errpath, {async = true, detach = true})
80+
os.tryrm(outpath)
81+
os.tryrm(errpath)
8282

8383
-- raise errors
8484
os.raise({errors = errors, stderr = errdata, stdout = outdata})
@@ -122,8 +122,8 @@ function iorunv(program, argv, opt)
122122
local errdata = os.isfile(errpath) and io.readfile(errpath) or nil
123123

124124
-- remove the temporary output and error file
125-
os.tryrm(outpath, {async = true, detach = true})
126-
os.tryrm(errpath, {async = true, detach = true})
125+
os.tryrm(outpath)
126+
os.tryrm(errpath)
127127

128128
-- failed?
129129
if ok ~= 0 then

0 commit comments

Comments
 (0)