diff options
| author | ruki <[email protected]> | 2026-07-18 00:03:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-07-18 00:03:53 +0800 |
| commit | 1dee1ac4425bc1792bf79bffd329f92080580cc8 (patch) | |
| tree | 4a2379f884d59cc052d61756d1c7d1249ac7d146 /xmake/modules/private/utils/batchcmds.lua | |
| parent | 831d2df02925c3744786790df47dea9184437649 (diff) | |
improve sandbox to fork raw script
Diffstat (limited to 'xmake/modules/private/utils/batchcmds.lua')
| -rw-r--r-- | xmake/modules/private/utils/batchcmds.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/private/utils/batchcmds.lua b/xmake/modules/private/utils/batchcmds.lua index a22879a81..2c80574a5 100644 --- a/xmake/modules/private/utils/batchcmds.lua +++ b/xmake/modules/private/utils/batchcmds.lua @@ -28,6 +28,7 @@ import("core.theme.theme") import("core.tool.linker") import("core.tool.compiler") import("core.language.language") +import("core.sandbox.sandbox") import("utils.run_script") import("utils.progress", {alias = "progress_utils"}) import("utils.binary.rpath", {alias = "rpath_utils"}) @@ -131,7 +132,11 @@ function _runcmd_call(cmd, opt) local func = cmd.func if func then if not opt.dryrun then - func(table.unpack(cmd.argv), cmd.opt) + local argv = table.clone(cmd.argv) + if cmd.opt then + table.insert(argv, cmd.opt) + end + func(table.unpack(argv)) end end end @@ -323,7 +328,8 @@ end -- add command: call lua function function batchcmds:call(func, argv, opt) - table.insert(self:cmds(), {kind = "call", func = func, argv = argv, opt = opt}) + sandbox.fork(func) + table.insert(self:cmds(), {kind = "call", func = func, argv = argv, opt = opt}) end -- add command: compile source files |
