-
Notifications
You must be signed in to change notification settings - Fork 148
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
0.2.16 causes build to fail on Debian/sid #174
Comments
The problem seems to be that libssh is built against libgcrypt instead of openssl, and the |
A |
Setting |
I'm hitting the same problem. The compilation of the ssh2 library depends upon what crypto libraries are found on the system. If you do not have libgcrypt20-dev installed when you build the ssh2 rust package, all is fine, but it breaks if you do, as it builds with the gcrypt functionality enabled. So the current setup is dependent upon the libraries present in the build environment, which is obviously really bad! (And it makes things break.) The configure script (which must be run somehow during compilation) has various options which might be useful here:
and all of these can be given in the form |
No, please don't do this! This assumes that the system has libgcrypt present, and it will break if it doesn't. Instead, this crate should explicitly state which crypto library to use and which ones not to use. (In my last comment, I realise that I don't yet understand how build.rs works. I'll get there!) |
A lot of rust crates have these special-snowflake envvars that you have to switch on for things to work. As a policy, for Debian rust crates we patch these envvars away, switching the behaviour to using pkg-config by default. @juliangilbey the reason your build was failing was because you were presumably not setting I do consider it a bug that these special-snowflake envvars exist in multiple crates with unpredictable names, but it's a question for the wider rust community to decide on, I don't have any control over that. |
Thanks @infinity0 - that's really helpful. It's not a great state of affairs, as you say. |
I finally got some time to sit and look at this issue and I'm a little confused! The build.rs will ask pkg-config about Otherwise it will set up a manual build; it doesn't use The most likely change in 0.2.16 that might have changed the build behavior is this PR: So, the question on my mind is: where is the gcrypt dependency coming from? These compilation errors make it appear to be coming from libssh2 itself, which is surprising given the above. My best guess here is that #170 causes the build to pick up the system libssh2 (if it is installed) due to the implicit library search path changes and that even though we think we're building the library we're linking in both the thing we built and the system one. I don't have a system where this fails so I'd appreciate a bit of additional info from those that have it reproducing: Do they all have the system libssh2 package installed? (dev as well as the shared object? or just the shared object?). And importantly: do any of them NOT have it installed? (that would help disprove my theory!). Does the system libssh2 link against gcrypt? |
Hi @wez, you may be on to something! In answer to your final question, on a Debian system:
I hope this is helpful! |
OK, I set up a system where I could reproduce this:
Patching cargo-update to point at a local copy of ssh2-rs so that could play around with build.rs I found that the problem is definitely this bit of code: which is triggering essentially this same problem as described here: The fundamental problem here is that the For now, I'm going to revert #170 and publish a new package. I believe that rust-lang/rust#69552 likely requires some changes in the crates upstream from this one. |
This caused fairly widespread problems and it seems that the original issue that led to this change (rust-lang/rust#69552) should really be fixed by better defining the data exported from eg: libz-sys rather than having downstream crates replicating the same logic from inside that crate. refs: #174 refs: #170 refs: #169 refs: rust-lang/rust#69552
I published 0.2.17 and confirmed that I can now build cargo-update on my test system. |
Thanks @wez! |
Forcing 0.2.15 as dependency makes it work again.
What happens is that at link-time, the following error (example:
cargo-outdated
) happens:Depending on the crate it's other symbols, but always something from
libgcrypt.so.20
. It seems like for some reason it got dropped from the linker commandline between 0.2.15 and 0.2.16.The text was updated successfully, but these errors were encountered: