Skip to content

Commit

Permalink
improve to check circular deps
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Dec 30, 2022
1 parent 784ffcf commit d1ef852
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xmake/modules/private/action/require/impl/package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,10 @@ function _load_package(packagename, requireinfo, opt)
opt = opt or {}
if opt.requirepath then
local splitinfo = opt.requirepath:split(".", {plain = true})
if #splitinfo > 1 and splitinfo[1] == splitinfo[#splitinfo] then
raise("circular dependency(%s) detected in package(%s)!", opt.requirepath, packagename)
if #splitinfo > 3 and
splitinfo[1] == splitinfo[#splitinfo - 1] and
splitinfo[2] == splitinfo[#splitinfo] then
raise("circular dependency(%s) detected in package(%s)!", opt.requirepath, splitinfo[1])
end
end

Expand Down

0 comments on commit d1ef852

Please sign in to comment.