i18n: fix bug where disabling gettext() broke merge_file()

In the former case, the presence of tools is optional, but triggers a
warning and then no-ops the target. In the latter case, the presence of
the tools is mandatory. But if it was already looked up and discovered
to be missing, we did not actually check that it is found before trying
to use it.

In the case that it isn't found, check again, so that we explicitly
error out with a relevant error message due to setting the required
flag.

Fixes #10320
pull/10365/head
Eli Schwartz 3 years ago
parent 34da721ec2
commit de2c091ba6
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/modules/i18n.py

@ -166,7 +166,7 @@ class I18nModule(ExtensionModule):
KwargInfo('type', str, default='xml', validator=in_set_validator({'xml', 'desktop'})),
)
def merge_file(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs: 'MergeFile') -> ModuleReturnValue:
if self.tools['msgfmt'] is None:
if self.tools['msgfmt'] is None or not self.tools['msgfmt'].found():
self.tools['msgfmt'] = state.find_program('msgfmt', for_machine=mesonlib.MachineChoice.BUILD)
podir = path.join(state.build_to_src, state.subdir, kwargs['po_dir'])

Loading…
Cancel
Save