Skip to content

Commit 90af445

Browse files
authored
Use openssl-src instead of building OpenSSL manually (#582)
Also turn off `fail-fast` on CI to see all the failures on PRs
1 parent 37bc337 commit 90af445

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
name: Test
1111
runs-on: ${{ matrix.os }}
1212
strategy:
13+
fail-fast: false
1314
matrix:
1415
build: [x86_64, i686, x86_64-musl, mingw, system-curl, openssl-110, x86_64-beta, x86_64-nightly, macos, win64, win32]
1516
include:

ci/Dockerfile-musl

+1-13
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,4 @@ FROM ubuntu:16.04
33
RUN apt-get update
44
RUN apt-get install -y --no-install-recommends \
55
gcc ca-certificates make libc6-dev curl \
6-
musl-tools
7-
8-
RUN \
9-
curl -L https://www.openssl.org/source/old/1.0.2/openssl-1.0.2g.tar.gz | tar xzf - && \
10-
cd openssl-1.0.2g && \
11-
CC=musl-gcc ./Configure --prefix=/openssl no-dso linux-x86_64 -fPIC && \
12-
make -j10 && \
13-
make install && \
14-
cd .. && \
15-
rm -rf openssl-1.0.2g
16-
17-
ENV OPENSSL_STATIC=1 \
18-
OPENSSL_DIR=/openssl
6+
musl-tools perl

ci/run.sh

+16-11
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
set -ex
44

5-
cargo test --target $TARGET --no-run
5+
# For musl on CI always use openssl-src dependency and build from there.
6+
if [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then
7+
features="--features static-ssl"
8+
fi
9+
10+
cargo test --target $TARGET --no-run $features
611
# First test with no extra protocols enabled.
7-
cargo test --target $TARGET --no-run --features static-curl
12+
cargo test --target $TARGET --no-run --features static-curl $features
813
# Then with rustls TLS backend.
914
#
1015
# Note: Cross-compiling rustls on windows doesn't work due to requiring some
@@ -16,22 +21,22 @@ cargo test --target $TARGET --no-run --features static-curl
1621
# inconvenience for me.
1722
if [ "$TARGET" != "x86_64-pc-windows-gnu" ] && [ "$TARGET" != "i686-pc-windows-msvc" ]
1823
then
19-
cargo test --target $TARGET --no-run --features rustls,static-curl
24+
cargo test --target $TARGET --no-run --features rustls,static-curl $features
2025
fi
2126
# Then with all extra protocols enabled.
22-
cargo test --target $TARGET --no-run --features static-curl,protocol-ftp,ntlm
27+
cargo test --target $TARGET --no-run --features static-curl,protocol-ftp,ntlm $features
2328
if [ -z "$NO_RUN" ]; then
24-
cargo test --target $TARGET
25-
cargo test --target $TARGET --features static-curl
26-
cargo test --target $TARGET --features static-curl,protocol-ftp
29+
cargo test --target $TARGET $features
30+
cargo test --target $TARGET --features static-curl $features
31+
cargo test --target $TARGET --features static-curl,protocol-ftp $features
2732

2833
# Note that `-Clink-dead-code` is passed here to suppress `--gc-sections` to
2934
# help confirm that we're compiling everything necessary for curl itself.
3035
RUSTFLAGS=-Clink-dead-code \
31-
cargo run --manifest-path systest/Cargo.toml --target $TARGET
36+
cargo run --manifest-path systest/Cargo.toml --target $TARGET $features
3237
RUSTFLAGS=-Clink-dead-code \
33-
cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl,curl-sys/protocol-ftp
38+
cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl,curl-sys/protocol-ftp $features
3439

35-
cargo doc --no-deps --target $TARGET
36-
cargo doc --no-deps -p curl-sys --target $TARGET
40+
cargo doc --no-deps --target $TARGET $features
41+
cargo doc --no-deps -p curl-sys --target $TARGET $features
3742
fi

systest/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ libc = "0.2"
1313
[build-dependencies]
1414
ctest2 = "0.4"
1515
cc = "1.0"
16+
17+
[features]
18+
static-ssl = ['curl-sys/static-ssl']

0 commit comments

Comments
 (0)