frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

This library appears to not function well (from upstream use) if you use ssh instead of https #37

Open DarthHater opened 4 years ago

DarthHater commented 4 years ago

See: https://github.com/sunng87/cargo-release/issues/218#issuecomment-652660117

Essentially, I'm trying to use cargo-release to release a crate, and the first bits work. I am using:

OS X Catalina 10.15.4 git with ssh

git2 has issues using ssh instead of https, and as such an environment variable exists to tell cargo to use the git cli instead of git2, and a cargo setting, which can be seen here: https://github.com/rust-lang/cargo/issues/2078

The publish bit works from cargo-release, and I imagine that's because it's using cargo itself. In cargo-release, they call crates_index::Index like so:

https://github.com/sunng87/cargo-release/blob/master/src/cargo.rs#L68-L96

Essentially, it would be nice if this library can bypass using git2 as well, respecting that cargo setting, or something else akin, as it's making it difficult to use this library in a context where git uses ssh.

kornelski commented 4 years ago

Maybe the git2 crate could add a git CLI fallback? This is going to be a problem for all users of that crate.

DarthHater commented 4 years ago

@kornelski I'm not sure how they handled it in cargo, but I think what they did was create their own fallback. I don't imagine git2 would do that because it's more or less a wrapper of libgit2.

kornelski commented 4 years ago

git2 is used in 500 crates. That will require hundreds of crates to add the same workaround, instead of the one crate.

kornelski commented 4 years ago

https://github.com/rust-lang/git2-rs/issues/600

Byron commented 1 year ago

Apologies, this issue was auto-closed which wasn't actually my intention nor my doing even though GitHub claims it was 😅. Could you recheck to see if the issue is fixed with the latest version 2.0 or above? Thank you.