dsanders11

#52122: build: only run gn-typescript-definitions for default toolchain

Merged
Created: Jun 25, 2026, 2:41:53 AM
Merged: Jun 27, 2026, 4:46:56 PM
4 comments
Target: main

Description of Change

When cross-compiling, we can end up with two concurrent invocations of the build_electron_definitions GN action, both writing to //electron/electron.d.ts. If one wins the race and moves on to TypeScript compilation it may see a partially written //electron/electron.d.ts as the other concurrent invocation writes to disk, causing the TS compilation to fail. This was observed in this linux-arm64 CI job.

$target_gen_dir/tsc/typings/electron.d.ts isn't actually used for anything, the TS compilation uses //electron/electron.d.ts as seen by the CI job failure, and the contents of the file are architecture independent, so generate the content once for the default toolchain and any other toolchains can reference it there.

Checklist

Release Notes

Notes: none

Backports

41-x-y
In-flight
PR Number
#52163
Waiting to be merged
42-x-y
In-flight
PR Number
#52164
Waiting to be merged
43-x-y
In-flight
PR Number
#52165
Waiting to be merged

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