diff --git a/.bazelrc.user.example b/.bazelrc.user.example index 0eed6fd36..ee41f6854 100644 --- a/.bazelrc.user.example +++ b/.bazelrc.user.example @@ -1,6 +1,10 @@ # 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. +# +# macOS向けのローカル開発設定です。 +# このファイルを .bazelrc.user という名前でコピーすると有効になります。 +# macOSのBazel sandboxは、プレレンダリング中のネットワークアクセス(Algolia API呼び出し)を +# ブロックするため、sandboxを使わないlocal spawn strategyに切り替えて回避します。 build --spawn_strategy=local diff --git a/.github/workflows/adev-preview-build.yml b/.github/workflows/adev-preview-build.yml index daa1321f3..8f8c2a868 100644 --- a/.github/workflows/adev-preview-build.yml +++ b/.github/workflows/adev-preview-build.yml @@ -41,6 +41,8 @@ jobs: build --jobs=2 build --discard_analysis_cache build --nokeep_state_after_build + # Allow network access in sandbox for Algolia API calls during SSR prerendering. + build --sandbox_default_allow_network - run: pnpm install --frozen-lockfile - name: Build run: pnpm run build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a77c7e5ab..80d5bd59f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,8 @@ jobs: build --jobs=2 build --discard_analysis_cache build --nokeep_state_after_build + # Allow network access in sandbox for Algolia API calls during SSR prerendering. + build --sandbox_default_allow_network - run: pnpm install - name: Build run: pnpm run build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d5b51c4c2..0bcb19df6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,14 @@ $ pnpm install $ pnpm build ``` +> [!IMPORTANT] +> macOSでビルドする場合は、`pnpm build` を実行する前に `.bazelrc.user.example` を `.bazelrc.user` という名前でコピーしてください(`.bazelrc.user` は `.gitignore` 対象です)。 +> macOSのBazel sandboxがプレレンダリング中のネットワークアクセス(Algolia API呼び出し)をブロックするため、これがないとビルドが失敗します。 +> +> ``` +> $ cp .bazelrc.user.example .bazelrc.user +> ``` + ### 開発用サーバーを使った作業 開発用ローカルサーバーを起動すると、ビルド結果を確認しながら翻訳作業ができます。