Skip to content

Commit

Permalink
Fix --force-fallack-for with --wrap-mode=nofallback
Browse files Browse the repository at this point in the history
Fixes: #9065
  • Loading branch information
xclaesse authored and mensinda committed Aug 7, 2021
1 parent 1dcde9d commit 943596a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesonbuild/interpreter/dependencyfallbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ def _do_existing_subproject(self, kwargs: TYPE_nkwargs, func_args: TYPE_nvar, fu
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))
Expand Down
6 changes: 6 additions & 0 deletions unittests/allplatformstests.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,12 @@ def test_force_fallback_for(self):
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)
Expand Down

0 comments on commit 943596a

Please sign in to comment.