Package Manager Pulls Release After Dependency Solver Loops on Version Ranges

Archi3 min read

open-sourcesoftwaredebugging

Contents
  1. The Solver That Wouldn't Stop
  2. Where the Loop Starts
  3. Why Common Ranges Trigger It
  4. The Fix and the Rollback
  5. Who Got Hit
  6. A Pattern, Not a One-Off

The Solver That Wouldn't Stop#

At 14:32 UTC on Tuesday, maintainers of a widely used open source package manager pulled version 4.7.0 from public mirrors. The reason: the release's new dependency resolver could enter an infinite loop when asked to satisfy certain version ranges, leaving build pipelines stuck for hours.

The bug report landed at 09:14 UTC. By 11:00, more than 300 duplicate issues had been filed. The common thread: projects with dependencies that allowed minor version updates (the caret range) and also pinned transitive dependencies to exact versions. The resolver would oscillate between two valid assignments, never converging.

Where the Loop Starts#

The resolver uses a backtracking algorithm. It picks a package version, checks its dependencies, and if a conflict arises, backtracks to try another version. In 4.7.0, the team introduced a new heuristic to cache partial solutions and speed up resolution.

The cache key was built from the set of packages already assigned. But the key omitted the order in which those assignments were made. Two different assignment histories could produce the same key, so the resolver would reuse a cached state that assumed a different set of constraints. It would then backtrack into the same conflict, recompute the same key, and hit the cache again. Infinite loop.

"It is a classic state-space problem," said one contributor who asked not to be named because they were not authorized to speak for the project. "The cache was supposed to prune the search tree. Instead it created a cycle."

Why Common Ranges Trigger It#

The loop requires a specific shape of dependency graph. A project must depend on package A with a range like ^2.3.0 (allowing any 2.x version at or above 2.3.0) and also depend on package B that pins A to an exact version, say 2.5.0. If another package C depends on A with a different range, the resolver has multiple valid choices.

In a correct backtracking resolver, the algorithm would try one assignment, hit a conflict, backtrack, and try another. With the faulty cache, it would return to a previously visited state without changing the assignment, and the loop would repeat.

Many real projects have this shape. Monorepos with shared internal packages, applications that pin transitive dependencies for security, and libraries that support multiple major versions of a peer dependency all produce such graphs. That is why the bug spread so fast.

The Fix and the Rollback#

The maintainers released 4.7.1 at 16:05 UTC. The patch removes the cache entirely. "We will revisit caching later with a correct key that includes the full assignment history," the release notes said. "For now, correctness beats speed."

Users who already upgraded to 4.7.0 were advised to downgrade to 4.6.3 or upgrade to 4.7.1. But downgrading is not always simple: 4.7.0 also changed the lockfile format, adding a new field for resolved URLs. Projects that committed a 4.7.0 lockfile had to regenerate it with the older version or edit it by hand.

Who Got Hit#

The outage was not uniform. Projects using only exact versions or simple ranges resolved fine. Projects with the problematic graph shape saw builds hang. CI providers reported a spike in jobs exceeding their timeouts, and several large open source projects temporarily disabled dependency updates to avoid the issue.

One maintainer of a popular JavaScript library said their CI ran for six hours before they killed it. "We thought it was a network problem," they said. "Then we saw the CPU pinned at 100 percent on the resolver step."

A Pattern, Not a One-Off#

Dependency resolvers are hard. They combine constraint satisfaction, graph search, and performance optimization. Every major package manager has had resolver bugs: npm, pip, Cargo, and others have all shipped releases that failed to resolve certain graphs or resolved them incorrectly.

The root cause here is a caching bug, but the deeper issue is that resolver changes are hard to test. The input space is enormous. Test suites cover common cases, but the long tail of dependency graphs is effectively infinite. The 4.7.0 release passed all tests. The bug only appeared in the wild.

For now, the project is asking users to report any remaining resolution failures with a minimal reproduction. The cache will return, but only after the team can prove it is safe. "We learned the hard way that a cache is a correctness feature, not a performance feature," the release notes said. "You cannot trade one for the other."

More articles