From e9811d02d4c2ab6158b7d472241f74b494412d9e Mon Sep 17 00:00:00 2001 From: Suguru Inatomi Date: Sat, 17 Jan 2026 11:27:11 +0900 Subject: [PATCH] fix(build): add .bazelrc.user support and update dev-infra actions macOS sandbox blocks network access during prerendering (Algolia API calls). Instead of applying spawn strategy globally, provide .bazelrc.user.example template for macOS developers to opt-in locally. - Add .bazelrc.user.example with --spawn_strategy=local for macOS - Update setup.ts to append .bazelrc.user contents if exists - Add .bazelrc.user to .gitignore - Update dev-infra action versions to align with upstream --- .bazelrc.user.example | 6 ++++++ .github/workflows/adev-preview-build.yml | 2 +- .github/workflows/adev-preview-deploy.yml | 2 +- .gitignore | 1 + tools/lib/setup.ts | 8 +++++++- 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .bazelrc.user.example diff --git a/.bazelrc.user.example b/.bazelrc.user.example new file mode 100644 index 0000000000..0eed6fd36d --- /dev/null +++ b/.bazelrc.user.example @@ -0,0 +1,6 @@ +# Local development settings for macOS +# Copy this file to .bazelrc.user to enable these settings. +# +# macOS sandbox blocks network access during prerendering (Algolia API calls). +# Use local spawn strategy to allow network access. +build --spawn_strategy=local diff --git a/.github/workflows/adev-preview-build.yml b/.github/workflows/adev-preview-build.yml index 2a086cf96d..89be429c88 100644 --- a/.github/workflows/adev-preview-build.yml +++ b/.github/workflows/adev-preview-build.yml @@ -47,7 +47,7 @@ jobs: common --color=yes - run: pnpm install --frozen-lockfile - run: pnpm run build - - uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@01c8c16f830d02110c28640aea16f145a7937080 + - uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@0512a5b9381ccff00c278d7b4b6ee38e5c09654d with: workflow-artifact-name: 'adev-preview' pull-number: '${{ github.event.pull_request.number }}' diff --git a/.github/workflows/adev-preview-deploy.yml b/.github/workflows/adev-preview-deploy.yml index eb2d9b34c9..9d7f7d97a8 100644 --- a/.github/workflows/adev-preview-deploy.yml +++ b/.github/workflows/adev-preview-deploy.yml @@ -29,7 +29,7 @@ jobs: if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@01c8c16f830d02110c28640aea16f145a7937080 + - uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@0512a5b9381ccff00c278d7b4b6ee38e5c09654d with: github-token: '${{secrets.GITHUB_TOKEN}}' workflow-artifact-name: 'adev-preview' diff --git a/.gitignore b/.gitignore index 9f9d77183d..6665cc9fe4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .tmp .env .textlintcache +.bazelrc.user build node_modules diff --git a/tools/lib/setup.ts b/tools/lib/setup.ts index 158e835c72..ed5c24ad20 100644 --- a/tools/lib/setup.ts +++ b/tools/lib/setup.ts @@ -1,6 +1,6 @@ import { consola } from 'consola'; import { $ } from 'execa'; -import { mkdir } from 'node:fs/promises'; +import { appendFile, mkdir, readFile } from 'node:fs/promises'; import { resolve } from 'node:path'; import { cpRf, exists, rmrf } from './fsutils'; import { applyPatches, copyLocalizedFiles } from './localize'; @@ -31,4 +31,10 @@ async function initBuildDir() { await mkdir(buildDir, { recursive: true }); await cpRf(resolve(rootDir, 'origin'), buildDir); await cpRf(resolve(rootDir, '.bazelrc'), resolve(buildDir, '.bazelrc.user')); + // Append user's local bazelrc settings if exists + const userBazelrc = resolve(rootDir, '.bazelrc.user'); + if (await exists(userBazelrc)) { + const content = await readFile(userBazelrc, 'utf-8'); + await appendFile(resolve(buildDir, '.bazelrc.user'), '\n' + content); + } }