Repository navigation
Allow builds to skip source generation - #65004
Jake Bailey (jakebailey) wants to merge 3 commits into
Conversation
Avoid unnecessary generator work when building with existing generated sources.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the opt-in --skipGenerate change.
No open issues 🎉
What changed in this PR
Adds an opt-in --skipGenerate flag to reduce build preparation time for benchmarks by reusing existing generated sources. Source generation remains enabled by default.
Changes:
- Makes generation dependencies conditional for compiler, API, package, and release builds.
- Skips
runGenerate()during watch rebuilds when the flag is set. - Documents the flag in the compiler build task description.
| File | Description |
|---|---|
| Herebyfile.mjs | Adds --skipGenerate and applies it to build dependencies and watch-mode generation. |
Review effort: Balanced
Ryan Cavanaugh (RyanCavanaugh)
left a comment
There was a problem hiding this comment.
Reviewed at 9cd7adb. Source generation remains enabled by default; the opt-in consistently removes generation dependencies and skips watch regeneration without bypassing the actual build. Syntax checking and assertions against all five real task dependency lists passed for default and --skipGenerate; the compiler task also passed the negative-flag check. No blocking issue found.
|
I'm realizing that this also has to apply to |
CI builds can use the generated sources already checked in without running generators again. Keep an explicit override for workflows that need generation and local builds that want to skip it.
|
TypeScript Bot (@typescript-bot) perf test this faster just to double check |
|
Jake Bailey (@jakebailey) Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The benchmarker is now constantly regenerating when building, so now the prep phase takes a half hour. Add a flag so it can skip.
Defaults to
!isCI, so it's on locally but off in CI where we already do "code was generated" checks.