re-deduplicate feature warnings printed at the end of setup

In commit eaf365cb3e 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...
pull/11518/head
Eli Schwartz 2 years ago committed by Xavier Claessens
parent 7c2ac4f8fe
commit c91a6ad013
  1. 2
      mesonbuild/interpreterbase/decorators.py
  2. 2
      test cases/common/40 options/test.json

@ -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:

@ -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'}"
}
]
}

Loading…
Cancel
Save