summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/package/package.lua6
-rw-r--r--xmake/modules/private/action/require/impl/package.lua10
2 files changed, 10 insertions, 6 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index ebb8c795c..d5dc5a3b2 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -838,9 +838,9 @@ function _instance:buildhash()
end
end
if not sourcehashs:empty() then
- for _, sourcehash in sourcehashs:keys() do
- str = str .. "_" .. sourcehash
- end
+ local hashs = sourcehashs:to_array()
+ table.sort(hashs)
+ str = str .. "_" .. table.concat(hashs, "_")
end
end
return hash.uuid4(str):gsub('-', ''):lower()
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 9d2c87bc4..3095e10a9 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -196,9 +196,13 @@ end
--
function _sort_packagedeps(package)
local orderdeps = {}
- for _, dep in pairs(package:deps()) do
- table.join2(orderdeps, _sort_packagedeps(dep))
- table.insert(orderdeps, dep)
+ local deps = package:deps()
+ if deps then
+ for _, depname in ipairs(table.orderkeys(deps)) do
+ local dep = deps[depname]
+ table.join2(orderdeps, _sort_packagedeps(dep))
+ table.insert(orderdeps, dep)
+ end
end
return orderdeps
end