diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-06-16 20:29:59 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-06-16 21:19:06 -0400 |
commit | b87067dc8ba5ade1a36f353c89b43b018e8c0cc4 (patch) | |
tree | 089e4f19c7156e5cc6015015dc644b26e38fd8e9 | |
parent | c72715db685c35c7ca3198c2cbd5bb680259c822 (diff) | |
download | meson-b87067dc8ba5ade1a36f353c89b43b018e8c0cc4.zip meson-b87067dc8ba5ade1a36f353c89b43b018e8c0cc4.tar.gz meson-b87067dc8ba5ade1a36f353c89b43b018e8c0cc4.tar.bz2 |
fix regression that broke proper warnings about passing subproject as a dep
Regression in commit 7c757dff71c031ae02ecc358a69a213a5db4051a.
SubprojectHolder is no longer an ObjectHolder and says so via a TODO:
this means that we have to fiddle with held_object. Yay.
-rw-r--r-- | mesonbuild/build.py | 3 | ||||
-rw-r--r-- | test cases/failing/127 subproject object as a dependency/test.json | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index ea9b2c2..c987840 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1373,6 +1373,9 @@ You probably should put it in link_with instead.''') # This is a bit of a hack. We do not want Build to know anything # about the interpreter so we can't import it and use isinstance. # This should be reliable enough. + if hasattr(dep, 'held_object'): + # FIXME: subproject is not a real ObjectHolder so we have to do this by hand + dep = dep.held_object if hasattr(dep, 'project_args_frozen') or hasattr(dep, 'global_args_frozen'): raise InvalidArguments('Tried to use subproject object as a dependency.\n' 'You probably wanted to use a dependency declared in it instead.\n' diff --git a/test cases/failing/127 subproject object as a dependency/test.json b/test cases/failing/127 subproject object as a dependency/test.json index af7310f..fdc85b3 100644 --- a/test cases/failing/127 subproject object as a dependency/test.json +++ b/test cases/failing/127 subproject object as a dependency/test.json @@ -1,7 +1,7 @@ { "stdout": [ { - "line": "test cases/failing/127 subproject object as a dependency/meson.build:3:0: ERROR: Argument is of an unacceptable type 'SubprojectHolder'." + "line": "test cases/failing/127 subproject object as a dependency/meson.build:3:0: ERROR: Tried to use subproject object as a dependency." } ] } |