Skip to content

Commit

Permalink
Use openssl-src instead of building OpenSSL manually
Browse files Browse the repository at this point in the history
Also turn off `fail-fast` on CI to see all the failures on PRs
  • Loading branch information
alexcrichton committed Sep 30, 2024
1 parent 37bc337 commit b5f4250
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [x86_64, i686, x86_64-musl, mingw, system-curl, openssl-110, x86_64-beta, x86_64-nightly, macos, win64, win32]
include:
Expand Down
14 changes: 1 addition & 13 deletions ci/Dockerfile-musl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,4 @@ FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc ca-certificates make libc6-dev curl \
musl-tools

RUN \
curl -L https://www.openssl.org/source/old/1.0.2/openssl-1.0.2g.tar.gz | tar xzf - && \
cd openssl-1.0.2g && \
CC=musl-gcc ./Configure --prefix=/openssl no-dso linux-x86_64 -fPIC && \
make -j10 && \
make install && \
cd .. && \
rm -rf openssl-1.0.2g

ENV OPENSSL_STATIC=1 \
OPENSSL_DIR=/openssl
musl-tools perl
27 changes: 16 additions & 11 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

set -ex

cargo test --target $TARGET --no-run
# For musl on CI always use openssl-src dependency and build from there.
if [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then
features="--features static-ssl"
fi

cargo test --target $TARGET --no-run $features
# First test with no extra protocols enabled.
cargo test --target $TARGET --no-run --features static-curl
cargo test --target $TARGET --no-run --features static-curl $features
# Then with rustls TLS backend.
#
# Note: Cross-compiling rustls on windows doesn't work due to requiring some
Expand All @@ -16,22 +21,22 @@ cargo test --target $TARGET --no-run --features static-curl
# inconvenience for me.
if [ "$TARGET" != "x86_64-pc-windows-gnu" ] && [ "$TARGET" != "i686-pc-windows-msvc" ]
then
cargo test --target $TARGET --no-run --features rustls,static-curl
cargo test --target $TARGET --no-run --features rustls,static-curl $features
fi
# Then with all extra protocols enabled.
cargo test --target $TARGET --no-run --features static-curl,protocol-ftp,ntlm
cargo test --target $TARGET --no-run --features static-curl,protocol-ftp,ntlm $features
if [ -z "$NO_RUN" ]; then
cargo test --target $TARGET
cargo test --target $TARGET --features static-curl
cargo test --target $TARGET --features static-curl,protocol-ftp
cargo test --target $TARGET $features
cargo test --target $TARGET --features static-curl $features
cargo test --target $TARGET --features static-curl,protocol-ftp $features

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

cargo doc --no-deps --target $TARGET
cargo doc --no-deps -p curl-sys --target $TARGET
cargo doc --no-deps --target $TARGET $features
cargo doc --no-deps -p curl-sys --target $TARGET $features
fi
3 changes: 3 additions & 0 deletions systest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ libc = "0.2"
[build-dependencies]
ctest2 = "0.4"
cc = "1.0"

[features]
static-ssl = ['curl-sys/static-ssl']

0 comments on commit b5f4250

Please sign in to comment.