HARSH PRATAP SINGH

how package managers use PubGrub for Dependency Resolution

Table of Contents

There are all sorts of dependency resolution methods used by various package managers, but I am specifically writing on PubGrub as it’s used in uv package manager which I used to contribute to get some insights on how pro peps write Rust. In short, PubGrub is popular as :

You can go through it’s internals and better, listen to the awesome lightening talk by its creator at DartConf.

The thing that nudged me to write this is something about concurreny. The PubGrub algorithm is a tight synchronous loop with complex mutable state that doesn’t fit naturally into async/await (so cant be async as its sequential).

uv being clever

What’s clever is that uv completely decouples the synchronous solver from parallel I/O using a two-thread architecture with channels: