diff options
| author | ruki <[email protected]> | 2022-09-06 00:37:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-09-06 00:37:56 +0800 |
| commit | 2a8af8db1d8b6e05f2a751a3320a1c45596ac0e5 (patch) | |
| tree | a65a69a8111fc8aae7e595dde2cb2154ef052287 /xmake/modules | |
| parent | 4d15e4f3f8eaa1d15efd4023d25838bd6b31f1fa (diff) | |
fix should install
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 20 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/install.lua | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 9784862cc..46bc16fed 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -948,7 +948,13 @@ end -- compatible with all previous link dependencies? -- @see https://github.com/xmake-io/xmake/issues/2719 -function _compatible_with_previous_linkdeps(package) +function _compatible_with_previous_linkdeps(package, opt) + + -- skip to check compatibility? + opt = opt or {} + if opt.check_compatibility == false then + return true + end -- check strict compatibility for linkdeps? local strict_compatibility = project.policy("package.linkdeps.strict_compatibility") @@ -959,6 +965,12 @@ function _compatible_with_previous_linkdeps(package) return true end + -- has been checked? + local compatible_checked = package:data("linkdeps.compatible_checked") + if compatible_checked then + return + end + -- compute the buildhash for previous linkdeps local depinfos_prev = {} local depnames = hashset.new() @@ -1015,11 +1027,11 @@ function cachedir() end -- this package should be install? -function should_install(package) +function should_install(package, opt) if package:is_template() then return false end - if package:exists() and _compatible_with_previous_linkdeps(package) then + if package:exists() and _compatible_with_previous_linkdeps(package, opt) then return false end -- we need not install it if this package need only be fetched @@ -1034,7 +1046,7 @@ function should_install(package) if package:parents() then -- if all the packages that depend on it already exist, then there is no need to install it for _, parent in pairs(package:parents()) do - if should_install(parent) and not parent:exists() then + if should_install(parent, opt) and not parent:exists() then return true end diff --git a/xmake/modules/private/action/require/install.lua b/xmake/modules/private/action/require/install.lua index c75df8a35..f6d02717e 100644 --- a/xmake/modules/private/action/require/install.lua +++ b/xmake/modules/private/action/require/install.lua @@ -35,7 +35,7 @@ function _check_missing_packages(packages) local packages_missing = {} local optional_missing = {} for _, instance in ipairs(packages) do - if package.should_install(instance) or (instance:is_fetchonly() and not instance:exists()) then + if package.should_install(instance, {check_compatibility = false}) or (instance:is_fetchonly() and not instance:exists()) then if instance:is_optional() then optional_missing[instance:name()] = instance else |
