From 4d0be8332e7026fed9b3ffbe00c055c23d24a9bb Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 24 Jan 2021 21:53:42 +0800 Subject: check dead-loop when installing packages --- xmake/actions/require/impl/package.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index 755d0312a..f83764a45 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -766,9 +766,12 @@ function _install_packages(packages_install, packages_download) -- all dependences has been installed? we install it now local ready = true + local dep_not_found = nil for _, dep in ipairs(pkg:orderdeps()) do if not dep:exists() then ready = false + dep_not_found = dep + break end end local group = pkg:group() @@ -789,6 +792,10 @@ function _install_packages(packages_install, packages_download) package = pkg table.remove(packages_pending, idx) break + elseif #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 + raise("package(%s): cannot be installed!", pkg:displayname()) end end if package == nil and #packages_pending > 0 then -- cgit v1.3.1