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

Can't find OpenSSL on Ubuntu, with cross #1368

Closed
Crell opened this issue Nov 6, 2020 · 3 comments
Closed

Can't find OpenSSL on Ubuntu, with cross #1368

Crell opened this issue Nov 6, 2020 · 3 comments

Comments

@Crell
Copy link

Crell commented Nov 6, 2020

I'm trying to build a (so far) toy-level project on (K)Ubuntu 20.04. The libssl-dev apt package is installed. My command:

cross run

Relevant output:

  run pkg_config fail: "`\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"` did not exit successfully: exit code: 1\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'openssl\' found\n"

  --- stderr
  thread 'main' panicked at '

  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = x86_64-unknown-linux-gnu
  openssl-sys = 0.9.58

  ', /cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.58/build/find_normal.rs:157:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Googling the error message suggested setting a PCK_CONFIG_PATH env var manually, like so:

PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/" cross run

But that gave the same error. I have confirmed that /usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc does exist.

cargo build does not give the same error. (I get a totally unrelated error in my own code, indicating it got through all of the dependencies successfully.)

@sfackler
Copy link
Owner

sfackler commented Nov 6, 2020

I'm not familiar with cross, but it seems like it may not be propagating environment variables through to cargo or something like that. You'd probably be best off asking them.

@Crell
Copy link
Author

Crell commented Nov 6, 2020

It's this thing: https://github.com/rust-embedded/cross

And a search there suggests it may be related to this:
cross-rs/cross#404

@sfackler
Copy link
Owner

sfackler commented Nov 6, 2020

Closing in favor of that issue.

@sfackler sfackler closed this as completed Nov 6, 2020
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