aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-05 21:20:43 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-03-06 11:09:56 -0500
commit8b573d7dc65bf20fcb0377ce4c56841496ad0c69 (patch)
tree19ed6b09516c19b9c99a826b5c9e243257b49d93 /mesonbuild/modules
parent1f3640c7dbce18ba11b6f383c3ad5c454a8a2c1d (diff)
downloadmeson-8b573d7dc65bf20fcb0377ce4c56841496ad0c69.zip
meson-8b573d7dc65bf20fcb0377ce4c56841496ad0c69.tar.gz
meson-8b573d7dc65bf20fcb0377ce4c56841496ad0c69.tar.bz2
i18n.merge_file: do not disable in the absence of gettext tools
Disabling targets because the tools used to build them aren't available is a pretty suspicious thing to do. Users who want this are probably, in general, advised to check themselves whether it is possible to build those targets with find_program(..., required: false) The i18n.gettext() invocation is a bit unusual because the product of running it is non-critical files, specifically, translation catalogs. If users don't have the tools needed to build them, they may not be able to use them either, because perhaps they have NLS disabled on their platform or it's difficult to put it in the bootstrap path. So, for this reason, it was made non-fatal and the message catalogs are just not created, and the resulting build is still perfectly usable *unless* you want to use it in another language, at which point it "works" but the text is all inscrutable to the end user, and that's a feature of the target platform. That's an acceptable tradeoff for translation catalogs. It is NOT an acceptable tradeoff for merge_file, which produces desktop files or MIME database catalogs or other files which have crucial roles to perform, without which the software in question simply doesn't work at all. In such cases, this just fails to install crucial files, users report bugs to the project in question, and the project adds `find_program('xgettext')` to guarantee the hard error due to lack of confidence in Meson. Fixes #6165 Fixes #8436
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/i18n.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 04d0696..09703bb 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -167,10 +167,7 @@ class I18nModule(ExtensionModule):
)
def merge_file(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs: 'MergeFile') -> ModuleReturnValue:
if self.tools['msgfmt'] is None:
- self.tools['msgfmt'] = state.find_program('msgfmt', required=False, for_machine=mesonlib.MachineChoice.BUILD)
- if not self.tools['msgfmt'].found():
- self.nogettext_warning(state.current_node)
- return ModuleReturnValue(None, [])
+ self.tools['msgfmt'] = state.find_program('msgfmt', for_machine=mesonlib.MachineChoice.BUILD)
podir = path.join(state.build_to_src, state.subdir, kwargs['po_dir'])
ddirs = self._get_data_dirs(state, kwargs['data_dirs'])