Skip to content

fix: gate Electron's extra Win SDK siso headers on target OS, not host#840

Merged
codebytere merged 1 commit intomainfrom
sam/win-sdk-headers-target-gate
Apr 8, 2026
Merged

fix: gate Electron's extra Win SDK siso headers on target OS, not host#840
codebytere merged 1 commit intomainfrom
sam/win-sdk-headers-target-gate

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

The mswsock.h / Lm.h additions to the win_toolchain :headers input set were guarded by if runtime.os == "windows". When cross-compiling Windows on a Linux host (target_os=win, host=linux), that block is skipped, so siso never uploads those headers to the RBE worker and libuv's win/tty.c (and friends) fail with 'mswsock.h' file not found.

Use win_sdk.enabled(ctx) instead, which checks target_os == "win" — the same predicate Chromium's own build/config/siso/win_sdk.star uses to populate :headers in the first place. Also guard on sdk_version and the :headers key actually being present so this is a no-op when the upstream config didn't set them up (e.g. before gn_logs.txt exists on a clean build).

Needed for electron/electron#50796 (Windows cross-compile on Linux), which currently carries an in-repo copy of this file and can drop it once this lands.

The mswsock.h / Lm.h additions to the win_toolchain :headers input set
were guarded by 'if runtime.os == "windows"'. When cross-compiling
Windows on a Linux host (target_os=win, host=linux), that block is
skipped, so siso never uploads those headers to the RBE worker and
libuv's win/tty.c (and friends) fail with 'mswsock.h not found'.

Use win_sdk.enabled(ctx) instead, which checks target_os == win — the
same predicate Chromium's own build/config/siso/win_sdk.star uses to
populate :headers in the first place. Also guard on sdk_version and the
:headers key actually being present so this is a no-op when the
upstream config didn't set them up (e.g. before gn_logs.txt exists).
@MarshallOfSound MarshallOfSound requested review from a team and ckerr as code owners April 8, 2026 04:19
MarshallOfSound added a commit to electron/electron that referenced this pull request Apr 8, 2026
…main.star

- windows-publish.yml: move all three publish jobs to the Linux runner +
  ghcr.io/electron/build container (matching build.yml). The publish
  segment was regenerated from -build.yml and now assumes a Linux host;
  leaving releases on Windows runners would have broken them.
- build-electron/action.yml: drop the Profile Windows Toolchain step.
  profile_toolchain.py reads installed_software.json (a Windows-host WMI
  dump that no longer exists); upload.py's consumer of the resulting
  windows_toolchain_profile.json is gated on sys.platform == 'win32' so
  it's skipped on the Linux host anyway.
- pipeline-segment-electron-{build,publish}.yml: drop the
  rm -rf vs_files* — the checkout cache doesn't include the toolchain,
  so this was a no-op. Keep the e d vs_toolchain.py update --force which
  actually fetches it.
- Drop build/siso/main.star + ELECTRON_BUILD_TOOLS_MAIN_STAR and bump
  BUILD_TOOLS_SHA to 03f1603 (electron/build-tools#840), which has the
  win_sdk.enabled() gate so the in-repo override is no longer needed.
@codebytere codebytere merged commit 9d38bef into main Apr 8, 2026
12 checks passed
@codebytere codebytere deleted the sam/win-sdk-headers-target-gate branch April 8, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants