diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-03-23 16:06:38 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2021-03-23 18:07:18 -0400 |
commit | 37d4c86e5b570097b1600148fb872bce27d98f32 (patch) | |
tree | 91ae76b7741dde0445cf28e52db2cc7e593e9aae /mesonbuild/interpreter.py | |
parent | 66d62a224e92c41d6012dc6c23912a965da4da8f (diff) | |
download | meson-37d4c86e5b570097b1600148fb872bce27d98f32.zip meson-37d4c86e5b570097b1600148fb872bce27d98f32.tar.gz meson-37d4c86e5b570097b1600148fb872bce27d98f32.tar.bz2 |
interpreter: Fix spurious warning in include_directories()
When doing include_directories('.') at the root of the subproject we
should not warn about sandboxing violation.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index dbc655f..c27a4e7 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -4601,7 +4601,7 @@ different subdirectory. ''') else: try: - self.validate_within_subproject(a, '') + self.validate_within_subproject(self.subdir, a) except InterpreterException: mlog.warning('include_directories sandbox violation!') print(f'''The project is trying to access the directory {a} which belongs to a different @@ -4830,6 +4830,8 @@ Try setting b_lundef to false instead.'''.format(self.coredata.options[OptionKey # /opt/vendorsdk/src/file_with_license_restrictions.c return project_root = Path(srcdir, self.root_subdir) + if norm == project_root: + return if project_root not in norm.parents: raise InterpreterException(f'Sandbox violation: Tried to grab {inputtype} {norm.name} outside current (sub)project.') if project_root / self.subproject_dir in norm.parents: |