-
-
Notifications
You must be signed in to change notification settings - Fork 742
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
Ubuntu 18: failed to run custom build command for openssl-sys v0.9.39
#1021
Comments
might be same as #994 but too many comments there, can't find what will actually work 1.1.0g-2ubuntu4.1 |
What does the rest of the error message say? In particular, you need pkg-config installed. |
elease --- stderr Could not find directory of OpenSSL installation, and this Make sure you also have the development packages of openssl installed. If you're in a situation where you think the directory should be found
It looks like you're compiling on Linux and also targeting Linux. Currently this ', /home/forecast/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.39/build/main.rs:269:9 |
so how do I configure pkg-config |
Works now, ran |
Didn't help in my case. What helped was to get that openssl library sources and build it ourselves See the full list of commands here |
Thank you very much. from Korea. |
I'm using Ubuntu and the error message says:
So I installed it:
And it is working now. |
I fix this problem to add. Cargo.toml
|
That's what helped me (on several ubuntu systems) sudo apt install openssl1.0 libssl1.0.0 libssl1.0-dev
cargo clean
OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu"
OPENSSL_INCLUDE_DIR="/usr/include/openssl"
cargo build |
works for me, thanks |
Works for me, thanks |
thanks, |
For Googlers: On OpenSUSE (e.g. Tumbleweed) run |
Thank you so much!!! After literal hours of struggling, with no prior solution helping me (building a rust project within amazon linux) yours did the trick! |
encountering the same issue.. Does anyone know how to fix the same issue for the "windows " OS ? even if it is some development file then what is command for that please? |
HELP PS C:\Users\alan1\dougs-bin-example> cargo install cyberdrop-dl Caused by: Caused by: |
Im on windows btw );;; |
I recognized that operating on pure Windows wasn't very effective. I
leveraged Window's WSL (Window's Subsystem Linux). I downloaded everything
to the WSL Ubuntu environment and compiled it there. I still had VSCode.
There's a plugin called something like Remote Server which allows you to
access the directories and files in your WSL from your host WIndows
environment.
Try downloading and running the code in the Ubuntu WSL on Windows. I ran
into way less issues. You'll also have to run the linux/ubuntu equivalent
of the commands in there as well. But there's documentation for that.
Cordell
…On Fri, Dec 17, 2021 at 6:59 AM Borregopornz ***@***.***> wrote:
Im on windows btw );;;
—
Reply to this email directly, view it on GitHub
<#1021 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFAC7UVNFJTR4VP5E2PFE4LURMQ3FANCNFSM4GGFMJCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
I had to install
|
Nice it's work on ubuntu 20.04 WSL |
Awesome, Works really fine. Thank you for helping :) |
I'm on a fresh Ubuntu 22.04 LTS install and I'm still running into this issue. (As far as I can recall, my old machine, which had started with 18.04 and upgraded its way to 22.04 never ran into this issue.) The following packages are automatically included in 22.04 already:
If I
I'm not sure what more I could be missing in this case, given the error messages. |
Try uninstalling those packages and reinstalling them. Or maybe even an
just a sudo apt-get upgrade && sudo apt-get update -y. Then try again. I
believe I ran into issues once with one of the packages fighting to install
different versions of the same dependencies. But the commands mentioned
earlier should install everything you need. I hope this suggestion helps.
…On Thu, Jun 16, 2022 at 7:51 PM ghost-in-the-zsh ***@***.***> wrote:
I'm on a fresh Ubuntu 22.04 LTS install and I'm still running into this
issue. (As far as I can recall, my old machine, which had started with
18.04 and upgraded its way to 22.04 never ran into this issue.) The
following packages are automatically included in 22.04 already: pgk-config,
build-essential. I manually installed the libssl-dev package and also
tried with librust-openssl-dev, as suggested in a prior comment, but
there was no difference.
$ cargo build
Compiling openssl-sys v0.9.63
Compiling http-body v0.4.1
Compiling syn v1.0.89
Compiling tokio v1.5.0
Compiling proc-macro-error-attr v1.0.4
Compiling idna v0.2.3
Compiling num-integer v0.1.44
Compiling regex v1.5.3
The following warnings were emitted during compilation:
warning: build/expando.c:4:24: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
warning: 4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
warning: | ^~~~~~~~~~~~~
warning: build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
warning: 5 | #define VERSION(n, v) VERSION2(n, v)
warning: | ^~~~~~~~
warning: build/expando.c:10:1: note: in expansion of macro ‘VERSION’
warning: 10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
warning: | ^~~~~~~
error: failed to run custom build command for `openssl-sys v0.9.63`
Caused by:
process didn't exit successfully: <redacted-path> (exit status: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=OPENSSL_STATIC
cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=SYSROOT
cargo:rerun-if-env-changed=OPENSSL_STATIC
cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rustc-link-lib=ssl
cargo:rustc-link-lib=crypto
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=OPENSSL_STATIC
cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/usr/include" "-Wall" "-Wextra" "-E" "build/expando.c"
cargo:warning=build/expando.c:4:24: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
cargo:warning= 4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
cargo:warning= 5 | #define VERSION(n, v) VERSION2(n, v)
cargo:warning= | ^~~~~~~~
cargo:warning=build/expando.c:10:1: note: in expansion of macro ‘VERSION’
cargo:warning= 10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
cargo:warning= | ^~~~~~~
exit status: 1
--- stderr
thread 'main' panicked at '
Header expansion error:
Error { kind: ToolExecError, message: "Command \"cc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-g\" \"-fno-omit-frame-pointer\" \"-m64\" \"-I\" \"/usr/include\" \"-Wall\" \"-Wextra\" \"-E\" \"build/expando.c\" with args \"cc\" did not execute successfully (status code exit status: 1)." }
Failed to find OpenSSL development headers.
You can try fixing this setting the `OPENSSL_DIR` environment variable
pointing to your OpenSSL installation or installing OpenSSL headers package
specific to your distribution:
# On Ubuntu
sudo apt-get install libssl-dev
# On Arch Linux
sudo pacman -S openssl
# On Fedora
sudo dnf install openssl-devel
If I export OPENSSL_DIR=/usr/include/openssl, it just complains that
there's no lib sub-dir under that path:
error: failed to run custom build command for `openssl-sys v0.9.63`
Caused by:
process didn't exit successfully: `<redacted-path>` (exit status: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR = /usr/include/openssl
--- stderr
thread 'main' panicked at 'OpenSSL library directory does not exist: /usr/include/openssl/lib', <redacted-home>/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.63/build/main.rs:66:9
I'm not sure what more I could be missing in this case, given the error
messages.
—
Reply to this email directly, view it on GitHub
<#1021 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFAC7UVSDLSC3IGCQ72ZFYLVPO4WNANCNFSM4GGFMJCQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I gave it a try with |
I posted a solution for this issue here. |
thank you. this worked for me |
for Windows users follow this link: https://stackoverflow.com/questions/55912871/how-to-work-with-openssl-for-rust-within-a-windows-development-environment |
It fix my problem on WSL2 Ubuntu 20.04 LTS, Thanks. |
Thank you @WarSame it really helps |
I installed perl |
I've also made a script for installing Rust on Ubuntu. Here's the source
code for my script:
#!/bin/bashcurl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf |
shecho "Rust Installation is complete. Now installing a C Compiler
(gcc)"sudo apt install build-essential -ysudo apt-get install
manpages-devecho "Verifying gcc succesfully installed..."gcc
--versionecho "If text containing 'gcc' with OS and version numbers,
installation was successful!"echo "You must restart your terminal for
Rust installation to complete and take effect"sudo reboot -h nowecho
"In case you\'re working with WSL (Windows Subsystem Linux), a reboot
will not work. Will now exit the console. Start WSL back up after WSL
is exited"sleep 3exit
I believe I made it for Windows Subsystem Linux, but should also work
on a desktop version or even server version of Ubuntu
…On Thu, Jun 16, 2022 at 8:21 PM ghost-in-the-zsh ***@***.***> wrote:
I gave it a try with sudo apt remove -y pkg-config build-essential
libssl-dev:amd64 librust-openssl-sys-dev:amd64 && sudo apt install -y
pkg-config build-essential libssl-dev librust-openssl-sys-dev && sudo
apt-mark auto pkg-config build-essential, but it didn't work. (I also
tried unset OPENSSL_DIR afterwards, but no dice.)
—
Reply to this email directly, view it on GitHub
<#1021 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFAC7UULEP2CHLUXFSSJ4F3VPPAHHANCNFSM4GGFMJCQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Worked for me as well, thanks |
Worked for me, thanks |
in dockerfile,add this and work: # Install pkg-config to avoid error: "error: could not find native static library `openssl`" and OPENSSL_LIB_DIR , OPENSSL_INCLUDE_DIR , OPENSSL_DIR
RUN apt-get update \
&& apt-get install -y pkg-config \
&& apt install libssl-dev \
&& rm -rf /var/lib/apt/lists/* |
I Followed the indtruction above I have that again!?
In the
|
Thank you!! This worked for me |
How dit you do? Can you help.
The same to me @ghost-in-the-zsh did you fin the solution? |
when I compile rust prj, I changed the dependecy of requesturl, and it works.
|
I keep getting this error in my GitHub actions for building. https://github.com/bartvdbraak/keyweave/actions/runs/6766774148/job/18388342200#step:6:419
I was able to resolve this by adding this in my
|
I don't know how much people will read until this comment. But this answer helped me also with Ubuntu 22.04 |
installed libssl-dev on ubuntu 18 and still get this error:
error: failed to run custom build command for
openssl-sys v0.9.39
process didn't exit successfully:
/home/forecast/cs453_finalproj_backend/target/release/build/openssl-sys-864259d0b1f702fc/build-script-main
(exit code: 101)The text was updated successfully, but these errors were encountered: