Blame SOURCES/emitter.patch

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