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

rust:1.51.0-alpine3.13: failed to run custom build command for openssl-sys v0.9.61 #1455

Closed
Dentrax opened this issue Apr 14, 2021 · 5 comments

Comments

@Dentrax
Copy link

Dentrax commented Apr 14, 2021

Similar to #1021, but still i could not figure it out why does not compile even I provide the required packages.

ERROR:

...
...
...
#14 140.9    Compiling regex v1.4.5
#14 142.1 error: failed to run custom build command for `openssl-sys v0.9.61`
#14 142.1
#14 142.1 Caused by:
#14 142.1   process didn't exit successfully: `/app/target/release/build/openssl-sys-bd53b7a229084839/build-script-main` (exit code: 101)
#14 142.1   --- stdout
#14 142.1   cargo:rustc-cfg=const_fn
#14 142.1   cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_NO_VENDOR
#14 142.1   X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_NO_VENDOR unset
#14 142.1   cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
#14 142.1   OPENSSL_NO_VENDOR unset
#14 142.1   CC_x86_64-unknown-linux-musl = None
#14 142.1   CC_x86_64_unknown_linux_musl = None
#14 142.1   HOST_CC = None
#14 142.1   CC = None
#14 142.1   CFLAGS_x86_64-unknown-linux-musl = None
#14 142.1   CFLAGS_x86_64_unknown_linux_musl = None
#14 142.1   HOST_CFLAGS = None
#14 142.1   CFLAGS = None
#14 142.1   CRATE_CC_NO_DEFAULTS = None
#14 142.1   DEBUG = Some("false")
#14 142.1   CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
#14 142.1   running "perl" "./Configure" "--prefix=/app/target/release/build/openssl-sys-576594f17d1161ae/out/openssl-build/install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-async" "linux-x86_64" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-DOPENSSL_NO_SECURE_MEMORY"
#14 142.1
#14 142.1   --- stderr
#14 142.1   thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/openssl-src-111.15.0+1.1.1k/src/lib.rs:469:39
#14 142.1   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#14 142.1 warning: build failed, waiting for other jobs to finish...
#14 191.5 error: build failed
------
executor failed running [/bin/sh -c cargo build --release]: exit code: 101

Dockerfile:

FROM rust:1.51.0-alpine3.13@sha256:7e00c2c4048ec8eee07f5fa34c1c2098f21fe342bbe37105f11eb2c7d04b08e4 as builder

RUN apk add --no-cache musl-dev openssl-dev libressl libressl-dev pkgconfig
RUN export OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu"; export OPENSSL_INCLUDE_DIR="/usr/include/openssl"

RUN USER=root cargo new --bin app

WORKDIR ./app
COPY ./Cargo.toml ./

RUN cargo build --release

COPY ./ ./

RUN cargo build --release
RUN cargo install --path .

FROM gcr.io/distroless/static:nonroot

COPY --from=builder /usr/local/cargo/bin/app /app

USER nonroot:nonroot

Any ideas? 🤔

@sfackler
Copy link
Owner

It looks like you need to install perl.

@Dentrax
Copy link
Author

Dentrax commented Apr 14, 2021

@sfackler

It seems error is changed:

#14 148.2   running "perl" "./Configure" "--prefix=/app/target/release/build/openssl-sys-576594f17d1161ae/out/openssl-build/install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-async" "linux-x86_64" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-DOPENSSL_NO_SECURE_MEMORY"
#14 148.2   Configuring OpenSSL version 1.1.1k (0x101010bfL) for linux-x86_64
#14 148.2   Using os-specific seed configuration
#14 148.2   Creating configdata.pm
#14 148.2   Creating Makefile
#14 148.2
#14 148.2   **********************************************************************
#14 148.2   ***                                                                ***
#14 148.2   ***   OpenSSL has been successfully configured                     ***
#14 148.2   ***                                                                ***
#14 148.2   ***   If you encounter a problem while building, please open an    ***
#14 148.2   ***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
#14 148.2   ***   and include the output from the following command:           ***
#14 148.2   ***                                                                ***
#14 148.2   ***       perl configdata.pm --dump                                ***
#14 148.2   ***                                                                ***
#14 148.2   ***   (If you are new to OpenSSL, you might want to consult the    ***
#14 148.2   ***   'Troubleshooting' section in the INSTALL file first)         ***
#14 148.2   ***                                                                ***
#14 148.2   **********************************************************************
#14 148.2   running "make" "depend"
#14 148.2
#14 148.2   --- stderr
#14 148.2   thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/openssl-src-111.15.0+1.1.1k/src/lib.rs:469:39
#14 148.2   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#14 148.2 warning: build failed, waiting for other jobs to finish...
#14 183.9 error: build failed

@sfackler
Copy link
Owner

It looks like you need to install make.

@Dentrax
Copy link
Author

Dentrax commented Apr 14, 2021

Thanks, installing perl and make fixed the problem. 👍

@kyee-rs
Copy link

kyee-rs commented Aug 30, 2023

It looks like you need to install make.

Anyway you could include this in the docs? Wasted me some time to find this 😂😂

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

3 participants