aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Weißmann <volker.weissmann@gmx.de>2023-03-17 21:15:47 +0100
committerEli Schwartz <eschwartz93@gmail.com>2023-03-17 18:04:05 -0400
commitbb27341cd0f296b2c11f46451c8702ce63e7d512 (patch)
tree03a4ca99dca134e88c5387d17b475cee609db117
parent5c5d261845ee2807372e2d37b28c09485418a040 (diff)
downloadmeson-bb27341cd0f296b2c11f46451c8702ce63e7d512.zip
meson-bb27341cd0f296b2c11f46451c8702ce63e7d512.tar.gz
meson-bb27341cd0f296b2c11f46451c8702ce63e7d512.tar.bz2
Better error message when custom_targets has duplicates in the output kwarg
-rw-r--r--mesonbuild/interpreter/type_checking.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py
index 129668b..e1ee82a 100644
--- a/mesonbuild/interpreter/type_checking.py
+++ b/mesonbuild/interpreter/type_checking.py
@@ -296,6 +296,13 @@ OVERRIDE_OPTIONS_KW: KwargInfo[T.List[str]] = KwargInfo(
def _output_validator(outputs: T.List[str]) -> T.Optional[str]:
+ output_set = set(outputs)
+ if len(output_set) != len(outputs):
+ seen = set()
+ for el in outputs:
+ if el in seen:
+ return f"contains {el!r} multiple times, but no duplicates are allowed."
+ seen.add(el)
for i in outputs:
if i == '':
return 'Output must not be empty.'