Skip to content

Commit 3e1921d

Browse files
authored
build(mac): bump webpack heap to 6 GB on the macOS appbundle build (#9967)
macOS x64 appbundle builds keep dying inside webpack's TerserPlugin at 92% (asset processing). Build #1294 on `pgabf-macos-x64` reached `<s> [webpack.Progress] 92% [0] sealing asset processing TerserPlugin` and was killed without producing a V8 fatal-error preamble, which points at the OS reaping the Node process under memory pressure rather than V8 hitting its own heap ceiling. TerserPlugin is already running single-threaded (see web/webpack.config.js, `parallel: false`), so we can't claw memory back by reducing parallelism. Bump the V8 old-space ceiling from 3072 MB to 6144 MB inside the macOS appbundle build only — the helper in pkg/mac/build-functions.sh bypasses `yarn run bundle` and calls `yarn run webpacker` directly (see commit d96e863), so this knob is independent of the npm script and does not affect linux/pip/Makefile or dev-machine builds. They keep the 3 GB the `bundle` script has been shipping with for years. If this still doesn't get the x64 box past Terser we'll switch the minimiser to esbuild via terser-webpack-plugin's `minify` option; that is a larger and more invasive change so we are trying the cheap fix first.
1 parent d96e863 commit 3e1921d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

pkg/mac/build-functions.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,14 @@ _complete_bundle() {
305305
# stderr into stdout, so a crash inside lint/webpack (e.g. an OOM
306306
# kill or native-module load failure) leaves a trace in the
307307
# Jenkins console instead of an empty gap before the trap fires.
308-
# Env vars match the top-level "bundle" npm script (see web/package.json)
309-
# so behavior is identical to `yarn run bundle`.
308+
# NODE_ENV mirrors the top-level "bundle" npm script (see
309+
# web/package.json). NODE_OPTIONS bumps V8's old-space ceiling
310+
# past the 3 GB default the npm script uses: the macOS x64 builder
311+
# OS-OOM-kills webpack inside TerserPlugin at the 3 GB setting
312+
# (build #1294, sealing asset processing at 92%). Other build
313+
# paths still get 3 GB via the npm script.
310314
export NODE_ENV=production
311-
export NODE_OPTIONS=--max-old-space-size=3072
315+
export NODE_OPTIONS=--max-old-space-size=6144
312316
echo "==> Running ESLint..."
313317
yarn run linter 2>&1
314318
echo "==> Running webpack bundle..."

0 commit comments

Comments
 (0)