Skip to content

Commit

Permalink
fix custom_target with install: true and no install_dir, crashing
Browse files Browse the repository at this point in the history
It's supposed to emit an error message, but instead it did a traceback.
It used to be, if no install_dir was specified then it was simply not in
kwargs, but due to typed_kwargs it will now be there, but not have
viable contents, so the dict membership check got skipped.

Fixes #9522
  • Loading branch information
eli-schwartz authored and dcbaker committed Nov 3, 2021
1 parent d23ae8b commit 1104b82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2457,7 +2457,7 @@ def process_kwargs(self, kwargs, backend):
if not isinstance(self.install, bool):
raise InvalidArguments('"install" must be boolean.')
if self.install:
if 'install_dir' not in kwargs:
if not kwargs.get('install_dir', False):
raise InvalidArguments('"install_dir" must be specified '
'when installing a target')

Expand Down

0 comments on commit 1104b82

Please sign in to comment.