Skip to content

build: faster symbol archives, skip test artifacts on publish - #52745

Merged
MarshallOfSound merged 2 commits into
mainfrom
build/faster-symbol-archives-skip-publish-test-artifacts
Aug 10, 2026
Merged

MarshallOfSound merged 2 commits into
mainfrom
build/faster-symbol-archives-skip-publish-test-artifacts

Conversation

@MarshallOfSound

@MarshallOfSound MarshallOfSound commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Publish jobs spend a large chunk of their wall clock outside the build itself; this trims the two biggest non-build items without changing any released file formats.

  • dsym.tar.xz is now written with multi-threaded xz (bsdtar --options xz:threads=0; XZ_OPT=-T0 under GNU tar). "Zip Symbols" was 25–47 min on every macOS publish job because xz was single-threaded over ~7 GB of dSYMs. Output is still a plain .xz stream.
  • Symbol zips (pdb.zip, dsym-snapshot.zip, debug.zip, symbols.zip) use deflate level 6 instead of 9. build: apply additional compression on upload #48766 added -9 for the 2 GB asset limit; measured below, it only buys ~0.4% (~8 MB on the 1.93 GB win-x64 pdb.zip) for ~1.7x the time — "Zip Symbols" was 8–16 min on Windows.
  • "Zip Symbols" now only runs when the build was asked for symbols. Every testing and PGO build passes generate-symbols: false (the input was declared but never read), and symbols.zip/pdb.zip/dSYM archives are only consumed by the release uploader (move-artifacts.sh already tolerates their absence), yet each Windows PR build spent 8–13 min zipping PDBs — it's the largest remaining step on a fully cached build.
  • Publish and release-build jobs pass generate-test-artifacts: false: nothing consumes src_artifacts (12.5 min of msys cp -r + tar per Windows publish job, 8 × 143–787 MB uploads per release) or the linux arm64 cross-arch snapshot (5.7 min) outside test jobs. The mksnapshot_args fixup was behind the same flag but is also read by @electron/mksnapshot from the released zip, so it now also runs for is-release builds.

Measured on a 512 MiB slice of an unstripped electron binary (Linux, one core unless noted):

time size
python zipfile level 9 → 6 29.5 s → 17.2 s +0.4%
zip -9 → zip (6) 31.3 s → 18.1 s +0.4%
tar -cJf → xz:threads=5 164 s → 38.6 s +1.0%

Reference timings are from the v45.0.0-nightly.20260808 / v44.0.0-beta.2 publish runs.

Checklist

  • I have built and tested this change
  • I have filled out the PR description
  • I have reviewed and verified the changes

Verified make_zip / make_tar_xz locally against both GNU tar and bsdtar (archives list and xz -t cleanly), lint --py passes, and copy-pipeline-segment-publish.js --check is still in sync. The macOS/Windows "Zip Symbols" step time on this PR's own CI is the real check for the xz change; the publish-flag change is only exercised by a publish run.

Release Notes

Notes: none

…lish

dsym.tar.xz was written by single-threaded xz, which takes 25-45 minutes
per macOS publish job for the ~7GB of dSYMs; use multi-threaded xz
(bsdtar --options xz:threads=0, XZ_OPT=-T0 for GNU tar). Drop the symbol
zips from deflate level 9 to 6, which is ~1.7x faster for ~0.4% larger
output; pdb.zip on Windows took 8-16 minutes at level 9.

Publish and release-build jobs have no test consumers, so pass
generate-test-artifacts: false to skip the src_artifacts tar (12+ minutes
on Windows) and the linux arm64 cross-arch snapshot (~6 minutes). The
mksnapshot_args fixup is also needed by the released mksnapshot.zip, so it
now runs for release builds regardless of that flag.

No-Verification-Needed: CI workflow and packaging script changes only
No-Verification-Needed: CI action condition only
@MarshallOfSound MarshallOfSound added target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Aug 10, 2026
@MarshallOfSound
MarshallOfSound merged commit 7eb7b5f into main Aug 10, 2026
96 checks passed
@MarshallOfSound
MarshallOfSound deleted the build/faster-symbol-archives-skip-publish-test-artifacts branch August 10, 2026 23:41
@release-clerk

release-clerk Bot commented Aug 10, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "42-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot removed the target/42-x-y PR should also be added to the "42-x-y" branch. label Aug 10, 2026
@trop

trop Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "41-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "43-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/41-x-y needs-manual-bp/43-x-y and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. labels Aug 10, 2026
@trop

trop Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #52758

@trop trop Bot added in-flight/44-x-y merged/44-x-y PR was merged to the "44-x-y" branch. and removed target/44-x-y PR should also be added to the "44-x-y" branch. in-flight/44-x-y labels Aug 10, 2026
@trop

trop Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@VerteDinde has manually backported this PR to "43-x-y", please check out #52942

VerteDinde pushed a commit that referenced this pull request Aug 18, 2026
* build: compress symbol archives faster and skip test artifacts on publish

dsym.tar.xz was written by single-threaded xz, which takes 25-45 minutes
per macOS publish job for the ~7GB of dSYMs; use multi-threaded xz
(bsdtar --options xz:threads=0, XZ_OPT=-T0 for GNU tar). Drop the symbol
zips from deflate level 9 to 6, which is ~1.7x faster for ~0.4% larger
output; pdb.zip on Windows took 8-16 minutes at level 9.

Publish and release-build jobs have no test consumers, so pass
generate-test-artifacts: false to skip the src_artifacts tar (12+ minutes
on Windows) and the linux arm64 cross-arch snapshot (~6 minutes). The
mksnapshot_args fixup is also needed by the released mksnapshot.zip, so it
now runs for release builds regardless of that flag.

No-Verification-Needed: CI workflow and packaging script changes only

* build: only zip symbols when the build asked for them

No-Verification-Needed: CI action condition only
(cherry picked from commit 7eb7b5f)
@trop

trop Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@VerteDinde has manually backported this PR to "42-x-y", please check out #52987

VerteDinde pushed a commit that referenced this pull request Aug 19, 2026
* build: compress symbol archives faster and skip test artifacts on publish

dsym.tar.xz was written by single-threaded xz, which takes 25-45 minutes
per macOS publish job for the ~7GB of dSYMs; use multi-threaded xz
(bsdtar --options xz:threads=0, XZ_OPT=-T0 for GNU tar). Drop the symbol
zips from deflate level 9 to 6, which is ~1.7x faster for ~0.4% larger
output; pdb.zip on Windows took 8-16 minutes at level 9.

Publish and release-build jobs have no test consumers, so pass
generate-test-artifacts: false to skip the src_artifacts tar (12+ minutes
on Windows) and the linux arm64 cross-arch snapshot (~6 minutes). The
mksnapshot_args fixup is also needed by the released mksnapshot.zip, so it
now runs for release builds regardless of that flag.

No-Verification-Needed: CI workflow and packaging script changes only

* build: only zip symbols when the build asked for them

No-Verification-Needed: CI action condition only
(cherry picked from commit 7eb7b5f)
@trop

trop Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@VerteDinde has manually backported this PR to "41-x-y", please check out #53007

MarshallOfSound added a commit that referenced this pull request Aug 19, 2026
build: faster symbol archives, skip test artifacts on publish (#52745)

41-x-y note: this branch has no generate-test-artifacts plumbing in build-electron/action.yml or the pipeline segments, so only the symbol-archive changes (multi-threaded xz / lower zip level in script/lib/util.py, and gating Zip Symbols on generate-symbols) are carried; the publish-workflow generate-test-artifacts flags and the Fixup Mksnapshot gating have nothing to apply to here.

(cherry picked from commit 7eb7b5f)

Co-authored-by: Samuel Attard <[email protected]>
@trop trop Bot added merged/41-x-y PR was merged to the "41-x-y" branch. and removed in-flight/41-x-y labels Aug 19, 2026
MarshallOfSound added a commit that referenced this pull request Aug 19, 2026
build: faster symbol archives, skip test artifacts on publish (#52745)

* build: compress symbol archives faster and skip test artifacts on publish

dsym.tar.xz was written by single-threaded xz, which takes 25-45 minutes
per macOS publish job for the ~7GB of dSYMs; use multi-threaded xz
(bsdtar --options xz:threads=0, XZ_OPT=-T0 for GNU tar). Drop the symbol
zips from deflate level 9 to 6, which is ~1.7x faster for ~0.4% larger
output; pdb.zip on Windows took 8-16 minutes at level 9.

Publish and release-build jobs have no test consumers, so pass
generate-test-artifacts: false to skip the src_artifacts tar (12+ minutes
on Windows) and the linux arm64 cross-arch snapshot (~6 minutes). The
mksnapshot_args fixup is also needed by the released mksnapshot.zip, so it
now runs for release builds regardless of that flag.

No-Verification-Needed: CI workflow and packaging script changes only

* build: only zip symbols when the build asked for them

No-Verification-Needed: CI action condition only
(cherry picked from commit 7eb7b5f)

Co-authored-by: Samuel Attard <[email protected]>
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Aug 19, 2026
codebytere pushed a commit that referenced this pull request Aug 19, 2026
* build: faster symbol archives, skip test artifacts on publish (#52745)

* build: compress symbol archives faster and skip test artifacts on publish

dsym.tar.xz was written by single-threaded xz, which takes 25-45 minutes
per macOS publish job for the ~7GB of dSYMs; use multi-threaded xz
(bsdtar --options xz:threads=0, XZ_OPT=-T0 for GNU tar). Drop the symbol
zips from deflate level 9 to 6, which is ~1.7x faster for ~0.4% larger
output; pdb.zip on Windows took 8-16 minutes at level 9.

Publish and release-build jobs have no test consumers, so pass
generate-test-artifacts: false to skip the src_artifacts tar (12+ minutes
on Windows) and the linux arm64 cross-arch snapshot (~6 minutes). The
mksnapshot_args fixup is also needed by the released mksnapshot.zip, so it
now runs for release builds regardless of that flag.

No-Verification-Needed: CI workflow and packaging script changes only

* build: only zip symbols when the build asked for them

No-Verification-Needed: CI action condition only
(cherry picked from commit 7eb7b5f)

* build: trim the non-link overhead of macOS release builds (#52883)

* build: trim the non-link overhead of macOS release builds

Four independent, low-risk changes aimed at the macOS release job, which
today spends well over an hour outside the ThinLTO links themselves:

* Zip Symbols: `tar --options xz:threads=0` does not actually multi-thread
  on macOS (Apple's liblzma emits a single block), so the ~7 GB of dSYMs
  were being compressed by one core at preset -6, ~30 minutes per job. Pipe
  the tar stream through the xz binary with -T0 instead (falling back to
  the tar options when xz is not on PATH), and use preset -3, which is ~5x
  faster than -6 for ~12% larger output. Same .tar.xz format.

* siso: set SISO_EXPERIMENTS=no-fallback on macOS. When a remote compile
  exceeds siso's 2 minute client-side deadline (RBE queueing, an upload
  stall) siso re-runs it locally; on the 5-core / 14 GB runners a local
  ThinLTO compile takes 5-10 minutes and lands on the critical path (75
  such fallbacks in a recent release build, 570 in a testing build).
  no-fallback retries remotely with a 4x longer deadline instead.

* GN: thin_lto_enable_cache=false for macOS release builds. CI starts from
  a fresh out dir, so the ThinLTO cache is written (~100 GB across a
  release build's links) and never read, competing for IO with links that
  are already swapping. Local builds keep the default.

* build-stats: hash object files on worker threads and only walk obj/ and
  <toolchain>/obj/. The previous recursive readdir of the whole out dir
  (~800k entries) plus single-threaded sha256 of ~6 GB took 2-3 minutes;
  this takes seconds. Objects outside those trees (SDK crt*.o, rust
  sysroot copies) are no longer counted, which does not affect the change
  rate metric since only files present in both snapshots are compared.

No-Verification-Needed: CI config and build scripts only, no product code

* build: use context managers for the tar|xz pipeline (pylint R1732)

* build: read only the tail of siso.INFO in build-stats.mjs

siso.INFO grows with the step count and a release build's already exceeds
V8's maximum string length once a second toolchain is in the graph, which
made build-stats.mjs fail with 'Invalid string length'. The stats line is
at the end of the log, so read the last 16 MB instead of the whole file.

* build: drop SISO_EXPERIMENTS=no-fallback on macOS

Under RBE queue pressure a remote compile can stay EXECUTING past siso's
deadline; with no-fallback siso retries (deduped onto the same running op)
and then fails the build outright, which is worse than a slow local
fallback for PR CI. Give remote compiles a longer deadline in build-tools'
siso config instead and keep the fallback as the safety net.

* build: link the macOS snapshot tools without ThinLTO in release builds (#52884)

* build: link the macOS snapshot tools without ThinLTO in release builds

In official builds v8_snapshot_toolchain is the target toolchain, so
mksnapshot, node_mksnapshot, v8_context_snapshot_generator and the natives
code-cache generator are each a full ThinLTO+PGO link of V8 (and Blink, and
Node) with dsymutil. On the 5-core / 14 GB macOS CI runners those four links
take 12 + 6 + 20 + 2 minutes (21 + 46 min on x64, where they also run under
Rosetta), run serially through a link pool of depth 1, and page heavily
(5-9 GB RSS each), all before the Electron Framework link can start. Their
outputs are snapshot/code-cache data that does not depend on how optimized
the tool binary is.

Add //electron/build/toolchain/mac with variants of the mac toolchain that
turn off ThinLTO, PGO and debug info (symbol_level=0, so the extra objects
are small and dsymutil has nothing to link) and point macOS release builds'
v8_snapshot_toolchain at them: clang_arm64_snapshot for arm64 and
clang_x64_snapshot for x64 (still x64 so mksnapshot.zip keeps shipping an
x64 mksnapshot). V8/Blink/Node compile a second time in that toolchain, but
remotely and cacheably.

Because the tools now live under $root_out_dir/<toolchain>/, mksnapshot.zip
is flattened on macOS so its layout is unchanged (mksnapshot,
v8_context_snapshot_generator, their dylibs and icudtl.dat at the root), and
build/zip.py learns to apply PATHS_TO_SKIP relative to a toolchain dir and
to drop duplicates when flattening. The resulting file set is identical to
the default-toolchain one.

Testing builds are unaffected (no LTO there, so nothing to gain from a
second toolchain).

No-Verification-Needed: build config and packaging script only

* build: update build-tools for remote generators and longer remote compile deadlines (#52896)

Picks up electron/build-tools#889 and #890:

* siso runs the mojom, Blink bindings, grit strings and TypeScript/WebUI
  generators on RBE workers instead of locally (all hosts). On the 5-core
  macOS runners those steps are about a CPU-hour of python/node per release
  build, contending with siso's include scanning during the fetch phase;
  remotely they are also cached, so unchanged generators become cache hits
  on every host.
* remote clang steps on macOS hosts get a 10 minute client-side deadline
  instead of 2 minutes, so ordinary RBE queueing no longer triggers the
  5-10 minute local ThinLTO fallback compiles that land on the critical
  path (75 in one release build, 570 in a testing build). Local fallback
  stays as the safety net.

(cherry picked from commit d36eebf)

---------

Co-authored-by: Samuel Attard <[email protected]>
jkleinsc pushed a commit that referenced this pull request Aug 24, 2026
* ci: bump build-tools SHA (`4b75f1f`) (#52059)

Also picks up the `e build --only-gen` -> `--gen=only` rename from #51445 (which never targeted 41-x-y); build-tools >= 1f31f11 forwards the old flag to ninja, which breaks the gn-check job.

(cherry picked from commit 3612c21)

* build: faster symbol archives, skip test artifacts on publish (#52745)

41-x-y note: this branch has no generate-test-artifacts plumbing in build-electron/action.yml or the pipeline segments, so only the symbol-archive changes (multi-threaded xz / lower zip level in script/lib/util.py, and gating Zip Symbols on generate-symbols) are carried; the publish-workflow generate-test-artifacts flags and the Fixup Mksnapshot gating have nothing to apply to here.

(cherry picked from commit 7eb7b5f)

* build: trim the non-link overhead of macOS release builds (#52883)

* build: trim the non-link overhead of macOS release builds

Four independent, low-risk changes aimed at the macOS release job, which
today spends well over an hour outside the ThinLTO links themselves:

* Zip Symbols: `tar --options xz:threads=0` does not actually multi-thread
  on macOS (Apple's liblzma emits a single block), so the ~7 GB of dSYMs
  were being compressed by one core at preset -6, ~30 minutes per job. Pipe
  the tar stream through the xz binary with -T0 instead (falling back to
  the tar options when xz is not on PATH), and use preset -3, which is ~5x
  faster than -6 for ~12% larger output. Same .tar.xz format.

* siso: set SISO_EXPERIMENTS=no-fallback on macOS. When a remote compile
  exceeds siso's 2 minute client-side deadline (RBE queueing, an upload
  stall) siso re-runs it locally; on the 5-core / 14 GB runners a local
  ThinLTO compile takes 5-10 minutes and lands on the critical path (75
  such fallbacks in a recent release build, 570 in a testing build).
  no-fallback retries remotely with a 4x longer deadline instead.

* GN: thin_lto_enable_cache=false for macOS release builds. CI starts from
  a fresh out dir, so the ThinLTO cache is written (~100 GB across a
  release build's links) and never read, competing for IO with links that
  are already swapping. Local builds keep the default.

* build-stats: hash object files on worker threads and only walk obj/ and
  <toolchain>/obj/. The previous recursive readdir of the whole out dir
  (~800k entries) plus single-threaded sha256 of ~6 GB took 2-3 minutes;
  this takes seconds. Objects outside those trees (SDK crt*.o, rust
  sysroot copies) are no longer counted, which does not affect the change
  rate metric since only files present in both snapshots are compared.

No-Verification-Needed: CI config and build scripts only, no product code

* build: use context managers for the tar|xz pipeline (pylint R1732)

* build: read only the tail of siso.INFO in build-stats.mjs

siso.INFO grows with the step count and a release build's already exceeds
V8's maximum string length once a second toolchain is in the graph, which
made build-stats.mjs fail with 'Invalid string length'. The stats line is
at the end of the log, so read the last 16 MB instead of the whole file.

* build: drop SISO_EXPERIMENTS=no-fallback on macOS

Under RBE queue pressure a remote compile can stay EXECUTING past siso's
deadline; with no-fallback siso retries (deduped onto the same running op)
and then fails the build outright, which is worse than a slow local
fallback for PR CI. Give remote compiles a longer deadline in build-tools'
siso config instead and keep the fallback as the safety net.

* build: link the macOS snapshot tools without ThinLTO in release builds (#52884)

* build: link the macOS snapshot tools without ThinLTO in release builds

In official builds v8_snapshot_toolchain is the target toolchain, so
mksnapshot, node_mksnapshot, v8_context_snapshot_generator and the natives
code-cache generator are each a full ThinLTO+PGO link of V8 (and Blink, and
Node) with dsymutil. On the 5-core / 14 GB macOS CI runners those four links
take 12 + 6 + 20 + 2 minutes (21 + 46 min on x64, where they also run under
Rosetta), run serially through a link pool of depth 1, and page heavily
(5-9 GB RSS each), all before the Electron Framework link can start. Their
outputs are snapshot/code-cache data that does not depend on how optimized
the tool binary is.

Add //electron/build/toolchain/mac with variants of the mac toolchain that
turn off ThinLTO, PGO and debug info (symbol_level=0, so the extra objects
are small and dsymutil has nothing to link) and point macOS release builds'
v8_snapshot_toolchain at them: clang_arm64_snapshot for arm64 and
clang_x64_snapshot for x64 (still x64 so mksnapshot.zip keeps shipping an
x64 mksnapshot). V8/Blink/Node compile a second time in that toolchain, but
remotely and cacheably.

Because the tools now live under $root_out_dir/<toolchain>/, mksnapshot.zip
is flattened on macOS so its layout is unchanged (mksnapshot,
v8_context_snapshot_generator, their dylibs and icudtl.dat at the root), and
build/zip.py learns to apply PATHS_TO_SKIP relative to a toolchain dir and
to drop duplicates when flattening. The resulting file set is identical to
the default-toolchain one.

Testing builds are unaffected (no LTO there, so nothing to gain from a
second toolchain).

No-Verification-Needed: build config and packaging script only

* build: update build-tools for remote generators and longer remote compile deadlines (#52896)

Picks up electron/build-tools#889 and #890:

* siso runs the mojom, Blink bindings, grit strings and TypeScript/WebUI
  generators on RBE workers instead of locally (all hosts). On the 5-core
  macOS runners those steps are about a CPU-hour of python/node per release
  build, contending with siso's include scanning during the fetch phase;
  remotely they are also cached, so unchanged generators become cache hits
  on every host.
* remote clang steps on macOS hosts get a 10 minute client-side deadline
  instead of 2 minutes, so ordinary RBE queueing no longer triggers the
  5-10 minute local ThinLTO fallback compiles that land on the critical
  path (75 in one release build, 570 in a testing build). Local fallback
  stays as the safety net.

(cherry picked from commit d36eebf)

---------

Co-authored-by: David Sanders <[email protected]>
Co-authored-by: Samuel Attard <[email protected]>
jkleinsc pushed a commit that referenced this pull request Aug 24, 2026
* ci: bump build-tools SHA (`4b75f1f`) (#52059)

Also picks up the `e build --only-gen` -> `--gen=only` rename from #51445 (which never targeted 42-x-y); build-tools >= 1f31f11 forwards the old flag to ninja, which breaks the gn-check and clang-tidy jobs.

(cherry picked from commit 3612c2113c7749c8fa48a0c33c9b6c9913a06147)

* build: faster symbol archives, skip test artifacts on publish (#52745)

* build: compress symbol archives faster and skip test artifacts on publish

dsym.tar.xz was written by single-threaded xz, which takes 25-45 minutes
per macOS publish job for the ~7GB of dSYMs; use multi-threaded xz
(bsdtar --options xz:threads=0, XZ_OPT=-T0 for GNU tar). Drop the symbol
zips from deflate level 9 to 6, which is ~1.7x faster for ~0.4% larger
output; pdb.zip on Windows took 8-16 minutes at level 9.

Publish and release-build jobs have no test consumers, so pass
generate-test-artifacts: false to skip the src_artifacts tar (12+ minutes
on Windows) and the linux arm64 cross-arch snapshot (~6 minutes). The
mksnapshot_args fixup is also needed by the released mksnapshot.zip, so it
now runs for release builds regardless of that flag.

No-Verification-Needed: CI workflow and packaging script changes only

* build: only zip symbols when the build asked for them

No-Verification-Needed: CI action condition only
(cherry picked from commit 7eb7b5f)

* build: trim the non-link overhead of macOS release builds (#52883)

* build: trim the non-link overhead of macOS release builds

Four independent, low-risk changes aimed at the macOS release job, which
today spends well over an hour outside the ThinLTO links themselves:

* Zip Symbols: `tar --options xz:threads=0` does not actually multi-thread
  on macOS (Apple's liblzma emits a single block), so the ~7 GB of dSYMs
  were being compressed by one core at preset -6, ~30 minutes per job. Pipe
  the tar stream through the xz binary with -T0 instead (falling back to
  the tar options when xz is not on PATH), and use preset -3, which is ~5x
  faster than -6 for ~12% larger output. Same .tar.xz format.

* siso: set SISO_EXPERIMENTS=no-fallback on macOS. When a remote compile
  exceeds siso's 2 minute client-side deadline (RBE queueing, an upload
  stall) siso re-runs it locally; on the 5-core / 14 GB runners a local
  ThinLTO compile takes 5-10 minutes and lands on the critical path (75
  such fallbacks in a recent release build, 570 in a testing build).
  no-fallback retries remotely with a 4x longer deadline instead.

* GN: thin_lto_enable_cache=false for macOS release builds. CI starts from
  a fresh out dir, so the ThinLTO cache is written (~100 GB across a
  release build's links) and never read, competing for IO with links that
  are already swapping. Local builds keep the default.

* build-stats: hash object files on worker threads and only walk obj/ and
  <toolchain>/obj/. The previous recursive readdir of the whole out dir
  (~800k entries) plus single-threaded sha256 of ~6 GB took 2-3 minutes;
  this takes seconds. Objects outside those trees (SDK crt*.o, rust
  sysroot copies) are no longer counted, which does not affect the change
  rate metric since only files present in both snapshots are compared.

No-Verification-Needed: CI config and build scripts only, no product code

* build: use context managers for the tar|xz pipeline (pylint R1732)

* build: read only the tail of siso.INFO in build-stats.mjs

siso.INFO grows with the step count and a release build's already exceeds
V8's maximum string length once a second toolchain is in the graph, which
made build-stats.mjs fail with 'Invalid string length'. The stats line is
at the end of the log, so read the last 16 MB instead of the whole file.

* build: drop SISO_EXPERIMENTS=no-fallback on macOS

Under RBE queue pressure a remote compile can stay EXECUTING past siso's
deadline; with no-fallback siso retries (deduped onto the same running op)
and then fails the build outright, which is worse than a slow local
fallback for PR CI. Give remote compiles a longer deadline in build-tools'
siso config instead and keep the fallback as the safety net.

* build: link the macOS snapshot tools without ThinLTO in release builds (#52884)

* build: link the macOS snapshot tools without ThinLTO in release builds

In official builds v8_snapshot_toolchain is the target toolchain, so
mksnapshot, node_mksnapshot, v8_context_snapshot_generator and the natives
code-cache generator are each a full ThinLTO+PGO link of V8 (and Blink, and
Node) with dsymutil. On the 5-core / 14 GB macOS CI runners those four links
take 12 + 6 + 20 + 2 minutes (21 + 46 min on x64, where they also run under
Rosetta), run serially through a link pool of depth 1, and page heavily
(5-9 GB RSS each), all before the Electron Framework link can start. Their
outputs are snapshot/code-cache data that does not depend on how optimized
the tool binary is.

Add //electron/build/toolchain/mac with variants of the mac toolchain that
turn off ThinLTO, PGO and debug info (symbol_level=0, so the extra objects
are small and dsymutil has nothing to link) and point macOS release builds'
v8_snapshot_toolchain at them: clang_arm64_snapshot for arm64 and
clang_x64_snapshot for x64 (still x64 so mksnapshot.zip keeps shipping an
x64 mksnapshot). V8/Blink/Node compile a second time in that toolchain, but
remotely and cacheably.

Because the tools now live under $root_out_dir/<toolchain>/, mksnapshot.zip
is flattened on macOS so its layout is unchanged (mksnapshot,
v8_context_snapshot_generator, their dylibs and icudtl.dat at the root), and
build/zip.py learns to apply PATHS_TO_SKIP relative to a toolchain dir and
to drop duplicates when flattening. The resulting file set is identical to
the default-toolchain one.

Testing builds are unaffected (no LTO there, so nothing to gain from a
second toolchain).

No-Verification-Needed: build config and packaging script only

* build: update build-tools for remote generators and longer remote compile deadlines (#52896)

Picks up electron/build-tools#889 and #890:

* siso runs the mojom, Blink bindings, grit strings and TypeScript/WebUI
  generators on RBE workers instead of locally (all hosts). On the 5-core
  macOS runners those steps are about a CPU-hour of python/node per release
  build, contending with siso's include scanning during the fetch phase;
  remotely they are also cached, so unchanged generators become cache hits
  on every host.
* remote clang steps on macOS hosts get a 10 minute client-side deadline
  instead of 2 minutes, so ordinary RBE queueing no longer triggers the
  5-10 minute local ThinLTO fallback compiles that land on the critical
  path (75 in one release build, 570 in a testing build). Local fallback
  stays as the safety net.

(cherry picked from commit d36eebf)

---------

Co-authored-by: David Sanders <[email protected]>
Co-authored-by: Samuel Attard <[email protected]>
@trop trop Bot removed the in-flight/43-x-y label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

45-x-y merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants