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

remove cargo dependency #1331

Open
3 tasks
MarcoIeni opened this issue Mar 9, 2024 · 0 comments
Open
3 tasks

remove cargo dependency #1331

MarcoIeni opened this issue Mar 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@MarcoIeni
Copy link
Owner

MarcoIeni commented Mar 9, 2024

Motivations

cargo increases the compile time of release-plz.
We only use it to download crates from the registries.

Solution

After reading this docs, I think we can implement the download of the crate by ourselves.

Example code doing this (not sure if they work with private registries):

Things to check:

  • can we re-use the cargo cache folder?

  • make sure it works with private registries: both sparse and git protocol

  • support authentication with cargo login. This is from cargo help login:

    For the default cargo:token credential provider, the token is saved in $CARGO_HOME/credentials.toml.
    CARGO_HOME defaults to .cargo in your home directory.
    
    If a registry has a credential-provider specified, it will be used.
    Otherwise, the providers from the config value registry.global-credential-providers will be attempted, starting from the end of the list.
    

Alternatives

It would be much better if cargo offered this out of the box. I.e. cargo download my-crate.
We could open an RFC to add this functionality to cargo.
However, this might take a lot of time until we see it implemented.

Note

I'm not an expert on this, so I'm happy to discuss this with somebody with more knowledge about cargo. Feel free to challenge me on this decision :)

@MarcoIeni MarcoIeni added the enhancement New feature or request label Mar 9, 2024
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

1 participant