diff options
| author | ruki <[email protected]> | 2024-01-27 23:47:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-01-27 23:47:12 +0800 |
| commit | cf61b2b9e164b6655cc4ea9b983dddffaf297372 (patch) | |
| tree | abc4ca6cf6b77ea58a3838b5b797e6ce62b90f6a /xmake/modules/private/action/require/impl/package.lua | |
| parent | 97ebae3c85e8bb7cfef13b02415e4a5798b13234 (diff) | |
fix runtime configs #4477
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 5d352ee01..4ab054ba6 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -828,9 +828,15 @@ function _select_package_runtimes(package) end end -- we need update runtimes for buildhash, configs ... + -- + -- we use configs_overrided to override configs in configs and buildhash, + -- but we shouldn't modify requireinfo.configs directly as it affects the package cache key + -- + -- @see https://github.com/xmake-io/xmake/issues/4477#issuecomment-1913185727 local requireinfo = package:requireinfo() - if requireinfo and requireinfo.configs then - requireinfo.configs.runtimes = #runtimes_current > 0 and table.concat(runtimes_current, ",") or nil + if requireinfo then + requireinfo.configs_overrided = requireinfo.configs_overrided or {} + requireinfo.configs_overrided.runtimes = #runtimes_current > 0 and table.concat(runtimes_current, ",") or nil end end end @@ -1266,8 +1272,10 @@ function get_configs_str(package) table.insert(configs, requireinfo.kind) end local ignored_configs_for_buildhash = hashset.from(requireinfo.ignored_configs_for_buildhash or {}) + local configs_overrided = requireinfo.configs_overrided or {} for k, v in pairs(requireinfo.configs) do if not ignored_configs_for_buildhash:has(k) then + v = configs_overrided[k] or v if type(v) == "boolean" then table.insert(configs, k .. ":" .. (v and "y" or "n")) else |
