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

Issues caused by unexpected semver version handling #25

Closed
mhristache opened this issue Nov 21, 2015 · 3 comments
Closed

Issues caused by unexpected semver version handling #25

mhristache opened this issue Nov 21, 2015 · 3 comments

Comments

@mhristache
Copy link

Hi

I have a crate which depends on both ssh2 and hyper. Hyper is using openssl-sys 0.6.7 but ssh2-rs is using libssh2-sys which moved to openssl-sys 0.7.0 recently, without changing the MINOR version. This creates issues:

$ cargo build
native library `openssl` is being linked to by more than one package, and can only be linked to by one package

  openssl-sys v0.6.7
  openssl-sys v0.7.0

The workaround is to explicitly specify libssh2-sys older version in Cargo.toml, which is strange as I am only directly using ssh2-rs so I should not care about its dependencies:

[dependencies]
ssh2 = "0.2.9"
libssh2-sys = "=0.1.31"

I think openssh2-sys should increase the minor version when any of its dependencies is bumped with a new minor version. Then ssh2-rs should also raise the minor version accordingly when moving to the new libssh2-sys.That should make it possible for the user to control everything by specifying the ssh2-rs version only. I guess this is a lot of work as rust tends to favour many small crates but I think it is the right approach. Might also be a good idea if cratos.io force this kind of behaviour.

@alexcrichton
Copy link
Owner

I've just pushed a version which is compatible with both openssl-sys versions, which should hopefully help alleviate this!

@mhristache
Copy link
Author

Hi

Thanks, but it doesn't seem to help, it is still downloading openssl-sys 0.7.0:

$ cargo update
    Updating registry `https://github.com/rust-lang/crates.io-index`
      Adding libc v0.2.2
    Updating libssh2-sys v0.1.31 -> v0.1.34
    Updating libz-sys v0.1.9 -> v1.0.0
    Updating openssl-sys v0.6.7 -> v0.7.0
      Adding ws2_32-sys v0.2.1

I think you need to change the libssh2-sys and ssh2-rs minor versions to fix this properly (as suggested in the initial description).

@alexcrichton
Copy link
Owner

Ah yes that's an instance of rust-lang/cargo#2064, where you'll have to manually bring the version of openssl-sys back to 0.6.7 via cargo update -p openssl-sys:0.7.0 --precise 0.6.7 to get the lockfile you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants