Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add selective syncing #106

Open
whatakey opened this issue Mar 31, 2023 · 5 comments
Open

Please add selective syncing #106

whatakey opened this issue Mar 31, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@whatakey
Copy link

Panamax is a great tool, but unfortunately it doesn't allow selective syncing. the last time I used it I got more than 105GB worth of crates (and that was few months ago) while I needed only few of them, this is extremely inefficient in this use case, it would be very nice to specify crates by name or something similar to tell the tool to only download/sync those.

I'm aware of #71 but that isn't an ideal solution because you have to run cargo vendor on all of your projects, and you need to make a new project if you want newer crates. it would be nice to have selective syncing baked into panamax natively.

Thank you.

@whatakey whatakey changed the title Please add selective crates sync Please add selective syncing Mar 31, 2023
@k3d3
Copy link
Member

k3d3 commented Mar 31, 2023

The big trouble with such a feature is, for any crate, you also have to discover and grab all of its dependencies. Having the user manually specify these dependencies wouldn't be a good UX, and otherwise every crate that gets downloaded would need to be extracted, read its Cargo.toml dependencies, and then recursively download them. Then you have to decide which versions of the dependent crates get downloaded; do you download them all, or just the current latest version (which might break on upgrades)?

The nice thing about using a vendor directory is that cargo effectively handles the above for you, at least to some extent.

With all that said, I'm definitely not against such a feature existing in Panamax, however I don't have the time to work on it. I'd probably accept a PR from someone willing to implement this.

@k3d3
Copy link
Member

k3d3 commented Mar 31, 2023

Additionally, this project https://github.com/wcampbell0x2a/zerus might be worth looking at.

@JohnEmhoff
Copy link

We were able to accomplish something similar (blacklisting) by cloning the crates.io index, filtering out what we didn't want, and then pointing panamax to that filtered index when syncing. The filter itself was fairly easy to write -- maybe 100 lines of rust. I'm not sure what your precise use case is but I hope that helps.

@AlexMikhalev
Copy link

potential answer: cargo vendor only to grab project-related dependencies.

@k3d3 k3d3 added the enhancement New feature or request label Jul 29, 2024
@dolson14
Copy link

dolson14 commented Jan 10, 2025

I have a thought on this.. is it feasible to essentially create a dummy project -- no code necessary -- where the only thing it does is declare dependencies? This would essentially act as a whitelist, would automatically take care of dependency trees, and make it so you only have to panamax sync my-mirror vendor against a single project to keep it up to date. User would simply update the dependencies with the crates used across their projects.

Haven't tried this yet, but I'm willing to give it a go.. but if there's an expert here who could comment, that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants