aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-08-06 15:16:49 -0400
committerNirbheek Chauhan <nirbheek@centricular.com>2021-08-10 16:06:45 +0530
commitc67b6245417247d2b865f776f00aa0e3b415e549 (patch)
tree237c5df037309871f10a862edaa836f4e7fe3b0a
parent252246cfc21d7cbe0c99faed059bd2a8311e65ae (diff)
downloadmeson-c67b6245417247d2b865f776f00aa0e3b415e549.zip
meson-c67b6245417247d2b865f776f00aa0e3b415e549.tar.gz
meson-c67b6245417247d2b865f776f00aa0e3b415e549.tar.bz2
Fix --force-fallack-for with --wrap-mode=nofallback
Fixes: #9065
-rw-r--r--mesonbuild/interpreter/dependencyfallbacks.py8
-rwxr-xr-xrun_unittests.py6
2 files changed, 10 insertions, 4 deletions
diff --git a/mesonbuild/interpreter/dependencyfallbacks.py b/mesonbuild/interpreter/dependencyfallbacks.py
index 2639e42..5934cbd 100644
--- a/mesonbuild/interpreter/dependencyfallbacks.py
+++ b/mesonbuild/interpreter/dependencyfallbacks.py
@@ -105,13 +105,13 @@ class DependencyFallbacksHolder(MesonInterpreterObject):
return None
def _do_subproject(self, kwargs: TYPE_nkwargs, func_args: TYPE_nvar, func_kwargs: TYPE_nkwargs) -> T.Optional[Dependency]:
- if self.nofallback:
- mlog.log('Not looking for a fallback subproject for the dependency',
- mlog.bold(self.display_name), 'because:\nUse of fallback dependencies is disabled.')
- return None
if self.forcefallback:
mlog.log('Looking for a fallback subproject for the dependency',
mlog.bold(self.display_name), 'because:\nUse of fallback dependencies is forced.')
+ elif self.nofallback:
+ mlog.log('Not looking for a fallback subproject for the dependency',
+ mlog.bold(self.display_name), 'because:\nUse of fallback dependencies is disabled.')
+ return None
else:
mlog.log('Looking for a fallback subproject for the dependency',
mlog.bold(self.display_name))
diff --git a/run_unittests.py b/run_unittests.py
index 958b433..91f3f3c 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2775,6 +2775,12 @@ class AllPlatformTests(BasePlatformTests):
self.build()
self.run_tests()
+ def test_force_fallback_for_nofallback(self):
+ testdir = os.path.join(self.unit_test_dir, '31 forcefallback')
+ self.init(testdir, extra_args=['--force-fallback-for=zlib,foo', '--wrap-mode=nofallback'])
+ self.build()
+ self.run_tests()
+
def test_testrepeat(self):
testdir = os.path.join(self.common_test_dir, '206 tap tests')
self.init(testdir)