From 04c3abce512fe3e9f34636e1b0902e765de2d220 Mon Sep 17 00:00:00 2001 From: Elton Gao Date: Mon, 19 Aug 2024 10:26:50 -0400 Subject: [PATCH] Add CI sandbox mode fix redefinition of enum --- .bazelrc | 2 +- .github/workflows/tests.yml | 8 +++++++- rules/library.bzl | 2 -- .../TestImports-Unit-Tests-Bridging-Header.h | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.bazelrc b/.bazelrc index b690d15f5..74f90dac4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,7 +2,7 @@ common --enable_bzlmod # Spawn strategy required for some tests -build --spawn_strategy=standalone +build --spawn_strategy=local # Setup Xcode configuration. build --xcode_version_config=//:host_xcodes diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dbacbcf49..1ab4b304e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ concurrency: # when adding a new job / changing the matrix, make sure to update all jobs jobs: integration_tests: - name: Build and test (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }} / Virtual Frameworks ${{ matrix.virtual_frameworks }}) + name: Build and test (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }} / Virtual Frameworks ${{ matrix.virtual_frameworks }}) / Sandbox ${{ matrix.sandbox }} runs-on: macos-14 strategy: fail-fast: false @@ -23,6 +23,7 @@ jobs: bazel_version: [6.5.0, 7.1.0] xcode_version: [15.2] virtual_frameworks: [true, false] + sandbox: [true, false] env: XCODE_VERSION: ${{ matrix.xcode_version }} USE_BAZEL_VERSION: ${{ matrix.bazel_version }} @@ -34,6 +35,11 @@ jobs: name: Add vfs config run: | echo "build --config=vfs" >> user.bazelrc + - if: matrix.sandbox + name: Enable sandbox mode + run: | + echo "build --strategy=SwiftCompile=sandboxed" >> user.bazelrc \ + echo "build --spawn_strategy=sandboxed" >> user.bazelrc - name: Build and Test run: | # non-iOS tests diff --git a/rules/library.bzl b/rules/library.bzl index 76afd6532..d9a0d8cfe 100644 --- a/rules/library.bzl +++ b/rules/library.bzl @@ -953,8 +953,6 @@ def apple_library( generated_swift_header_name = module_name + "-Swift.h" if module_map: - # TODO: now that we always add module_map as a swiftc_input, - # we should consider removing this one if it's not needed extend_modulemap( name = module_map + ".extended." + name, destination = "%s.extended.modulemap" % name, diff --git a/tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests-Bridging-Header.h b/tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests-Bridging-Header.h index 37c6e52a9..bf54b734d 100644 --- a/tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests-Bridging-Header.h +++ b/tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests-Bridging-Header.h @@ -1,2 +1 @@ #import -#import