Skip to content

Commit 1362802

Browse files
fixing build
1 parent 9617276 commit 1362802

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

scripts/bundle.macos.sh

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,31 @@ export PLAYWRIGHT_SKIP_BROWSER_GC=1
99

1010
pushd bundle/
1111

12-
# Install ARM64 browsers natively (build machine is macos-15 ARM).
13-
# This guarantees chrome-mac-arm64/, firefox-arm64/, etc. are created correctly.
14-
npx playwright install chromium chromium-headless-shell firefox webkit
15-
npx playwright install-deps chromium firefox webkit
16-
17-
# Install x86 browsers for mac13 (macOS 12/13) compatibility.
18-
# PLAYWRIGHT_SKIP_BROWSER_GC=1 ensures the ARM64 browsers above aren't cleaned up.
12+
# --- Step 1: Install ARM64 browsers for macOS 14/15 (Apple Silicon) ---
13+
# Use mac14-arm64 override instead of native mac15-arm64 so that webkit is
14+
# compiled against the macOS 14 SDK. This binary is forward-compatible with
15+
# macOS 15 but the reverse is not true (mac15 webkit uses symbols absent on 14).
16+
# NOTE: Firefox is deliberately excluded here. Both arm64 and x64 Firefox
17+
# extract to the same directory path (firefox-<rev>/firefox/), so only one
18+
# can exist. We install x64 Firefox in Step 3, which runs natively on Intel
19+
# Macs and via Rosetta 2 on Apple Silicon.
20+
PLAYWRIGHT_HOST_PLATFORM_OVERRIDE=mac14-arm64 npx playwright install chromium chromium-headless-shell webkit
21+
PLAYWRIGHT_HOST_PLATFORM_OVERRIDE=mac14-arm64 npx playwright install-deps chromium webkit
22+
23+
# --- Step 2: Remove INSTALLATION_COMPLETE markers ---
24+
# Playwright marks each browser revision directory with an INSTALLATION_COMPLETE
25+
# file after downloading. Before downloading, it checks for this marker and
26+
# silently skips if present — even when the needed platform variant (e.g. x64)
27+
# is missing. Removing the markers allows the x86 install below to download
28+
# into the same revision directories alongside the ARM64 files.
29+
find "$PLAYWRIGHT_BROWSERS_PATH" -name "INSTALLATION_COMPLETE" -delete
30+
31+
# --- Step 3: Install x86 browsers for macOS 12/13 (Intel) ---
32+
# Chromium/chromium-headless-shell use platform-specific subdirectories
33+
# (chrome-mac-arm64/ vs chrome-mac-x64/) so both coexist in one revision dir.
34+
# Firefox and ffmpeg share the same subdirectory for both architectures, so
35+
# this step overwrites the ARM64 copies with x64 — which is intentional since
36+
# x64 binaries run on Apple Silicon via Rosetta 2.
1937
PLAYWRIGHT_HOST_PLATFORM_OVERRIDE=mac13 npx playwright install chromium chromium-headless-shell firefox
2038
PLAYWRIGHT_HOST_PLATFORM_OVERRIDE=mac13 npx playwright install-deps chromium firefox
2139

0 commit comments

Comments
 (0)