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