gnzlbg / ctest

Automatic testing of FFI bindings for Rust

Home Page:https://docs.rs/ctest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with rust-openssl and Alpine Linux

kirillt opened this issue · comments

Hey, the following Dockerfile:

FROM alpine
RUN apk add git cargo pkgconfig openssl openssl-dev
RUN git clone https://github.com/sfackler/rust-openssl /build
RUN cd /build && cargo build --release

produces the following error:

error: failed to run custom build command for `systest v0.1.0 (/build/systest)`

Caused by:
  process didn't exit successfully: `/build/target/release/build/systest-9a76ac7552bababf/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'unknown os/family width: x86_64-alpine-linux-musl', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ctest-0.2.22/src/lib.rs:1117:9

Is it correct that this panic comes from ctest?

The problem is that Alpine uses target x86_64-alpine-linux-musl instead of x86_64-unknown-linux-musl. Installing Rust manually with latter target helps. Here is the working Dockerfile:

FROM alpine:edge
RUN apk add git curl
RUN apk add pkgconfig openssl-dev gcc musl-dev rustup
RUN rustup-init -t x86_64-unknown-linux-musl --default-toolchain nightly --profile minimal -y
RUN git clone https://github.com/sfackler/rust-openssl /build
RUN cd /build && /root/.cargo/bin/cargo build --release

This is probably not a bug, so closing the issue.