Repository navigation
CLI build: do not clean and rebuild the model it just built - #1371
Merged
Merged
Conversation
Main builds and typechecks the project model, then compileScript cleaned it and parsed and typechecked it again, which only makes sense for the language server, where the model may hold unsaved editor state. The CLI now skips that rebuild and still compiles a copy of the model.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Frotty
added a commit
to Code-Fixxers/WurstScript
that referenced
this pull request
Oct 6, 2026
… own CLI changes wurstscript#1371 skips the redundant model rebuild for CLI builds. The PR's earlier CLI changes (buildProject(false) in Main, QuickAndDirty in CliBuildMap, and the rebuild without typecheck in compileScript) are dropped: the first skipped the early typecheck and changed which error is reported first, the second skipped the model copy and changed the emitted Lua.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #1353.
Mainbuilds and typechecks the project model for-build, andMapRequest.compileScriptthen cleaned it and parsed and typechecked the whole project a second time ("it is safer to rebuild the project, instead of taking the current editor state"). That protects the language server from unsaved editor state; the CLI has none.CliBuildMapnow skips the clean and rebuild. It still compiles a copy of the model and still typechecks early inMain, so an erroneous project fails exactly as before.Measured on wurst-castle-fight (Lua,
-inline -localOptimizations -runcompiletimefunctions -injectobjects -noExtractMapScript -compiletimeCache, same machine, one build at a time, wholejava -jar ... -buildwall time):About 8 s (roughly 10%) per CLI build. The emitted Lua is byte-identical to master's.
Error behaviour: on a project with a code error, the output of
-buildis identical to master's (Fix errors in your code before building a release.plus the first error, exit code 2).Not done: a variant that also skipped the model copy (
QuickAndDirty) was faster still, but produced different Lua (the compile-time state init was inlined instead of split), so it is not used. A variant that skipped the early typecheck changed which error is reported first. No automated test exercises the CLI build path.