Skip to content

fix: persistent cache update issuer is updated modules#11633

Merged
jerrykingxyz merged 3 commits intomainfrom
jerry/issuer
Sep 11, 2025
Merged

fix: persistent cache update issuer is updated modules#11633
jerrykingxyz merged 3 commits intomainfrom
jerry/issuer

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Sep 10, 2025

Summary

The persistent cache will only save the module which has been rebuilt, and ignore the module which update issuer. The behaivor may cause issuer has cycle.

Here a example:

image

This PR will update the module which issuer has been updated.

let mut need_update_modules = built_modules.clone();
need_update_modules.extend(issuer_update_modules);

module_graph::save_module_graph(
  module_graph_partial,
  module_to_lazy_make,
  revoked_modules,
  &need_update_modules,
  &self.storage,
  &self.context,
);

Related links

Checklist

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

Copilot AI review requested due to automatic review settings September 10, 2025 11:53
@netlify
Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 58f8801
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68c16cb5038dde0008c46e72

@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 Sep 10, 2025
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 persistent cache update handling for modules with updated issuers. It adds tracking for modules whose issuer relationships have been modified during the fix_issuers process and ensures these modules are properly updated in the persistent cache.

  • Added issuer_update_modules field to track modules with modified issuer relationships
  • Updated test cases to validate issuer handling logic with improved error checking
  • Modified cache persistence to include issuer-updated modules in the update set

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/rspack_core/src/compilation/make/artifact.rs Added issuer_update_modules field to track modules with updated issuers
crates/rspack_core/src/compilation/make/graph_updater/cutout/fix_issuers.rs Added tracking of issuer updates and fixed helper reuse issue
crates/rspack_core/src/cache/persistent/occasion/make/mod.rs Updated cache persistence to include issuer-updated modules
tests/rspack-test/hotCases/make/clean-isolated-cycle/rspack.config.js Improved issuer validation logic with better error handling
tests/rspack-test/cacheCases/make/issuer-update/rspack.config.js New test case for validating issuer updates with persistent cache
tests/rspack-test/cacheCases/make/issuer-update/index.js Test implementation for issuer update scenarios
tests/rspack-test/cacheCases/make/issuer-update/file.js Test file with multiple states for issuer testing
tests/rspack-test/cacheCases/make/issuer-update/b.js Supporting test module
tests/rspack-test/cacheCases/make/issuer-update/a.js Supporting test module with state changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 58f8801 to feat: throw specified error to indicate undefined factory case in HMR (#11584) by pshu

🎉 Size decreased by 1.63KB from 47.23MB to 47.23MB (⬇️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 10, 2025

CodSpeed Performance Report

Merging #11633 will not alter performance

Comparing jerry/issuer (58f8801) with main (6aef3a3)

Summary

✅ 17 untouched benchmarks

@jerrykingxyz jerrykingxyz merged commit d005492 into main Sep 11, 2025
46 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/issuer branch September 11, 2025 04:54
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.

3 participants