This repository has been archived by the owner on Dec 28, 2021. It is now read-only.
Fix build failing when executing run watch
on a clean build.
#1395
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.
Pull Request Description
Fix a concurrency issue between our different build tasks when running the
watch
command.For the
watch
command to work, we need to set up the language server, run it, execute the watch process of the JS build (which includes doing the initial build) and executing the watch process for our rust build (which includes doing the initial rust build). The old setup did((Build Language Server . Run Language Server. Watch Rust) | (Initialize JS Dependencies . Watch JS))
(CSS notation) but since setting up the language server requires the JS dependencies this meant interference of the build process. This was not a process in other commands as they never allowed running of these steps in parallel. Also, the timing between starting the watch process for JS and Rust is important because if they start in the wrong order the process ends up hanging and requires restarting.The new sequence is now
(Initialize JS Dependencies . Build Language Server . Run Language Server . Build Rust . Build JS . (Watch Rust | Watch JS))
, which adds more build time but starts up correctly.Important Notes
We should consider moving to a task-based build system (e.g., cargo make) that has better support for specifying task dependencies while avoiding the pitfalls of having to code the build in JS and makes setup more re-usable.
The correct way to do this efficiently would be to separate out the language server (and other build steps) as a pre-step to starting the watch processes. We could then independently do
(Build JS | Build Rust | Set Up Language Server) . Start Language Server . Start Backend . Start IDE
Checklist
Please include the following checklist in your PR:
CHANGELOG.md
was updated with the changes introduced in this PR.All code has automatic tests where possible.All code has been profiled where possible.in the IDE.All code has been manually tested in the "debug/interface" scene.