summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-03 00:42:19 +0800
committerruki <[email protected]>2024-04-03 00:42:19 +0800
commit3099b75ce297e85be6c186f6ee1bf9fe644bdb95 (patch)
treefe7c22817af92ef63efeefb8736753bf631ecab3
parent1316dd668d7c2f8b1aa5e6de96b52c86a21e9fe3 (diff)
improve build argv
-rw-r--r--.github/workflows/freebsd.yml2
-rw-r--r--.github/workflows/ubuntu_arm.yml2
-rw-r--r--.github/workflows/ubuntu_arm64.yml2
-rw-r--r--xmake/core/sandbox/modules/import/core/sandbox/module.lua21
4 files changed, 22 insertions, 5 deletions
diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml
index 896c585b5..5cb8e0edf 100644
--- a/.github/workflows/freebsd.yml
+++ b/.github/workflows/freebsd.yml
@@ -25,7 +25,7 @@ jobs:
usesh: true
mem: 4096
copyback: false
- prepare: pkg install -y curl unzip gmake llvm gsed bash perl5
+ prepare: pkg install -y git curl unzip gmake llvm gsed bash perl5
run: |
./configure
gmake -j4
diff --git a/.github/workflows/ubuntu_arm.yml b/.github/workflows/ubuntu_arm.yml
index a20c673ae..ad8a6f229 100644
--- a/.github/workflows/ubuntu_arm.yml
+++ b/.github/workflows/ubuntu_arm.yml
@@ -26,7 +26,7 @@ jobs:
args: >
bash -c
"uname -a &&
- apt update &&
+ apt update && apt install -y unzip &&
cd /github/workspace &&
./scripts/get.sh __local__ &&
source ~/.xmake/profile &&
diff --git a/.github/workflows/ubuntu_arm64.yml b/.github/workflows/ubuntu_arm64.yml
index 05d6e6f00..c2b6d4370 100644
--- a/.github/workflows/ubuntu_arm64.yml
+++ b/.github/workflows/ubuntu_arm64.yml
@@ -26,7 +26,7 @@ jobs:
args: >
bash -c
"uname -a &&
- apt update &&
+ apt update && apt install -y unzip &&
cd /github/workspace &&
./scripts/get.sh __local__ &&
source ~/.xmake/profile &&
diff --git a/xmake/core/sandbox/modules/import/core/sandbox/module.lua b/xmake/core/sandbox/modules/import/core/sandbox/module.lua
index 889cc6e95..b72bb0846 100644
--- a/xmake/core/sandbox/modules/import/core/sandbox/module.lua
+++ b/xmake/core/sandbox/modules/import/core/sandbox/module.lua
@@ -28,6 +28,7 @@ local hash = require("base/hash")
local utils = require("base/utils")
local table = require("base/table")
local string = require("base/string")
+local option = require("base/option")
local global = require("base/global")
local config = require("project/config")
local memcache = require("cache/memcache")
@@ -183,6 +184,20 @@ function core_sandbox_module._load_from_scriptdir(module_fullpath, opt)
return module, script
end
+-- add some builtin global options from the parent xmake
+function core_sandbox_module._add_builtin_argv(argv, projectdir)
+ table.insert(argv, "-P")
+ table.insert(argv, projectdir)
+ for _, name in ipairs({"diagnosis", "verbose", "quiet", "yes", "confirm", "root"}) do
+ local value = option.get(name)
+ if type(value) == "boolean" then
+ table.insert(argv, "--" .. name)
+ elseif value ~= nil then
+ table.insert(argv, "--" .. name .. "=" .. value)
+ end
+ end
+end
+
-- build module
function core_sandbox_module._build_module(module_fullpath)
local projectdir = path.normalize(path.absolute(module_fullpath))
@@ -197,9 +212,11 @@ function core_sandbox_module._build_module(module_fullpath)
buildir = path.join(projectdir, "cache", "modules", modulehash)
end
local envs = {XMAKE_CONFIGDIR = buildir}
- local argv = {"config", "-P", projectdir, "-o", buildir, "-y"}
+ local argv = {"config", "-o", buildir}
+ core_sandbox_module._add_builtin_argv(argv, projectdir)
os.execv(os.programfile(), argv, {envs = envs, curdir = projectdir})
- argv = {"-P", projectdir}
+ argv = {}
+ core_sandbox_module._add_builtin_argv(argv, projectdir)
os.execv(os.programfile(), argv, {envs = envs, curdir = projectdir})
return buildir
end