summaryrefslogtreecommitdiff
path: root/xmake/modules/private
diff options
context:
space:
mode:
authorruki <[email protected]>2021-02-14 11:05:58 +0800
committerruki <[email protected]>2021-02-14 11:05:58 +0800
commitf79c7540d17ad3cef4e197fd8c03ec5a1aecb30d (patch)
tree7b9a8428adcc96274cade45fcb6230af46a04d5b /xmake/modules/private
parent047f5b57159171467a7929f1743d4391f48288ea (diff)
fix install packages
Diffstat (limited to 'xmake/modules/private')
-rw-r--r--xmake/modules/private/action/require/impl/install_packages.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua
index 22738e5f4..946d3f8cb 100644
--- a/xmake/modules/private/action/require/impl/install_packages.lua
+++ b/xmake/modules/private/action/require/impl/install_packages.lua
@@ -159,6 +159,7 @@ function _install_packages(packages_install, packages_download)
local packages_downloading = {}
local packages_pending = table.copy(packages_install)
local packages_in_group = {}
+ local working_count = 0
local installing_count = 0
local parallelize = true
runjobs("install_packages", function (index)
@@ -196,7 +197,7 @@ function _install_packages(packages_install, packages_download)
instance = pkg
table.remove(packages_pending, idx)
break
- elseif installing_count == 0 then
+ elseif working_count == 0 then
if #packages_pending == 1 and dep_not_found then
raise("package(%s): cannot be installed, there are dependencies(%s) that cannot be installed!", pkg:displayname(), dep_not_found:displayname())
elseif #packages_pending == 1 then
@@ -210,6 +211,9 @@ function _install_packages(packages_install, packages_download)
end
if instance then
+ -- update working count
+ working_count = working_count + 1
+
-- only install the first package in same group
local group = instance:group()
if not group or not packages_in_group[group] then
@@ -262,6 +266,9 @@ function _install_packages(packages_install, packages_download)
installing_count = installing_count - 1
packages_installing[index] = nil
end
+
+ -- update working count
+ working_count = working_count - 1
end
packages_installing[index] = nil
packages_downloading[index] = nil