summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-02-25 00:46:40 +0800
committerruki <[email protected]>2021-02-25 00:46:40 +0800
commit755d6cb62335f9b3a3cecf0830138886e9510f8a (patch)
treee473f2edb561578f23bed9fd8c8ed4c6a98243e9
parent1b934fa63f73cf2bad6f605f353b3021e601fb82 (diff)
fix depend order for package
-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