[llvm] [bazel] Allow SupportTests to be built remotely and cached (PR #121375)

Angus Lees via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 30 22:11:42 PST 2024


https://github.com/anguslees created https://github.com/llvm/llvm-project/pull/121375

`SupportTests` fails in the bazel macOS sandbox, because
`FileSystemTest.permissions` expects to be able to modify file
permissions on some otherwise protected files.

Previously this test was marked `local` in bazel, which has
additional undesirable effects such as skipping remote build and cache.

Tighten the bazel tags to just `no-sandbox`.  Note in particular, that
this allows the test to build, execute, and cache remotely (if
configured).

Testing:
- Verified this test fails (as expected) on macOS with no tags, and
  passes with `no-sandbox`.
- Verified this test passes when executed remotely (using an Engflow RBE
  setup) with `no-sandbox`.

>From d207d35f4ca739481b6f140aed1c2864077c7ecb Mon Sep 17 00:00:00 2001
From: Angus Lees <gus at inodes.org>
Date: Tue, 31 Dec 2024 17:10:54 +1100
Subject: [PATCH] [bazel] Allow SupportTests to be built remotely and cached

`SupportTests` fails in the bazel macOS sandbox, because
`FileSystemTest.permissions` expects to be able to modify file
permissions on some otherwise protected files.

Previously this test was marked `local` in bazel, which has
additional undesirable effects such as skipping remote build and cache.

Tighten the bazel tags to just `no-sandbox`.  Note in particular, that
this allows the test to build, execute, and cache remotely (if
configured).

Testing:
- Verified this test fails (as expected) on macOS with no tags, and
  passes with `no-sandbox`.
- Verified this test passes when executed remotely (using an Engflow RBE
  setup) with `no-sandbox`.
---
 utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
index 8a6950facbdf2b..d576a9190d09b3 100644
--- a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
@@ -697,7 +697,7 @@ cc_test(
     ],
     linkstatic = 1,
     tags = [
-        "local",  # Not compatible with the sandbox on MacOS
+        "no-sandbox",  # FileSystemTest.permissions not compatible with the sandbox on MacOS
     ],
     deps = [
         "//llvm:AllTargetsCodeGens",



More information about the llvm-commits mailing list