Skip to content

Commit

Permalink
compatible with vs_runtime buildhash
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 24, 2024
1 parent fda85aa commit c10247b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions xmake/core/package/package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,15 @@ function _instance:buildhash()
str = str .. label
end
if configs then

-- with old vs_runtime configs
-- https://github.com/xmake-io/xmake/issues/4477
if opt.vs_runtime then
configs = table.clone(configs)
configs.vs_runtime = configs.runtimes
configs.runtimes = nil
end

-- since luajit v2.1, the key order of the table is random and undefined.
-- We cannot directly deserialize the table, so the result may be different each time
local configs_order = {}
Expand Down Expand Up @@ -1616,6 +1625,16 @@ function _instance:buildhash()
end
end

-- we need to be compatible with the previous xmake version
-- with deprecated vs_runtime (< 2.8.7)
-- @see https://github.com/xmake-io/xmake/issues/4477
if not buildhash then
buildhash = _get_buildhash(self:_configs_for_buildhash(), {vs_runtime = true})
if not os.isdir(_get_installdir(buildhash)) then
buildhash = nil
end
end

-- get build hash for current version
if not buildhash then
buildhash = _get_buildhash(self:_configs_for_buildhash())
Expand Down

0 comments on commit c10247b

Please sign in to comment.