diff options
| author | ruki <[email protected]> | 2022-12-29 23:55:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-12-29 23:55:06 +0800 |
| commit | 26404ac83ca224c08f9db335f7cd1828b5d53538 (patch) | |
| tree | 033491d0b6708322a45cb59b3449c7989773e1a4 | |
| parent | c8d4a72a6b2548a8376eac0ea16a4c98c9b81064 (diff) | |
check cycle deps in packages #3163
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 372b72ae9..2708e2d91 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -706,6 +706,15 @@ end -- load required packages function _load_package(packagename, requireinfo, opt) + -- check circular dependency + 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) + end + end + -- strip trailng ~tag, e.g. zlib~debug local displayname if packagename:find('~', 1, true) then |
