Skip to content

fix: dead loop of circular dependency plugin#10212

Merged
fireairforce merged 3 commits intomainfrom
fix/circular-dependency-deadlock
Apr 27, 2025
Merged

fix: dead loop of circular dependency plugin#10212
fireairforce merged 3 commits intomainfrom
fix/circular-dependency-deadlock

Conversation

@LingyuCoder
Copy link
Contributor

Summary

fix #10208

Checklist

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

@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 Apr 27, 2025
@netlify
Copy link

netlify bot commented Apr 27, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 76fad4b
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/680e10e350488200082dd378

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 dead loop issue in the circular dependency plugin by revising how dependency relations are tracked.

  • Replaces IdentifierSet with rustc_hash::FxHashSet for tracking dependency relations.
  • Introduces an edge-check with seen_relations in the recursive dependency traversal.
  • Updates Cargo.toml to include the rustc-hash dependency.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/rspack_plugin_circular_dependencies/src/lib.rs Refactored cyclical dependency detection by replacing IdentifierSet with a HashSet and adding edge-based filtering in the recursion.
crates/rspack_plugin_circular_dependencies/Cargo.toml Added dependency for rustc-hash to support the new HashSet usage.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 27, 2025

CodSpeed Performance Report

Merging #10212 will not alter performance

Comparing fix/circular-dependency-deadlock (76fad4b) with main (d71a6ab)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

@fireairforce fireairforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fireairforce fireairforce merged commit 44d5dd3 into main Apr 27, 2025
34 checks passed
@fireairforce fireairforce deleted the fix/circular-dependency-deadlock branch April 27, 2025 15:02
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.

[Bug]: Since version 1.3.7, the CircularDependencyRspackPlugin has started to get stuck

3 participants