diff options
| author | ruki <[email protected]> | 2021-01-24 21:53:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-01-24 21:53:42 +0800 |
| commit | 4d0be8332e7026fed9b3ffbe00c055c23d24a9bb (patch) | |
| tree | 3e23e03f56ca0bbb49927138c6d9938a9b0a760d | |
| parent | 8b862703c55eefa3ba210148bcc75ea83cac8560 (diff) | |
check dead-loop when installing packages
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 7 |
1 files changed, 7 insertions, 0 deletions
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 |
