codebytere

#53815: build: fix the PGO profile runtime lookup in the remote wrapper instead of GN

Merged
Created: Sep 10, 2026, 3:49:37 AM
Merged: Sep 10, 2026, 10:38:45 AM
4 comments
Target: main

Description of Change

build_fix_profile_runtime_resolution_for_pgo_instrumented_builds.patch made -fprofile-generate builds suppress the compiler's automatic profile-runtime reference and link clang_rt.profile-<arch>.lib explicitly, because remotely compiled clang-cl objects embedded /DEFAULTLIB:clang_rt.profile.lib (the per-target name) while the clang package only ships the legacy lib/windows/clang_rt.profile-<arch>.lib. clang-cl picks the name by probing its own resource dir at compile time (crbug.com/335997052), so this only went wrong on remote workers that did not have the .lib next to the compiler.

On Electron's Windows (and macOS) hosts that alone is not enough: our siso config runs a Linux clang on the RBE worker through clang_remote_wrapper, and that wrapper links the host package's resource include/ next to the Linux binary but not lib/. siso does upload lib/windows/clang_rt.profile-*.lib from the host package (build/config/siso/clang_all.star, crbug.com/335997052), so the second commit adds a patches/reclient-configs change that links the resource lib/ directory the same way; clang-cl then finds the archive, embeds the legacy name, and the instrumented link works without touching GN. This is the "fix it in the remote inputs" route the upstream version of the GN patch (crrev.com/c/8363573) was steered toward, so that CL is not going to land. The wrapper is an action input, so this invalidates the remote cache once for wrapped clang steps on Windows and macOS hosts. The wrapper change is also up for EngFlow/reclient-configs as EngFlow/reclient-configs#18; once that lands we can bump engflow_reclient_configs_version and drop the patch.

Verification is the Windows leg of the Generate PGO Profiles workflow on this branch (instrumented phase-1 build on garm-windows-x64-32core for x64 and arm64), dispatched with Linux and macOS skipped and upload disabled. With only the first commit it failed at the first instrumented link with lld-link: error: could not open 'clang_rt.profile.lib' (https://github.com/electron/electron/actions/runs/34457274713); with the wrapper change both build-windows-x64 and build-windows-arm64 (and the profile collection after them) pass in https://github.com/electron/electron/actions/runs/34479719781. That run's Merge Profiles / pgo-done failures are only because Merge Profiles takes its container image from the skipped checkout-linux job.

Checklist

Release Notes

Notes: none

Backports

45-x-y
Merged
PR Number
#53820
Merged At
Sep 10, 2026, 11:54:36 AM
Released In
v45.0.0-alpha.6
Release Date
Sep 10, 2026, 3:00:16 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron