aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-08-24 22:05:40 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2021-09-01 22:29:48 +0300
commitd67850b45e9ce323405e80aacee872049a3bc389 (patch)
tree0bc3d9d22d9b8246414921ed3b8b5bb4448c1324
parent9bf669a016005867e6307f6624f3a130a6a86a1a (diff)
downloadmeson-d67850b45e9ce323405e80aacee872049a3bc389.zip
meson-d67850b45e9ce323405e80aacee872049a3bc389.tar.gz
meson-d67850b45e9ce323405e80aacee872049a3bc389.tar.bz2
dependency: fallback and allow_fallback are mutually exclusive
That used to abort in previous Meson versions but 0.59 stopped forbidding that by mistake.
-rw-r--r--mesonbuild/interpreter/dependencyfallbacks.py2
-rw-r--r--test cases/failing/114 allow_fallback with fallback/meson.build3
-rw-r--r--test cases/failing/114 allow_fallback with fallback/test.json8
3 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/dependencyfallbacks.py b/mesonbuild/interpreter/dependencyfallbacks.py
index 4baa5cf..2a4f212 100644
--- a/mesonbuild/interpreter/dependencyfallbacks.py
+++ b/mesonbuild/interpreter/dependencyfallbacks.py
@@ -46,6 +46,8 @@ class DependencyFallbacksHolder(MesonInterpreterObject):
mlog.warning('The "default_options" keyword argument does nothing without a fallback subproject.',
location=self.interpreter.current_node)
return
+ if self.allow_fallback is not None:
+ raise InvalidArguments('"fallback" and "allow_fallback" arguments are mutually exclusive')
fbinfo = stringlistify(fbinfo)
if len(fbinfo) == 0:
# dependency('foo', fallback: []) is the same as dependency('foo', allow_fallback: false)
diff --git a/test cases/failing/114 allow_fallback with fallback/meson.build b/test cases/failing/114 allow_fallback with fallback/meson.build
new file mode 100644
index 0000000..2874e42
--- /dev/null
+++ b/test cases/failing/114 allow_fallback with fallback/meson.build
@@ -0,0 +1,3 @@
+project('fallback and allow_fallback')
+
+dependency('foo', fallback: 'foo', allow_fallback: false)
diff --git a/test cases/failing/114 allow_fallback with fallback/test.json b/test cases/failing/114 allow_fallback with fallback/test.json
new file mode 100644
index 0000000..1e5712e
--- /dev/null
+++ b/test cases/failing/114 allow_fallback with fallback/test.json
@@ -0,0 +1,8 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/failing/114 allow_fallback with fallback/meson.build:3:0: ERROR: \"fallback\" and \"allow_fallback\" arguments are mutually exclusive"
+ }
+ ]
+}
+