aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-03-07 00:36:45 -0500
committerXavier Claessens <xclaesse@gmail.com>2023-03-09 22:04:38 -0500
commitc91a6ad0130e64fabf30b6bae58ae266453ab86a (patch)
tree549e7a06f618f1d9db5790386a7392eddec20e75
parent7c2ac4f8fe2bda306adc73572d8f8e43010456cb (diff)
downloadmeson-c91a6ad0130e64fabf30b6bae58ae266453ab86a.zip
meson-c91a6ad0130e64fabf30b6bae58ae266453ab86a.tar.gz
meson-c91a6ad0130e64fabf30b6bae58ae266453ab86a.tar.bz2
re-deduplicate feature warnings printed at the end of setup
In commit eaf365cb3ef4f1c2ba66e07237d86a44089aff4f we explicitly sorted them for neatness, with the rationale that we were restoring intentional behavior and we only need a set for stylistic purposes. This actually wasn't true, because we never sorted them to begin with (we did sort the version numbers), but sorting them is fine. The bigger issue is that we actually used a set to avoid printing the same feature type multiple times. Now we do print them multiple times -- because each registered feature includes the unique node. Fix this by using both sorted and a set. Fix tests that should in retrospect have flagged this as an issue, but were added later on in the same series to check something else entirely, happen to cover this too, and were presumably copied directly from stdout as-is...
-rw-r--r--mesonbuild/interpreterbase/decorators.py2
-rw-r--r--test cases/common/40 options/test.json2
2 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py
index c200d91..9defb99 100644
--- a/mesonbuild/interpreterbase/decorators.py
+++ b/mesonbuild/interpreterbase/decorators.py
@@ -658,7 +658,7 @@ class FeatureCheckBase(metaclass=abc.ABCMeta):
fv = cls.feature_registry[subproject]
tv = cls.get_target_version(subproject)
for version in sorted(fv.keys()):
- message = ', '.join(sorted(f"'{i[0]}'" for i in fv[version]))
+ message = ', '.join(sorted({f"'{i[0]}'" for i in fv[version]}))
if cls.check_version(tv, version):
notice_str += '\n * {}: {{{}}}'.format(version, message)
else:
diff --git a/test cases/common/40 options/test.json b/test cases/common/40 options/test.json
index 3b34c44..c7c7f00 100644
--- a/test cases/common/40 options/test.json
+++ b/test cases/common/40 options/test.json
@@ -1,7 +1,7 @@
{
"stdout": [
{
- "line": " * 1.1.0: {'\"boolean option\" keyword argument \"value\" of type str', '\"boolean option\" keyword argument \"value\" of type str', '\"integer option\" keyword argument \"value\" of type str'}"
+ "line": " * 1.1.0: {'\"boolean option\" keyword argument \"value\" of type str', '\"integer option\" keyword argument \"value\" of type str'}"
}
]
}