summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-18 22:41:17 +0800
committerruki <[email protected]>2025-12-18 22:41:17 +0800
commitf7120d2ab183109f53cccb5c2f7c3f477fbc5e95 (patch)
tree5dcc2b7f88dcf672a892d6f36abbc9a724f2d1bd
parentdc1bd866c3fb5e851bb9f3e99ced8bf01546826c (diff)
fix toolchain memcache
-rw-r--r--xmake/core/sandbox/modules/import/core/tool/toolchain.lua1
-rw-r--r--xmake/core/tool/toolchain.lua8
-rw-r--r--xmake/modules/private/utils/toolchain.lua4
3 files changed, 6 insertions, 7 deletions
diff --git a/xmake/core/sandbox/modules/import/core/tool/toolchain.lua b/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
index 4282acd0f..922074cac 100644
--- a/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
+++ b/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
@@ -31,7 +31,6 @@ local raise = require("sandbox/modules/raise")
sandbox_core_tool_toolchain.apis = toolchain.apis
sandbox_core_tool_toolchain.directories = toolchain.directories
sandbox_core_tool_toolchain.save = toolchain.save
-sandbox_core_tool_toolchain.memcache = toolchain.memcache
-- get all toolchains list
function sandbox_core_tool_toolchain.list()
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index 4fff15683..1da1634db 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -567,7 +567,7 @@ function _instance:_checktool(toolkind, toolpath)
end
-- get memcache
-function toolchain.memcache()
+function toolchain._memcache()
return memcache.cache("core.tool.toolchain")
end
@@ -732,7 +732,7 @@ function toolchain.load(name, opt)
configs.arch = opt.arch or config.get("arch") or os.arch()
-- get cache
- local cache = toolchain.memcache()
+ local cache = toolchain._memcache()
local cachekey = toolchain._cachekey(name, configs)
-- get it directly from cache dirst
@@ -797,7 +797,7 @@ function toolchain.load_withinfo(name, info, opt)
configs.arch = opt.arch or config.get("arch") or os.arch()
-- get cache key
- local cache = toolchain.memcache()
+ local cache = toolchain._memcache()
local cachekey = toolchain._cachekey(name, configs)
-- get it directly from cache dirst
@@ -909,7 +909,7 @@ function toolchain.toolconfig(toolchains, name, opt)
local arch = opt.arch or config.get("arch") or os.arch()
-- get cache and cachekey
- local cache = toolchain.memcache()
+ local cache = toolchain._memcache()
local cachekey = "toolconfig_" .. (opt.cachekey or "") .. "_" .. plat .. "_" .. arch
-- get configuration
diff --git a/xmake/modules/private/utils/toolchain.lua b/xmake/modules/private/utils/toolchain.lua
index 8845dd1f1..f21995ce2 100644
--- a/xmake/modules/private/utils/toolchain.lua
+++ b/xmake/modules/private/utils/toolchain.lua
@@ -185,7 +185,7 @@ end
function _get_llvm_resourcedir(toolchain)
local memcache = toolchain:memcache()
local cachekey = toolchain:cachekey() .. "_get_llvm_resourcedir"
- local llvm_resourcedir = memcache:get2(cachekey)
+ local llvm_resourcedir = memcache:get(cachekey)
if llvm_resourcedir == nil then
local outdata = try { function() return os.iorunv(toolchain:tool("cc"), {"-print-resource-dir"}) end }
if outdata then
@@ -203,7 +203,7 @@ end
function _get_llvm_rootdir(toolchain)
local memcache = toolchain:memcache()
local cachekey = toolchain:cachekey() .. "_get_llvm_rootdir"
- local llvm_rootdir = memcache:get2(cachekey, "rootdir")
+ local llvm_rootdir = memcache:get(cachekey)
if llvm_rootdir == nil then
local resourcedir = _get_llvm_resourcedir(toolchain)
if resourcedir then