panamax icon indicating copy to clipboard operation
panamax copied to clipboard

Download only specific crates

Open elenakrittik opened this issue 2 years ago • 2 comments

Is it possible to download only speciefic crates, e.g., panamax sync my-mirror --crates="serenity,rand,songbird"?

elenakrittik avatar Apr 10 '22 11:04 elenakrittik

Unfortunately it's not currently possible to only download specific crates. It would be pretty cool to have Panamax support this in the future, however doing so would be a pretty big feature, due to Panamax needing to implement two things:

  1. The ability to reach into an existing crate archive file's Cargo.toml to grab all of its dependencies recursively, and

  2. The ability to serve a crates.io-index repository that does not match with the upstream repository, in order to match up with only the crates on the mirror.

Between the large effort required to implement it, and the fact that it's not something I personally need, I don't believe I'll be getting around to implementing this functionality any time soon sadly.

At the same time though, this is an interesting feature and I'd be open to PRs for it.

k3d3 avatar Apr 10 '22 15:04 k3d3

@k3d3 As a first step, it could be good to download only crates passed as arguments by user and not their dependencies? Because such a feature would put basic logic for this feature, but also to correct #64.

ricked-twice avatar May 17 '22 16:05 ricked-twice

This should be solved with the new feature added in #71.

k3d3 avatar Feb 04 '23 01:02 k3d3