Skip to content

Commit

Permalink
Use openssl-src from crates.io to link to OpenSSL
Browse files Browse the repository at this point in the history
This commit updates the CI builds for rustup to always build
`openssl-src` from crates.io instead of having a baked-in build of
OpenSSL. This matches what Cargo has switched to as well, and is
intended to centralize OpenSSL updates to one crates.io crate.

This also modernizes the docker containers and builds a bit to remove
the need for some scripts here and there.
  • Loading branch information
alexcrichton committed Nov 5, 2018
1 parent 75213a2 commit 4a4370a
Show file tree
Hide file tree
Showing 22 changed files with 94 additions and 252 deletions.
30 changes: 7 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,39 @@ matrix:
# "super old glibc" to ensure that it runs on as many platforms as possible.
- os: linux
env: TARGET=i686-unknown-linux-gnu
DOCKER=alexcrichton/rust-slave-dist:2015-10-20b
DOCKER=i686-unkonwn-linux-gnu
if: branch != master
- os: linux
env: TARGET=x86_64-unknown-linux-gnu
DOCKER=alexcrichton/rust-slave-dist:2015-10-20b
DOCKER=x86_64-unkonwn-linux-gnu
NO_ADD=1

# Cross builds happen in the `rust-slave-linux-cross` image to ensure that
# we use the right cross compilers for these targets. That image should
# bundle all the gcc cross compilers to enable us to build OpenSSL
- os: linux
env: TARGET=arm-unknown-linux-gnueabi
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
DOCKER=arm-unknown-linux-gnueabi
SKIP_TESTS=1
if: branch != master
- os: linux
env: TARGET=arm-unknown-linux-gnueabihf
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
DOCKER=arm-unknown-linux-gnueabihf
SKIP_TESTS=1
if: branch != master
- os: linux
env: TARGET=armv7-unknown-linux-gnueabihf
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
DOCKER=armv7-unkonwn-linux-gnueabihf
SKIP_TESTS=1
if: branch != master
- os: linux
env: TARGET=aarch64-unknown-linux-gnu
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
DOCKER=aarch64-unknown-linux-gnu
SKIP_TESTS=1
if: branch != master
- os: linux
env: TARGET=x86_64-unknown-freebsd
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
SKIP_TESTS=1
if: branch != master
- os: linux
env: TARGET=x86_64-unknown-netbsd
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
DOCKER=x86_64-unknown-freebsd
SKIP_TESTS=1
if: branch != master
- os: linux
Expand Down Expand Up @@ -134,17 +129,6 @@ matrix:
NO_ADD=1
if: branch != master
osx_image: xcode9.2
allow_failures:
- env: TARGET=x86_64-unknown-netbsd
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
SKIP_TESTS=1

cache:
# We're going to download things we don't necessarily want to cache into the `target` directory, so
# don't use travis's native `cargo` caching, which just grabs the whole folder.
directories:
- target/$TARGET/openssl/openssl-install
- target/release/deps

install:
- if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
Expand Down
29 changes: 20 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ default = ["curl-backend", "reqwest-backend"]

curl-backend = ["download/curl-backend"]
reqwest-backend = ["download/reqwest-backend"]
vendored-openssl = ['openssl/vendored']

# Include in the default set to disable self-update and uninstall.
no-self-update = []
Expand Down Expand Up @@ -55,6 +56,7 @@ time = "0.1.34"
toml = "0.4"
url = "1.1.0"
wait-timeout = "0.1.5"
openssl = { version = '0.10.15', optional = true }

[target."cfg(windows)".dependencies]
winapi = { version = "0.3", features = ["jobapi", "jobapi2", "processthreadsapi", "psapi", "synchapi", "winuser"] }
Expand Down
9 changes: 7 additions & 2 deletions ci/build-run-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -ex

Expand All @@ -21,8 +21,13 @@ docker run \
--workdir /src \
--env TARGET=$TARGET \
--env SKIP_TESTS=$SKIP_TESTS \
--env CARGO_HOME=/src/target/cargo-home \
--env CARGO_TARGET_DIR=/src/target \
--entrypoint sh \
--tty \
--init \
$DOCKER \
ci/run-docker.sh
-c 'PATH=$PATH:/travis-rust/bin exec bash ci/run.sh'

# check that rustup-init was built with ssl support
# see https://github.com/rust-lang-nursery/rustup.rs/issues/1051
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/aarch64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alexcrichton/rust-slave-linux-cross:2016-11-11

ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
6 changes: 5 additions & 1 deletion ci/docker/android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -39,4 +39,8 @@ ENV PATH=$PATH:/android-ndk/arm64/bin
ENV PATH=$PATH:/android-ndk/x86/bin
ENV PATH=$PATH:/android-ndk/x86_64/bin

ENV CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc
ENV CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc
ENV CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc

WORKDIR /buildslave
3 changes: 3 additions & 0 deletions ci/docker/arm-unknown-linux-gnueabi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alexcrichton/rust-slave-linux-cross:2016-11-11

ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-linux-gnueabi-gcc
3 changes: 3 additions & 0 deletions ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alexcrichton/rust-slave-linux-cross:2016-11-11

ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
3 changes: 3 additions & 0 deletions ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alexcrichton/rust-slave-linux-cross:2016-11-11

ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
9 changes: 9 additions & 0 deletions ci/docker/i686-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alexcrichton/rust-slave-dist:2015-10-20b
USER root

WORKDIR /
RUN curl https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz | tar xzf -
WORKDIR /perl-5.28.0
RUN ./configure.gnu
RUN make -j$(nproc)
RUN make install
3 changes: 2 additions & 1 deletion ci/docker/mips-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-mips-linux-gnu \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc
ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc
3 changes: 2 additions & 1 deletion ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-mips64-linux-gnuabi64 \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc
ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc
3 changes: 2 additions & 1 deletion ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-mips64el-linux-gnuabi64 \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc
ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc
3 changes: 2 additions & 1 deletion ci/docker/mipsel-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-mipsel-linux-gnu \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_mipsel_unknown_linux_gnu=mipsel-linux-gnu-gcc
ENV CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-linux-gnu-gcc
3 changes: 2 additions & 1 deletion ci/docker/powerpc-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-powerpc-linux-gnu \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_powerpc_unknown_linux_gnu=powerpc-linux-gnu-gcc
ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc
3 changes: 2 additions & 1 deletion ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-powerpc64-linux-gnu \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-gcc
ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc
3 changes: 2 additions & 1 deletion ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-powerpc64le-linux-gnu \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_powerpc64le_unknown_linux_gnu=powerpc64le-linux-gnu-gcc
ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc
3 changes: 2 additions & 1 deletion ci/docker/s390x-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc-s390x-linux-gnu \
Expand All @@ -9,3 +9,4 @@ RUN apt-get update && apt-get install -y \
gcc

ENV CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc
3 changes: 3 additions & 0 deletions ci/docker/x86_64-unknown-freebsd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alexcrichton/rust-slave-linux-cross:2016-11-11

ENV CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER=x86_64-unknown-freebsd10-gcc
9 changes: 9 additions & 0 deletions ci/docker/x86_64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alexcrichton/rust-slave-dist:2015-10-20b
USER root

WORKDIR /
RUN curl https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz | tar xzf -
WORKDIR /perl-5.28.0
RUN ./configure.gnu
RUN make -j$(nproc)
RUN make install
Loading

0 comments on commit 4a4370a

Please sign in to comment.