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
libgit2: Add support for OpenSSH instead of libssh2 #1031
base: master
Are you sure you want to change the base?
Conversation
Hmm, let me try to see if I can figure out why the tests are failing... |
43cad8d
to
e38111c
Compare
b8411c4
to
a0235c5
Compare
One issue I've noticed with this is when linking against a system library it doesn't detect whether it was compiled with openssh enabled, so the feature only really works when forcing the vendored library. (EDIT: Well, also it shouldn't be allowing the system library since it's only 1.7.2, the 1.8.0 bump needs to update the |
I can update the version range detected, but I'm not too sure how to proceed with detecting which version of the SSH backend libgit2 was compiled with, would appreciate some guidance on that. |
…ialized properly
This commit changes the original `ssh` feature into two new ones: `ssh-libssh2` and `ssh-openssh`. By default, the `ssh-libssh2` feature is enabled for backwards compatibility. To use OpenSSH instead, the following listing in `Cargo.toml` can be used: git2-rs = { version = "...", default-features = false, features = ["https", "ssh-openssh"] }
// HACK: `libgit2` uses C bitfields, which do not have a guaranteed memory layout. | ||
// Reversing the bits ensures that the bitfields are set whether the bits are laid out | ||
// from left to right or right to left, but will not work on other memory layouts. | ||
update_flags: (self.update_flags.bits() | self.update_flags.bits().reverse_bits()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you check whether this will make the reverse overlap with another meaningful bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of meaningful bits is currently 2, so there will be no overlay (2 at each end, with 4 bits in the middle unused for the 8 bits of an unsigned int). However, this might be an issue if more bits in the flag are used.
This PR changes the original
ssh
feature into two new ones:ssh-libssh2
andssh-openssh
. By default, thessh-libssh2
feature is enabled for backwards compatibility.To use OpenSSH instead, the following listing in
Cargo.toml
can be used:This PR is stacked on top of #1032.
Closes #1028.