为什么即使我的 Cargo.toml 中有 openssl 0.7.14,slice 0.4.4 也会尝试使用 openssl 0.9.12? [英] Why does solicit 0.4.4 attempt to use openssl 0.9.12 even though I have openssl 0.7.14 in my Cargo.toml?

查看:50
本文介绍了为什么即使我的 Cargo.toml 中有 openssl 0.7.14,slice 0.4.4 也会尝试使用 openssl 0.9.12?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的项目,使用 Solicit 示例通过 HTTPS 发出请求.我的 Cargo.toml 有:

I have a simple project using the Solicit example to make a request with HTTPS. My Cargo.toml has:

[package]
name = "test"
version = "0.1.0"
authors = ["einchear"]

[dependencies.openssl]
version = "0.7.14"
features = ["tlsv1_2", "npn"]

[dependencies.solicit]
version = "0.4.4"
features = ["tls"]

当我尝试运行 cargo build 时,错误是:

When I tried to run cargo build, the error is:

error: Package `openssl v0.9.12` does not have these features: `npn, tlsv1_2`

为什么是 0.9.12 而不是 0.7.14?

Why 0.9.12 instead 0.7.14?

推荐答案

Solicit 已经一年半没有发布新版本了 — 0.4.4 已于 2015-09-07 发布.0.4.3 版本(0.4.4 没有任何原因的 git 标签)需要任何版本的openssl,所以它只是引入了最新的版本.您的 Cargo.toml 中的内容并不重要,因为重要的是 Solicit 的依赖项.

Solicit hasn't released a new version in over a year and a half — 0.4.4 was released 2015-09-07. Version 0.4.3 (0.4.4 doesn't have a git tag for whatever reason) requires any version of openssl, so it's just pulling in the newest possible version. It doesn't matter what you have in your Cargo.toml because it's Solicit's dependencies that matters.

甚至不再可能使用 * 版本依赖将 crate 发布到 crates.io!

It's no longer even possible to publish a crate to crates.io with a * version dependency!

当前的 Solicit 主版本有 pin 0,这是仍然一个旧版本.

The current master version of Solicit has pinned to openssl 0.6, which is still an old version.

目前,Solicit 似乎不是一个积极开发的库.您可能希望研究替代解决方案或考虑提供补丁来更新依赖项.

At this point in time, it doesn't seem like Solicit is an actively developed library. You may wish to investigate alternative solutions or consider contributing patches to update the dependencies.

如果您不需要任何其他需要 OpenSSL 支持的 crate,您可以使用 Solicit 的 master 分支版本,而只需使用旧版本的 OpenSSL.

If you don't need to have any other crates that need OpenSSL support, you might be able to use the master branch version of Solicit and just use the older version of OpenSSL.

这篇关于为什么即使我的 Cargo.toml 中有 openssl 0.7.14,slice 0.4.4 也会尝试使用 openssl 0.9.12?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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