websockets-rs / rust-websocket

A WebSocket (RFC6455) library written in Rust
http://websockets-rs.github.io/rust-websocket/
MIT License
1.55k stars 223 forks source link

Update Openssl? #95

Closed MTRNord closed 7 years ago

MTRNord commented 7 years ago

Because of the outdated Openssl I get

error: native library `openssl` is being linked to by more than one version of the same package, but it can only be linked once; try updating or pinning your dependencies to ensure that this package only shows up once

  openssl-sys v0.9.6
  openssl-sys v0.7.17

with other crates I want to use. Is that planned or possible?

pyrossh commented 7 years ago

Yep Please do .. Problem with hyper and mongo again..

therustmonk commented 7 years ago

Keep waiting the same...

But there is a workaround for Cargo.toml:

[dependencies]
websocket = { git = "https://github.com/asayers/rust-websocket", branch = "openssl-0.9" }

or more global patching:

[replace]
"websocket:0.17.1" = { git = "https://github.com/asayers/rust-websocket", branch = "openssl-0.9" }
MTRNord commented 7 years ago

@DenisKolodin that fix did not work for me :/

MTRNord commented 7 years ago

Error is still

error: native library `openssl` is being linked to by more than one version of the same package, but it can only be linked once; try updating or pinning your dependencies to ensure that this package only shows up once

  openssl-sys v0.7.17
  openssl-sys v0.9.8

(yep versions of the second changed)

therustmonk commented 7 years ago

Could you show your Cargo.toml? Have you tried replace?

MTRNord commented 7 years ago

@DenisKolodin Thats my current Cargo.toml: https://github.com/Nordgedanken/TG_sync-rs/blob/master/Cargo.toml

therustmonk commented 7 years ago

Bad news, slack uses the old hyper directly. That's why crate still uses openssl v0.7.14:

tg_sync v0.1.0 (/TG_sync-rs)
├── futures v0.1.10
│   └── log v0.3.7
├── slack v0.16.0
│   ├── hyper v0.9.18
│   │   ├── cookie v0.2.5
│   │   │   ├── openssl v0.7.14

The Cargo.toml of slack:

[package]
name = "slack"
version = "0.16.0"
authors = ["Benjamin Elder <bentheelder@gmail.com>", "Matt Jones <mthjones@gmail.com>"]
repository = "https://github.com/slack-rs/slack-rs.git"
documentation = "http://slack-rs.github.io/slack-rs/slack/index.html"
description = "slack realtime messaging client: https://api.slack.com/bot-users"
license = "Apache-2.0"

[dependencies]
websocket = "0.17.1"
hyper = "0.9.5"
rustc-serialize = "0.3.18"
slack_api = "0.15.0"

It looks reasonable to switch to https://github.com/servo/rust-websocket and wait till slack switched too.

therustmonk commented 7 years ago

servo-websocket is not an alternative for me, because server has removed (

MTRNord commented 7 years ago

Hm ok :/

MTRNord commented 7 years ago

@DenisKolodin would it theoretically possible to fork slack-rs and replace the hyper version to a newer one? (I only ask because I never used replace before)

therustmonk commented 7 years ago

It's possible, but deeper. reqwest updated to 0.9 and in crates slack-api updated to 0.9, but not in crates slack not updated to 0.9

I've tried to use patched slack:

[package]
name = "slack"
version = "0.16.0"
authors = ["Benjamin Elder <bentheelder@gmail.com>", "Matt Jones <mthjones@gmail.com>"]
repository = "https://github.com/slack-rs/slack-rs.git"
documentation = "http://slack-rs.github.io/slack-rs/slack/index.html"
description = "slack realtime messaging client: https://api.slack.com/bot-users"
license = "Apache-2.0"

[dependencies]
websocket = { git = "https://github.com/asayers/rust-websocket", branch = "openssl-0.9" }
hyper = "0.10.5"
rustc-serialize = "0.3.18"
slack_api = { git = "https://github.com/slack-rs/slack-rs-api" }

but it doesn't work, because slack-api has other API. Update of slack to openssl-0.9 is coming. It's simpler to watch and wait.

MTRNord commented 7 years ago

yes I am trying to and I am waiting since about 2months so I will try to fix that on my own now :)

MTRNord commented 7 years ago

A lot of dependency reworking and forking it seems to at least is build now :D @DenisKolodin thanks for the help :) saved my day :D

MTRNord commented 7 years ago

I will leave this issue open until this crate gets an official update :)

illegalprime commented 7 years ago

@MTRNord sorry for the wait, the issue with updating openssl is that is breaks the crate. I am currently doing a great deal of rewriting to get rid of how hardcoded openssl is, and in the future it will be optional. Progress is on #80

illegalprime commented 7 years ago

@MTRNord @DenisKolodin @pyros2097 this is now fixed! plus most of the changes described in #58