#52122: build: only run gn-typescript-definitions for default toolchain
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
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
Release Notes
Notes: none
Backports
Semver Impact
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