Blame emitter.patch

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