diff options
| author | DavidWang19 <[email protected]> | 2026-05-02 21:56:20 +0100 |
|---|---|---|
| committer | DavidWang19 <[email protected]> | 2026-05-02 22:24:39 +0100 |
| commit | 05f0bb724f1e2d59d851828cb5d16d64ef98b860 (patch) | |
| tree | c5cbc0bc3a26c9726563e47520eee92963318658 /xmake/modules/detect | |
| parent | 1e431c685f2f2b4f28e6995e256fc6c7c4bf3d13 (diff) | |
fix msvc/intel/snippet detect when temp path contains spaces
Pass the temp bat / test binary via the *v variants of os.run / iorun /
vrun so os.argv does not split the path on whitespace.
Diffstat (limited to 'xmake/modules/detect')
| -rw-r--r-- | xmake/modules/detect/sdks/find_iccenv.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/detect/sdks/find_icxenv.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/detect/sdks/find_ifortenv.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/detect/sdks/find_ifxenv.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/detect/sdks/find_vstudio.lua | 4 |
5 files changed, 15 insertions, 5 deletions
diff --git a/xmake/modules/detect/sdks/find_iccenv.lua b/xmake/modules/detect/sdks/find_iccenv.lua index 050352b92..e33050843 100644 --- a/xmake/modules/detect/sdks/find_iccenv.lua +++ b/xmake/modules/detect/sdks/find_iccenv.lua @@ -53,7 +53,9 @@ function _load_iclvars(iclvars_bat, arch, opt) file:close() -- run geniclvars.bat - os.run(geniclvars_bat) + -- @note we use runv here so the bat path is not split on whitespace by os.argv, + -- which breaks detection when the temp file lives under a path with spaces. + os.runv(geniclvars_bat, {}) -- load all envirnoment variables local variables = {} diff --git a/xmake/modules/detect/sdks/find_icxenv.lua b/xmake/modules/detect/sdks/find_icxenv.lua index e715491b3..0a1941dc1 100644 --- a/xmake/modules/detect/sdks/find_icxenv.lua +++ b/xmake/modules/detect/sdks/find_icxenv.lua @@ -53,7 +53,9 @@ function _load_icxvars(icxvars_bat, arch, opt) file:close() -- run genicxvars.bat - os.run(genicxvars_bat) + -- @note we use runv here so the bat path is not split on whitespace by os.argv, + -- which breaks detection when the temp file lives under a path with spaces. + os.runv(genicxvars_bat, {}) -- load all envirnoment variables local variables = {} diff --git a/xmake/modules/detect/sdks/find_ifortenv.lua b/xmake/modules/detect/sdks/find_ifortenv.lua index 19664cbbc..9c877e79e 100644 --- a/xmake/modules/detect/sdks/find_ifortenv.lua +++ b/xmake/modules/detect/sdks/find_ifortenv.lua @@ -53,7 +53,9 @@ function _load_ifortvars(ifortvars_bat, arch, opt) file:close() -- run genifortvars.bat - os.run(genifortvars_bat) + -- @note we use runv here so the bat path is not split on whitespace by os.argv, + -- which breaks detection when the temp file lives under a path with spaces. + os.runv(genifortvars_bat, {}) -- load all envirnoment variables local variables = {} diff --git a/xmake/modules/detect/sdks/find_ifxenv.lua b/xmake/modules/detect/sdks/find_ifxenv.lua index 940d0e8fd..58d206e3f 100644 --- a/xmake/modules/detect/sdks/find_ifxenv.lua +++ b/xmake/modules/detect/sdks/find_ifxenv.lua @@ -53,7 +53,9 @@ function _load_ifxvars(ifxvars_bat, arch, opt) file:close() -- run genifxvars.bat - os.run(genifxvars_bat) + -- @note we use runv here so the bat path is not split on whitespace by os.argv, + -- which breaks detection when the temp file lives under a path with spaces. + os.runv(genifxvars_bat, {}) -- load all envirnoment variables local variables = {} diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index e7699ee0d..c0daf8f53 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -294,7 +294,9 @@ function _load_vcvarsall_impl(vcvarsall, vsver, arch, opt) file:close() -- run genvcvars.bat - local outdata, errdata = try {function () return os.iorun(genvcvars_bat) end} + -- @note we use iorunv here so the bat path is not split on whitespace by os.argv, + -- which breaks detection when the temp file lives under a path with spaces. + local outdata, errdata = try {function () return os.iorunv(genvcvars_bat, {}) end} if errdata and #errdata > 0 and option.get("verbose") and option.get("diagnosis") then cprint("${color.warning}checkinfo: ${clear dim}get vcvars error: %s", errdata) end |
