feat: add rspack_tools to compare .cache from different os#12499
feat: add rspack_tools to compare .cache from different os#12499jerrykingxyz merged 7 commits intomainfrom
Conversation
✅ Deploy Preview for rspack canceled.
|
1b56788 to
6dfa75b
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces the rspack_kit crate, a comprehensive toolkit for debugging and testing rspack internals, with initial focus on comparing cache directories across different operating systems to validate portable cache functionality. The implementation adds a CLI tool and library for deep comparison of cache structures, module graphs, dependencies, and metadata.
- Adds new
rspack_kitcrate with CLI and library interfaces for cache comparison - Implements
scopes()method in Storage trait to enumerate all available cache scopes - Modifies CI workflows to generate and compare caches between Linux and Windows builds
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_kit/src/main.rs | CLI entry point with clap-based command parsing for compare command |
| crates/rspack_kit/src/lib.rs | Library exports for public API |
| crates/rspack_kit/src/compare/mod.rs | Core comparison logic for storage directories and scopes |
| crates/rspack_kit/src/compare/snapshot.rs | Snapshot scope comparison implementation |
| crates/rspack_kit/src/compare/build_dependencies.rs | Build dependencies scope comparison implementation |
| crates/rspack_kit/src/compare/occasion/meta.rs | Meta occasion scope comparison implementation |
| crates/rspack_kit/src/compare/occasion/make.rs | Make occasion scope comparison with DependencyId mapping |
| crates/rspack_kit/src/compare/occasion/mod.rs | Occasion module exports |
| crates/rspack_kit/src/utils.rs | Utility functions for iterator comparison |
| crates/rspack_kit/src/debug_info.rs | Hierarchical debug context tracking |
| crates/rspack_kit/README.md | Comprehensive documentation with usage examples |
| crates/rspack_kit/Cargo.toml | Package configuration and dependencies |
| crates/rspack_kit/LICENSE | MIT license for the new crate |
| crates/rspack_storage/src/lib.rs | Adds scopes() method to Storage trait |
| crates/rspack_storage/src/pack/mod.rs | Implements scopes() for PackStorage |
| crates/rspack_storage/src/pack/manager/mod.rs | Implements scopes() in ScopeManager with tests |
| crates/rspack_core/src/cache/persistent/storage/memory.rs | Implements scopes() for MemoryStorage |
| crates/rspack_core/src/cache/persistent/snapshot/strategy/mod.rs | Custom PartialEq for Strategy to support cross-platform comparison |
| crates/rspack_core/src/cache/persistent/snapshot/mod.rs | Exports Strategy and SCOPE constant publicly |
| crates/rspack_core/src/cache/persistent/occasion/mod.rs | Makes make and meta modules public |
| crates/rspack_core/src/cache/persistent/occasion/meta/mod.rs | Exports SCOPE constant publicly |
| crates/rspack_core/src/cache/persistent/occasion/make/mod.rs | Exports SCOPE constant publicly |
| crates/rspack_core/src/cache/persistent/occasion/make/module_graph.rs | Exports SCOPE constant publicly |
| crates/rspack_core/src/cache/persistent/mod.rs | Exports public modules and simplifies CacheableContext |
| crates/rspack_core/src/cache/persistent/cacheable_context.rs | Simplifies CacheableContext to empty struct |
| crates/rspack_core/src/cache/persistent/build_dependencies/mod.rs | Exports SCOPE constant publicly |
| .github/workflows/reusable-build-test.yml | Adds cache generation and upload steps for Node 20 |
| .github/workflows/ci.yml | Adds check-cache job to compare Linux and Windows caches |
| Cargo.lock | Adds rspack_kit package entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 romePath:
📦 Download Diff Report: rome Bundle Diff Generated by Rsdoctor GitHub Action |
CodSpeed Performance ReportMerging #12499 will not alter performanceComparing Summary
Footnotes
|
📦 Binary Size-limit
❌ Size increased by 3.63KB from 47.87MB to 47.87MB (⬆️0.01%) |
efc08b8 to
e14dcb3
Compare
e14dcb3 to
592bec3
Compare
592bec3 to
63bef96
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
83c715d to
f3b5ba2
Compare
|
workflow parts, LGTM |
Summary
Create a new crate
rspack_toolsand addcomparecommand to compare .cache directory generated by different os.Relevant RFC: #12218
Related links
Checklist