|
|
d559a5 |
From d1d785c169345b81c76213f6dd9be32b4db60294 Mon Sep 17 00:00:00 2001
|
|
|
d559a5 |
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
|
|
|
d559a5 |
Date: Wed, 15 Jul 2020 08:39:47 +0200
|
|
|
d559a5 |
Subject: [PATCH] Build: allow LOCAL_INCLUDES paths with topsrcdir or topobjdir
|
|
|
d559a5 |
|
|
|
d559a5 |
---
|
|
|
d559a5 |
python/mozbuild/mozbuild/frontend/emitter.py | 6 ------
|
|
|
d559a5 |
.../mozbuild/test/frontend/test_emitter.py | 20 -------------------
|
|
|
d559a5 |
2 files changed, 26 deletions(-)
|
|
|
d559a5 |
|
|
|
d559a5 |
diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
d559a5 |
index 8d5ab8e..65c43ff 100644
|
|
|
d559a5 |
--- a/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
d559a5 |
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
d559a5 |
@@ -1239,12 +1239,6 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
d559a5 |
'is a filename, but a directory is required: %s '
|
|
|
d559a5 |
'(resolved to %s)' % (local_include, full_path),
|
|
|
d559a5 |
context)
|
|
|
d559a5 |
- if (full_path == context.config.topsrcdir or
|
|
|
d559a5 |
- full_path == context.config.topobjdir):
|
|
|
d559a5 |
- raise SandboxValidationError(
|
|
|
d559a5 |
- 'Path specified in LOCAL_INCLUDES '
|
|
|
d559a5 |
- '(%s) resolves to the topsrcdir or topobjdir (%s), which is '
|
|
|
d559a5 |
- 'not allowed' % (local_include, full_path), context)
|
|
|
d559a5 |
include_obj = LocalInclude(context, local_include)
|
|
|
d559a5 |
local_includes.append(include_obj.path.full_path)
|
|
|
d559a5 |
yield include_obj
|
|
|
d559a5 |
diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
|
|
|
d559a5 |
index e8cbd81..d45ccee 100644
|
|
|
d559a5 |
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
|
|
|
d559a5 |
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
|
|
|
d559a5 |
@@ -1040,26 +1040,6 @@ class TestEmitterBasic(unittest.TestCase):
|
|
|
d559a5 |
|
|
|
d559a5 |
self.assertEqual(local_includes, expected)
|
|
|
d559a5 |
|
|
|
d559a5 |
- def test_local_includes_invalid(self):
|
|
|
d559a5 |
- """Test that invalid LOCAL_INCLUDES are properly detected."""
|
|
|
d559a5 |
- reader = self.reader('local_includes-invalid/srcdir')
|
|
|
d559a5 |
-
|
|
|
d559a5 |
- with six.assertRaisesRegex(
|
|
|
d559a5 |
- self,
|
|
|
d559a5 |
- SandboxValidationError,
|
|
|
d559a5 |
- 'Path specified in LOCAL_INCLUDES.*resolves to the '
|
|
|
d559a5 |
- 'topsrcdir or topobjdir'):
|
|
|
d559a5 |
- self.read_topsrcdir(reader)
|
|
|
d559a5 |
-
|
|
|
d559a5 |
- reader = self.reader('local_includes-invalid/objdir')
|
|
|
d559a5 |
-
|
|
|
d559a5 |
- with six.assertRaisesRegex(
|
|
|
d559a5 |
- self,
|
|
|
d559a5 |
- SandboxValidationError,
|
|
|
d559a5 |
- 'Path specified in LOCAL_INCLUDES.*resolves to the '
|
|
|
d559a5 |
- 'topsrcdir or topobjdir'):
|
|
|
d559a5 |
- self.read_topsrcdir(reader)
|
|
|
d559a5 |
-
|
|
|
d559a5 |
def test_local_includes_file(self):
|
|
|
d559a5 |
"""Test that a filename can't be used in LOCAL_INCLUDES."""
|
|
|
d559a5 |
reader = self.reader('local_includes-filename')
|
|
|
d559a5 |
--
|
|
|
d559a5 |
2.26.2
|
|
|
d559a5 |
|