同时使用git2和hyper:openssl链接不止一次 [英] Using both git2 and hyper: openssl linked more than once

查看:88
本文介绍了同时使用git2和hyper:openssl链接不止一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建同时使用hyper和git2的东西.现在,openssl链接了两次,我遇到了问题. shepmaster 的提示将我带到了货运features,我尝试过,但仍然被卡住.

I'm trying to build something which is using both hyper and git2 at the same time. Now I've got a problem with openssl being linked twice. A tip by shepmaster lead me to Cargos features and I tried that but I'm still stuck.

我在cargo build上遇到的确切错误如下:

The precise error I'm getting upon cargo build is the following:

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.1

据我所知,git2和hyper都需要openssl.有人知道我在做什么错吗?由于我禁用了hyper的默认功能(为了更好地使用了cookie),openssl不再需要它了.我浏览了锁定文件,以查看是否openssl是其他任何内容所必需的,但我找不到任何内容.但是我仍然得到错误.不幸的是,货物并没有告诉我依赖来自何方.

As far as I can tell openssl is required both by git2 and hyper. Does anyone have any idea what I'm doing wrong? Since I disabled the default features for hyper (and cookie for good measure) openssl should not be required by it anymore. I've looked through the lock file to see if openssl is required by anything else but I couldn't find anything. But I still get the error. Unfortunately cargo doesn't tell me where the dependency comes from.

这是我的Cargo.toml的依存关系部分和锁定文件:

Here's my Cargo.toml's dependency section and the lock file:

[dependencies]
openssl = "0.9.1"
hoedown = "5.0.0"
iron = "0.4.0"
webbrowser = "0.1.3"
router = "0.4.0"
staticfile = "0.3.1"
clap = "2.18.0"
lazy_static = "0.2.2"
linked-hash-map = "0.3.0"
params = "0.5.0"
git2 = "0.6.1"

[dependencies.yaml-rust]
version = "0.3.4"
features = ["preserve_order"]

[dependencies.hyper]
version = "0.9.12"
default-features = false

[dependencies.cookie]
version = "0.2.5"
default-features = false

如果有兴趣,这里是 Cargo.lock .

推荐答案

问题是params和openssl的组合:

The problem is the combination of params and openssl:

[dependencies]
openssl = "0.9.1"
params = "0.5.0"

参数0.5 需要0.8的整数部分,具有功能server,但没有 default-features = false:

params 0.5 requires multipart 0.8, with features server, but without default-features = false:

[dependencies.multipart]
features = ["server"]
version = "0.8"

这意味着 multipart 0.8 也将需要

That means multipart 0.8 will also require hyper 0.9. And hyper (using the default features) requires openssl 0.7.

hyper中有一个 ticket 可以切换到较新的openssl版本.

There is a ticket in hyper to switch to a newer openssl version.

这篇关于同时使用git2和hyper:openssl链接不止一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆