Skip to content

Commit 57931ae

Browse files
authored
fix(build): add .bazelrc.user support and update dev-infra actions (#1137)
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
1 parent 833f01b commit 57931ae

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

.bazelrc.user.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Local development settings for macOS
2+
# Copy this file to .bazelrc.user to enable these settings.
3+
#
4+
# macOS sandbox blocks network access during prerendering (Algolia API calls).
5+
# Use local spawn strategy to allow network access.
6+
build --spawn_strategy=local

.github/workflows/adev-preview-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
common --color=yes
4848
- run: pnpm install --frozen-lockfile
4949
- run: pnpm run build
50-
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@01c8c16f830d02110c28640aea16f145a7937080
50+
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@0512a5b9381ccff00c278d7b4b6ee38e5c09654d
5151
with:
5252
workflow-artifact-name: 'adev-preview'
5353
pull-number: '${{ github.event.pull_request.number }}'

.github/workflows/adev-preview-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
if: ${{ github.event.workflow_run.conclusion == 'success' }}
3030
steps:
3131
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32-
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@01c8c16f830d02110c28640aea16f145a7937080
32+
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@0512a5b9381ccff00c278d7b4b6ee38e5c09654d
3333
with:
3434
github-token: '${{secrets.GITHUB_TOKEN}}'
3535
workflow-artifact-name: 'adev-preview'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.tmp
22
.env
33
.textlintcache
4+
.bazelrc.user
45
build
56
node_modules

tools/lib/setup.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { consola } from 'consola';
22
import { $ } from 'execa';
3-
import { mkdir } from 'node:fs/promises';
3+
import { appendFile, mkdir, readFile } from 'node:fs/promises';
44
import { resolve } from 'node:path';
55
import { cpRf, exists, rmrf } from './fsutils';
66
import { applyPatches, copyLocalizedFiles } from './localize';
@@ -31,4 +31,10 @@ async function initBuildDir() {
3131
await mkdir(buildDir, { recursive: true });
3232
await cpRf(resolve(rootDir, 'origin'), buildDir);
3333
await cpRf(resolve(rootDir, '.bazelrc'), resolve(buildDir, '.bazelrc.user'));
34+
// Append user's local bazelrc settings if exists
35+
const userBazelrc = resolve(rootDir, '.bazelrc.user');
36+
if (await exists(userBazelrc)) {
37+
const content = await readFile(userBazelrc, 'utf-8');
38+
await appendFile(resolve(buildDir, '.bazelrc.user'), '\n' + content);
39+
}
3440
}

0 commit comments

Comments
 (0)