-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: incremental rebuild no code generation entry panic #12643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a panic that occurs during incremental rebuilds when there is no code generation entry. The fix ensures that various compilation artifacts are properly cleared when incremental compilation is not active or when falling back to full rebuilds.
- Adds artifact clearing in non-incremental compilation paths to prevent stale data
- Adds a comprehensive test case for recovering from file deletion errors during watch mode
- Ensures consistency with existing artifact clearing patterns
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_core/src/compilation/mod.rs |
Adds artifact clearing for chunk_render_artifact, cgm_hash_artifact, code_generation_results, cgm_runtime_requirements_artifact, cgc_runtime_requirements_artifact, and chunk_hashes_artifact in the else branches of incremental compilation checks |
tests/rspack-test/watchCases/recover-from-error/delete-file/rspack.config.js |
Configuration for the delete-file watch test case enabling usedExports optimization |
tests/rspack-test/watchCases/recover-from-error/delete-file/0/index.js |
Initial test state checking that the file can be required and returns 'ok' |
tests/rspack-test/watchCases/recover-from-error/delete-file/0/file.js |
Initial file content that exports 'ok' |
tests/rspack-test/watchCases/recover-from-error/delete-file/1/file.js |
Invalid file content 'DELETE' to trigger an error |
tests/rspack-test/watchCases/recover-from-error/delete-file/1/errors.js |
Expected error assertion for module resolution failure |
tests/rspack-test/watchCases/recover-from-error/delete-file/1/warnings.js |
Expected warning assertion for FlagDependencyUsagePlugin |
tests/rspack-test/watchCases/recover-from-error/delete-file/2/file.js |
Restored valid file content to verify recovery |
tests/rspack-test/watchCases/recover-from-error/delete-file/2/warnings.js |
Expected warning assertion for FlagDependencyUsagePlugin after recovery |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
CodSpeed Performance ReportMerging #12643 will not alter performanceComparing Summary
Footnotes
|
📦 Binary Size-limit
❌ Size increased by 768bytes from 47.87MB to 47.87MB (⬆️0.00%) |
|
I guess after revert this https://github.com/web-infra-dev/rspack/pull/12576/changes#diff-c43afdae69552b813a5f3557b972a46f3a40199f1abfc16ba0c5ace27af6618fR498, the test will work as expected |
* fix: incremental rebuild bug * add test case * fix: ci
Summary
Incremental rebuild at specified stages are disabled under the following conditions:
Manually disabled by the user. In this case, rspack will not move the artifacts from the previous compiler during rebuild.
Some plugins disable incremental builds at certain stages. For example, FlagDependencyUsagePlugin disables incremental builds for MODULES_HASHES. In this case, rspack will perform a full build based on the artifacts from the previous build, resulting in some content being retained and causing bugs. Please refer to the test cases for details.
rspack/crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs
Line 498 in 2ed1576
Related links
Checklist