From 3dea817a597e4d2f10bfe3c1e006a0983555ad15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 24 Jul 2020 15:52:06 +0200 Subject: Only emit warning about "native:" on projects with minimum required version 'native:' keyword was only added in 0.54. For projects declaring meson_version >= 0.54, warn, because those projects can and should set the keyword. For older projects declaring support for older versions, don't warn and use the default implicitly. Fixes https://github.com/mesonbuild/meson/issues/6849. --- mesonbuild/interpreter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index df81569..45813c1 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -3122,8 +3122,11 @@ external dependencies (including libraries) must go to "dependencies".''') return self.add_languages(args, required, self.machine_from_native_kwarg(kwargs)) else: # absent 'native' means 'both' for backwards compatibility - mlog.warning('add_languages is missing native:, assuming languages are wanted for both host and build.', - location=self.current_node) + tv = FeatureNew.get_target_version(self.subproject) + if FeatureNew.check_version(tv, '0.54.0'): + mlog.warning('add_languages is missing native:, assuming languages are wanted for both host and build.', + location=self.current_node) + success = self.add_languages(args, False, MachineChoice.BUILD) success &= self.add_languages(args, required, MachineChoice.HOST) return success -- cgit v1.1 From 1123f4f311e1ac89b341dea2cb5922f29dc502e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 24 Jul 2020 15:23:05 +0200 Subject: Avoid warning about multiple outputs when building private directory name Fixup for b4b1a2c5a145c1459fc4563a289e164e23bd6a02. A warning would be printed for any rule with multiple outputs, for example: WARNING: custom_target 'coredump.conf.5' has more than one output! Using the first one. WARNING: custom_target 'dnssec-trust-anchors.d.5' has more than one output! Using the first one. WARNING: custom_target 'halt.8' has more than one output! Using the first one. Fixes https://github.com/systemd/systemd/issues/16461. --- mesonbuild/backend/backends.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index cfd3a39..effd222 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -183,9 +183,9 @@ class Backend: self.build_to_src = mesonlib.relpath(self.environment.get_source_dir(), self.environment.get_build_dir()) - def get_target_filename(self, t): + def get_target_filename(self, t, *, warn_multi_output: bool = True): if isinstance(t, build.CustomTarget): - if len(t.get_outputs()) != 1: + if warn_multi_output and len(t.get_outputs()) != 1: mlog.warning('custom_target {!r} has more than one output! ' 'Using the first one.'.format(t.name)) filename = t.get_outputs()[0] @@ -261,7 +261,7 @@ class Backend: return self.build_to_src def get_target_private_dir(self, target): - return os.path.join(self.get_target_filename(target) + '.p') + return os.path.join(self.get_target_filename(target, warn_multi_output=False) + '.p') def get_target_private_dir_abs(self, target): return os.path.join(self.environment.get_build_dir(), self.get_target_private_dir(target)) -- cgit v1.1 From 7ef51abfc565b147273097201f8eb286b1688736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 24 Jul 2020 16:29:09 +0200 Subject: Fix typo --- mesonbuild/interpreterbase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 9f35601..822167c 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -330,7 +330,7 @@ class FeatureDeprecated(FeatureCheckBase): @staticmethod def check_version(target_version: str, feature_version: str) -> bool: - # For deprecatoin checks we need to return the inverse of FeatureNew checks + # For deprecation checks we need to return the inverse of FeatureNew checks return not mesonlib.version_compare_condition_with_min(target_version, feature_version) @staticmethod -- cgit v1.1