Repository navigation
build: only run gn-typescript-definitions for default toolchain - #52122
Conversation
| # and once in $target_gen_dir | ||
| # The one in $target_gen_dir is used for the actual TSC build later one | ||
| # and the one in //electron/electron.d.ts is used by your IDE (vscode) | ||
| # for typescript prompting |
There was a problem hiding this comment.
I think it would be awesome to keep this comment. Looking at the new comment, I'd have no idea why we have two copies of the file.
There was a problem hiding this comment.
The comment is categorically wrong. 😅 It was maybe true at one point in time, but "The one in $target_gen_dir is used for the actual TSC build later" is wrong and misleading.
I'd have no idea why we have two copies of the file.
There's not really a succinct answer, it's a mess of historical implementation and GN fun. Actions in GN must have an output for state tracking, but the way our builds work these days those files aren't actually used, the identical content in //electron/electron.d.ts is used. 🤷
I played with doing a larger refactor here to make it fit better into how GN wants things to work, but gave up and went with this more surgical fix.
|
No Release Notes |
|
I have automatically backported this PR to "41-x-y", please check out #52163 |
|
I have automatically backported this PR to "42-x-y", please check out #52164 |
|
I have automatically backported this PR to "43-x-y", please check out #52165 |
Description of Change
When cross-compiling, we can end up with two concurrent invocations of the
build_electron_definitionsGN 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.tsas the other concurrent invocation writes to disk, causing the TS compilation to fail. This was observed in thislinux-arm64CI job.$target_gen_dir/tsc/typings/electron.d.tsisn't actually used for anything, the TS compilation uses//electron/electron.d.tsas 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