-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Built-in SSH transport #1246
Comments
@Byron libssh2 is what libgit2 uses, so I'd expect it to be sufficiently mature. ssh2 appears to just be bindings to libssh2. So it seems like the choice is between libssh2 (mature and used elsewhere) or russh (pure Rust). |
Maybe gitoxide can add new features for:
so that cargo can always use libssh2 as dylib, while other who want to avoid dynamic dep on external C lib can either use external ssh cmd or use russh? |
Thanks @joshtriplett for pointing that out - the issue has been updated for correctness, and I agree about the choice, particularly if it's true that
There could definitely be multiple implementations, even though I don't know how much effort it is to integrate them correctly (usually, how much configuration |
I think the libssh2 is definitely the easier one to implement given that cargo also uses it. russh might be missing some configuration/support for some ciphers, though I think it would still be great to add support for it, I'm hoping for a mature ssh implementation in (pure) Rust.
I agree, though AFAIK Windows also provides ssh from a certain windows 10 version. I would definitely want them to be gated behind feature flags since for cargo-binstall I might choose to use external ssh cmd only. |
russh On the plus side, there's BTW, one thing I always desire is the support of async in high-level API, so that:
I understand why it is structured as is, because using async can be painful, its future size returned might be huge and IIRC compiler can't return huge future without copying yet (there's some missed optimization opportunities) and async-trait is still not supported very well, plus using async would immediately cause all high-level API to switch to async. And most of the operation is synchronous for now (filesystem operations) and it's only fetching that uses network operations. Though in the future - with the io-uring being adopted by runtime, it would also help reducing I/O for gitoxide, especially if the repository is large. Tokio is already working on it in crate |
Hey folks, I think |
That's good news! it's time to start adopting russh in gitoxide once 0.44 comes out. |
I just noticed that russh 0.44.0 has been released today. |
Summary 💡
A built-in transport that allows to manually configure an SSH connection without the need for the
ssh
program.Candidates for the
ssh
part are:russh
- Rustssh-agent
, which makes it something I'd seriously look atssh2
- Rust bindings tolibssh2
libssh2
- C librarylibgit2
libssh
libssh
- C librarylibssh2
, but has undesirable licenseMotivation 🔦
Cargo should be standalone, and right now it needs the
ssh
-program to clonessh://
URLs. Even though this is beneficial on Linux, it's usually not very portable and often won't work at all on Windows.git2
hasssh
support built-in usinglibssh
which works, but has a less desirable license thanlibssh2
.References
enum
git2
ssh configuration options, which is whatcargo
caters to and is implemented with.sync
(or async if needed) version of theTransport
traitssh
program, along with the the git-upload-pack invocationSuggestions
Requirement
The text was updated successfully, but these errors were encountered: