Skip to content

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Jan 6, 2026

Summary

Incremental rebuild at specified stages are disabled under the following conditions:

  1. Manually disabled by the user. In this case, rspack will not move the artifacts from the previous compiler during rebuild.

  2. 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.

if let Some(diagnostic) = compilation.incremental.disable_passes(

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 6, 2026 13:22
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Jan 6, 2026
@netlify
Copy link

netlify bot commented Jan 6, 2026

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 2994380
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/695d1eaf31b4860008768bbf

Copy link
Contributor

Copilot AI left a 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 825.4 KB 0
react-5k 2.7 MB 0
rome 984.3 KB 0
ui-components 2.1 MB 0

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 6, 2026

CodSpeed Performance Report

Merging #12643 will not alter performance

Comparing jerry/fix (2994380) with main (2ed1576)

Summary

✅ 16 untouched
⏩ 1 skipped1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📦 Binary Size-limit

Comparing 2994380 to chore: release v1.7.1 (#12638) by harpsealjs

❌ Size increased by 768bytes from 47.87MB to 47.87MB (⬆️0.00%)

@ahabhgk
Copy link
Contributor

ahabhgk commented Jan 7, 2026

@jerrykingxyz jerrykingxyz enabled auto-merge (squash) January 8, 2026 09:45
@jerrykingxyz jerrykingxyz merged commit 2feb455 into main Jan 8, 2026
126 of 133 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/fix branch January 8, 2026 09:45
LingyuCoder pushed a commit that referenced this pull request Jan 8, 2026
* fix: incremental rebuild bug

* add test case

* fix: ci
@github-actions github-actions bot mentioned this pull request Jan 8, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants