From 736546cd60fbd6f88f06ba1bf99af84ccfd54221 Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Mon, 16 Nov 2026 20:57:21 -0800 Subject: [PATCH] ci: run the macOS native checks on the self-hosted macOS executor The aarch64-apple-darwin CSV and YAML native jobs built rapidyaml and the natives on a hosted macos-15 runner, with only the remote cache to help; one hit the job timeout on a slow runner while releasing 0.14.0. The organization's self-hosted macOS arm64 BuildBuddy executor (pool komodo-release-macos-arm64) runs the same YAML tests in about 80 seconds. --config=remote_macos targets //bazel/platforms:rbe_macos_arm64 with its own cache namespace, since the macOS C/C++ wrapper selects the executor's SDK outside action keys. Trusted runs drive it from a Linux runner; fork PRs, which get no BuildBuddy key, keep the hosted macOS runner and local builds. Signed-off-by: Sam Gammon --- .bazelrc | 9 +++++++++ .github/workflows/check.natives.yml | 26 ++++++++++++++++++-------- bazel/platforms/BUILD.bazel | 17 +++++++++++++++++ 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.bazelrc b/.bazelrc index e6df09ba..c4119413 100644 --- a/.bazelrc +++ b/.bazelrc @@ -93,6 +93,15 @@ common:remote_arm64 --platforms=//bazel/platforms:rbe_linux_arm64 common:remote_arm64 --host_platform=//bazel/platforms:rbe_linux_arm64 +# macOS arm64 remote execution (--config=remote_macos) on the self-hosted executor, for the macos-aarch64 natives and +# their tests. Its own cache namespace: the macOS C/C++ wrapper selects the executor's SDK outside action keys, so +# these results never share entries with Linux or with developer machines. +common:remote_macos --config=remote +common:remote_macos --platforms=//bazel/platforms:rbe_macos_arm64 +common:remote_macos --host_platform=//bazel/platforms:rbe_macos_arm64 +common:remote_macos --remote_instance_name=elide-dev/truffledata/macos/v1 +common:remote_macos --jobs=16 + # Nearby GCP execution; selected by trusted CI only after shared-cache setup succeeds. # --config=remote retains hosted BuildBuddy execution; --config=local remains host-local. common:shared_cache --remote_executor=grpcs://elide-dev.buildbuddy.io:443 diff --git a/.github/workflows/check.natives.yml b/.github/workflows/check.natives.yml index 09021c3f..0d62bc35 100644 --- a/.github/workflows/check.natives.yml +++ b/.github/workflows/check.natives.yml @@ -28,10 +28,15 @@ jobs: platform: --dynamic_mode=off --platforms=//bazel/platforms:linux_arm64_musl shared: false - target: aarch64-apple-darwin + # Trusted runs execute on the self-hosted macOS executor (--config=remote_macos) from a Linux runner; + # fork PRs, which get no BuildBuddy key, build on a hosted macOS runner. runner: macos-15 + remote: true platform: '' shared: true - runs-on: ${{ matrix.runner }} + runs-on: ${{ matrix.remote && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'ubuntu-24.04' || matrix.runner }} + env: + BAZEL_CONFIG: ${{ matrix.remote && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'remote_macos' || 'local' }} timeout-minutes: 45 steps: - name: Harden runner @@ -54,15 +59,15 @@ jobs: - name: Native kernel and isolated archive acceptance env: TARGET_PLATFORM: ${{ matrix.platform }} - run: bazel test --config=local $TARGET_PLATFORM //csv/native:api_test //csv/native:index_test //tools/release:csv_archive_test + run: bazel test --config=$BAZEL_CONFIG $TARGET_PLATFORM //csv/native:api_test //csv/native:index_test //tools/release:csv_archive_test - name: Shared loading and ThinLTO acceptance if: matrix.shared - run: bazel test --config=local //tools/release:csv_c_static_test //tools/release:csv_c_thinlto_test + run: bazel test --config=$BAZEL_CONFIG //tools/release:csv_c_static_test //tools/release:csv_c_thinlto_test - name: Musl static ThinLTO acceptance if: ${{ !matrix.shared }} env: TARGET_PLATFORM: ${{ matrix.platform }} - run: bazel test --config=local $TARGET_PLATFORM //tools/release:csv_musl_c_static_test //tools/release:csv_musl_c_thinlto_test + run: bazel test --config=$BAZEL_CONFIG $TARGET_PLATFORM //tools/release:csv_musl_c_static_test //tools/release:csv_musl_c_thinlto_test - name: Remove BuildBuddy credentials if: always() run: rm -f user.bazelrc @@ -85,10 +90,15 @@ jobs: platform: --dynamic_mode=off --platforms=//bazel/platforms:linux_arm64_musl shared: false - target: aarch64-apple-darwin + # Trusted runs execute on the self-hosted macOS executor (--config=remote_macos) from a Linux runner; + # fork PRs, which get no BuildBuddy key, build on a hosted macOS runner. runner: macos-15 + remote: true platform: '' shared: true - runs-on: ${{ matrix.runner }} + runs-on: ${{ matrix.remote && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'ubuntu-24.04' || matrix.runner }} + env: + BAZEL_CONFIG: ${{ matrix.remote && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'remote_macos' || 'local' }} timeout-minutes: 45 steps: - name: Harden runner @@ -111,15 +121,15 @@ jobs: - name: Native decoder and isolated archive acceptance env: TARGET_PLATFORM: ${{ matrix.platform }} - run: bazel test --config=local $TARGET_PLATFORM //yaml/native:api_test //yaml/native:input_test //yaml/native:stream_test //tools/release:yaml_archive_test + run: bazel test --config=$BAZEL_CONFIG $TARGET_PLATFORM //yaml/native:api_test //yaml/native:input_test //yaml/native:stream_test //tools/release:yaml_archive_test - name: Shared loading and ThinLTO acceptance if: matrix.shared - run: bazel test --config=local //tools/release:yaml_c_static_test //tools/release:yaml_c_thinlto_test + run: bazel test --config=$BAZEL_CONFIG //tools/release:yaml_c_static_test //tools/release:yaml_c_thinlto_test - name: Musl static ThinLTO acceptance if: ${{ !matrix.shared }} env: TARGET_PLATFORM: ${{ matrix.platform }} - run: bazel test --config=local $TARGET_PLATFORM //tools/release:yaml_musl_c_static_test //tools/release:yaml_musl_c_thinlto_test + run: bazel test --config=$BAZEL_CONFIG $TARGET_PLATFORM //tools/release:yaml_musl_c_static_test //tools/release:yaml_musl_c_thinlto_test - name: Remove BuildBuddy credentials if: always() run: rm -f user.bazelrc diff --git a/bazel/platforms/BUILD.bazel b/bazel/platforms/BUILD.bazel index d3200a41..6c16f530 100644 --- a/bazel/platforms/BUILD.bazel +++ b/bazel/platforms/BUILD.bazel @@ -97,6 +97,23 @@ constraint_value( ("arm64", "aarch64"), ]] +# The organization's self-hosted macOS arm64 executor (--config=remote_macos): bare metal, no container or VM +# isolation, registered in pool komodo-release-macos-arm64 (MY_POOL in its launchd job). Actions use the build's +# hermetic toolchains plus the executor's Command Line Tools SDK. +platform( + name = "rbe_macos_arm64", + constraint_values = [ + "@platforms//os:macos", + "@platforms//cpu:aarch64", + ], + exec_properties = { + "OSFamily": "darwin", + "Arch": "arm64", + "use-self-hosted-executors": "true", + "Pool": "komodo-release-macos-arm64", + }, +) + # Opt-in GCP workers: same image/toolchains and hermetic network policy as hosted RBE. platform( name = "rbe_linux_amd64_shared",