为什么 rust crate openssl-sys 不编译? [英] Why doesn't the rust crate openssl-sys compile?

查看:209
本文介绍了为什么 rust crate openssl-sys 不编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚为我的 Rust 项目添加了一个外部板条箱:

[依赖项]饲料=2.0"

这个 crate 有几个依赖项,特别是 openssl-sys v0.9.10.当我尝试构建我的项目时,这个失败了:

$ cargo build编译 unicode-normalization v0.1.4编译 openssl-probe v0.1.0编译匹配 v0.1.4编译日志 v0.3.7编译unicode-bidi v0.2.5编译 libc v0.2.21编译 quick-xml v0.4.2编译 pkg-config v0.3.9编译 rss v0.4.0编译 idna v0.1.1编译时间 v0.1.36编译 num-traits v0.1.37编译 gcc v0.3.45编译 num-integer v0.1.34编译网址 v1.4.0编译 num-iter v0.1.33编译 num v0.1.37编译chrono v0.3.0编译 openssl-sys v0.9.10编译 libz-sys v1.0.13错误:无法为openssl-sys v0.9.10"运行自定义构建命令进程没有成功退出:`/home/E3news/flux/target/debug/build/openssl-sys-223aa532c32a251f/build-script-build`(退出代码:101)--- 标准错误线程 'main' 在一个 `Err` 值上的 `Result::unwrap()` 处恐慌:无法运行 `\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"`: 没有那个文件或目录(操作系统错误 2)"',/buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:868注意:使用 `RUST_BACKTRACE=1` 运行以进行回溯.构建失败,等待其他作业完成...错误:构建失败

我使用的是 Debian 8.7,我使用 Rust 1.16.我尝试通过在我的操作系统上安装 libssl-dev 进行修复,但它没有解决问题.

有什么想法吗?

解决方案

来自评论:

<块引用>

你安装了 pkg-configopenssl 吗?

<小时><块引用>

是的,它有效!openssl 已经安装但没有安装 pkg-config.所以:

$ apt install pkg-config$货干净$货物建造

解决了我的问题.谢谢@kennytm!

I've just added an external crate to my Rust project:

[dependencies]
feed = "2.0"

This crate has several dependencies, notably openssl-sys v0.9.10. This one failed when I'm trying to build my project:

$ cargo build 
Compiling unicode-normalization v0.1.4
Compiling openssl-probe v0.1.0
Compiling matches v0.1.4
Compiling log v0.3.7
Compiling unicode-bidi v0.2.5
Compiling libc v0.2.21
Compiling quick-xml v0.4.2
Compiling pkg-config v0.3.9
Compiling rss v0.4.0
Compiling idna v0.1.1
Compiling time v0.1.36
Compiling num-traits v0.1.37
Compiling gcc v0.3.45
Compiling num-integer v0.1.34
Compiling url v1.4.0
Compiling num-iter v0.1.33
Compiling num v0.1.37
Compiling chrono v0.3.0
Compiling openssl-sys v0.9.10
Compiling libz-sys v1.0.13
error: failed to run custom build command for `openssl-sys v0.9.10`
process didn't exit successfully: 
`/home/E3news/flux/target/debug/build/openssl-sys-223aa532c32a251f/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Failed to run `\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"`: No such file or directory (os error 2)"', /buildslave/rust-
buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:868
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Build failed, waiting for other jobs to finish...
error: build failed

I'm on a Debian 8.7 and I use Rust 1.16. I tried a fix by installing libssl-dev on my OS but it doesn't fix the issue.

Any idea?

解决方案

From the comments:

Have you installed pkg-config and openssl?


Yes it works! openssl was already installed but not pkg-config. So:

$ apt install pkg-config
$ cargo clean 
$ cargo build

solved my problem. Thank you @kennytm!

这篇关于为什么 rust crate openssl-sys 不编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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