aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-05-03 01:09:22 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-05-03 18:43:07 -0400
commit6c0370f62ff5349b5f7b88371922e07dac07b5ab (patch)
tree9d060fc8bd5f80ad2f468244c554c6d05191c10a /mesonbuild/interpreter
parent5a34dcedf729ac449de97fe7d201c1ebc50cd1d4 (diff)
downloadmeson-6c0370f62ff5349b5f7b88371922e07dac07b5ab.zip
meson-6c0370f62ff5349b5f7b88371922e07dac07b5ab.tar.gz
meson-6c0370f62ff5349b5f7b88371922e07dac07b5ab.tar.bz2
dependencies: handle one more case of subproject installed files
Some projects treat meson.project_source_root() as the root of the dependency files, because the project itself merely wraps a bunch of datafiles. Our validation to make sure this doesn't point to another subproject, made use of pathlib.Path's generator for all component paths, which... did not include the path itself. So go ahead and explicitly check that too. Add a test case to verify it while we are at it. Fixes https://github.com/mesonbuild/meson/pull/10103#issuecomment-1114901033
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r--mesonbuild/interpreter/interpreter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 17d21ca..aab15d1 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -680,7 +680,7 @@ class Interpreter(InterpreterBase, HoldableObject):
else:
if not self.is_subproject() and srcdir / self.subproject_dir in p.parents:
continue
- if p.is_absolute() and p.is_dir() and srcdir / self.root_subdir in p.resolve().parents:
+ if p.is_absolute() and p.is_dir() and srcdir / self.root_subdir in [p] + list(p.resolve().parents):
variables[k] = P_OBJ.DependencyVariableString(v)
for d in deps:
if not isinstance(d, dependencies.Dependency):