From a699b6d3e6e3901ed7e82f9b091eefaa5620280e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 5 Nov 2018 13:49:41 -0800 Subject: [PATCH] Use `openssl-src` from crates.io to link to OpenSSL 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. --- .travis.yml | 30 +-- Cargo.lock | 35 ++- Cargo.toml | 2 + ci/build-run-docker.sh | 10 +- .../aarch64-unknown-linux-gnu/Dockerfile | 3 + ci/docker/android/Dockerfile | 8 +- .../arm-unknown-linux-gnueabi/Dockerfile | 3 + .../arm-unknown-linux-gnueabihf/Dockerfile | 3 + .../armv7-unknown-linux-gnueabihf/Dockerfile | 3 + ci/docker/i686-unknown-linux-gnu/Dockerfile | 9 + ci/docker/mips-unknown-linux-gnu/Dockerfile | 3 +- .../mips64-unknown-linux-gnuabi64/Dockerfile | 3 +- .../Dockerfile | 3 +- ci/docker/mipsel-unknown-linux-gnu/Dockerfile | 3 +- .../powerpc-unknown-linux-gnu/Dockerfile | 3 +- .../powerpc64-unknown-linux-gnu/Dockerfile | 3 +- .../powerpc64le-unknown-linux-gnu/Dockerfile | 3 +- ci/docker/s390x-unknown-linux-gnu/Dockerfile | 3 +- ci/docker/x86_64-unknown-freebsd/Dockerfile | 3 + ci/docker/x86_64-unknown-linux-gnu/Dockerfile | 9 + ci/run-docker.sh | 205 ------------------ ci/run.sh | 8 +- 22 files changed, 100 insertions(+), 255 deletions(-) create mode 100644 ci/docker/aarch64-unknown-linux-gnu/Dockerfile create mode 100644 ci/docker/arm-unknown-linux-gnueabi/Dockerfile create mode 100644 ci/docker/arm-unknown-linux-gnueabihf/Dockerfile create mode 100644 ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile create mode 100644 ci/docker/i686-unknown-linux-gnu/Dockerfile create mode 100644 ci/docker/x86_64-unknown-freebsd/Dockerfile create mode 100644 ci/docker/x86_64-unknown-linux-gnu/Dockerfile delete mode 100644 ci/run-docker.sh diff --git a/.travis.yml b/.travis.yml index c695e9f5f1..aabdd1bce3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,11 @@ 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-unknown-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-unknown-linux-gnu NO_ADD=1 # Cross builds happen in the `rust-slave-linux-cross` image to ensure that @@ -22,32 +22,27 @@ matrix: # 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-unknown-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 @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 61b2dc63bf..82cd3a5b00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -211,7 +211,7 @@ dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", "schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -224,8 +224,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -517,7 +517,7 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", @@ -673,9 +673,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.12 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", "schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -716,7 +716,7 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.12" +version = "0.10.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -724,7 +724,7 @@ dependencies = [ "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -732,13 +732,22 @@ name = "openssl-probe" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "openssl-src" +version = "111.0.1+1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "openssl-sys" -version = "0.9.36" +version = "0.9.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-src 111.0.1+1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -982,6 +991,7 @@ dependencies = [ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "markdown 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1766,7 +1776,7 @@ dependencies = [ "checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" "checksum libflate 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "21138fc6669f438ed7ae3559d5789a5f0ba32f28c1f0608d1e452b0bb06ee936" -"checksum libz-sys 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "c7bdca442aa002a930e6eb2a71916cabe46d91ffec8df66db0abfb1bc83469ab" +"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" @@ -1787,9 +1797,10 @@ dependencies = [ "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" -"checksum openssl 0.10.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5e2e79eede055813a3ac52fb3915caf8e1c9da2dec1587871aec9f6f7b48508d" +"checksum openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "5e1309181cdcbdb51bc3b6bedb33dfac2a83b3d585033d3f6d9e22e8c1928613" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)" = "409d77eeb492a1aebd6eb322b2ee72ff7c7496b4434d98b3bf8be038755de65e" +"checksum openssl-src 111.0.1+1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d1edaed888fd85a54a2646bf02992931ddefdda3b1a748fc79f088a8db27fcbe" +"checksum openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)" = "278c1ad40a89aa1e741a1eed089a2f60b18fab8089c3139b542140fc7d674106" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" diff --git a/Cargo.toml b/Cargo.toml index 22c9197974..1f65bea00f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 = [] @@ -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"] } diff --git a/ci/build-run-docker.sh b/ci/build-run-docker.sh index bf456f592a..4f82bc9ac3 100644 --- a/ci/build-run-docker.sh +++ b/ci/build-run-docker.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -ex @@ -21,8 +21,14 @@ 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 \ + --env LIBZ_SYS_STATIC=1 \ + --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 diff --git a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile new file mode 100644 index 0000000000..433765a845 --- /dev/null +++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/android/Dockerfile b/ci/docker/android/Dockerfile index 1e485412e2..cb66b44f53 100644 --- a/ci/docker/android/Dockerfile +++ b/ci/docker/android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && \ apt-get install -y --no-install-recommends \ @@ -39,4 +39,10 @@ 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 +ENV CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc +ENV CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android-gcc + WORKDIR /buildslave diff --git a/ci/docker/arm-unknown-linux-gnueabi/Dockerfile b/ci/docker/arm-unknown-linux-gnueabi/Dockerfile new file mode 100644 index 0000000000..f6987ad586 --- /dev/null +++ b/ci/docker/arm-unknown-linux-gnueabi/Dockerfile @@ -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 diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile new file mode 100644 index 0000000000..f9ed761a46 --- /dev/null +++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -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 diff --git a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile new file mode 100644 index 0000000000..44e925e428 --- /dev/null +++ b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile @@ -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 diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile new file mode 100644 index 0000000000..74b0d4c301 --- /dev/null +++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/mips-unknown-linux-gnu/Dockerfile b/ci/docker/mips-unknown-linux-gnu/Dockerfile index 8e369777ed..10d1d4241a 100644 --- a/ci/docker/mips-unknown-linux-gnu/Dockerfile +++ b/ci/docker/mips-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-mips-linux-gnu \ @@ -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 diff --git a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile index 89d5f37422..ae2a1f8132 100644 --- a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile +++ b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-mips64-linux-gnuabi64 \ @@ -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 diff --git a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile index 113d300800..8e6911ad5c 100644 --- a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile +++ b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-mips64el-linux-gnuabi64 \ @@ -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 diff --git a/ci/docker/mipsel-unknown-linux-gnu/Dockerfile b/ci/docker/mipsel-unknown-linux-gnu/Dockerfile index f5ac9b62e3..5af20a21cf 100644 --- a/ci/docker/mipsel-unknown-linux-gnu/Dockerfile +++ b/ci/docker/mipsel-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-mipsel-linux-gnu \ @@ -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 diff --git a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile index 558d1a9585..8cfbbf54d8 100644 --- a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-powerpc-linux-gnu \ @@ -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 diff --git a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile index 3a9a5253b6..fb5572a81a 100644 --- a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-powerpc64-linux-gnu \ @@ -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 diff --git a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile index 8d9a768a9f..642e99c792 100644 --- a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-powerpc64le-linux-gnu \ @@ -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 diff --git a/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/ci/docker/s390x-unknown-linux-gnu/Dockerfile index d94129d935..6068783084 100644 --- a/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ b/ci/docker/s390x-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ gcc-s390x-linux-gnu \ @@ -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 diff --git a/ci/docker/x86_64-unknown-freebsd/Dockerfile b/ci/docker/x86_64-unknown-freebsd/Dockerfile new file mode 100644 index 0000000000..e556277c2c --- /dev/null +++ b/ci/docker/x86_64-unknown-freebsd/Dockerfile @@ -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 diff --git a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile new file mode 100644 index 0000000000..74b0d4c301 --- /dev/null +++ b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/run-docker.sh b/ci/run-docker.sh deleted file mode 100644 index 35b78ac520..0000000000 --- a/ci/run-docker.sh +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/sh - -set -ex - -# For some unknown reason libz is not found in the android docker image, so we -# use this workaround -case $TARGET in - arm-linux-androideabi | armv7-linux-androideabi ) - export DEP_Z_ROOT=/android-ndk/arm/sysroot/usr/;; - - aarch64-linux-android ) - export DEP_Z_ROOT=/android-ndk/arm64/sysroot/usr/;; - - i686-linux-android ) - export DEP_Z_ROOT=/android-ndk/x86/sysroot/usr/;; -esac - -upper_target=$(echo $TARGET | tr '[a-z]' '[A-Z]' | tr '-' '_') -export PATH=/travis-rust/bin:$PATH -export LD_LIBRARY_PATH=/travis-rust/lib:$LD_LIBRARY_PATH - -# ============================================================================== -# First up, let's compile OpenSSL -# -# The artifacts that we distribute must all statically be linked to OpenSSL -# because we have no idea what system we're going to be running on eventually. -# The target system may or may not have OpenSSL installed and it also may have -# any one of a number of ABI-incompatible OpenSSL versions installed. -# -# To get around all this we just compile it statically for the rustup *we* -# distribute (this can be changed by others of course). -# ============================================================================== - -OPENSSL_VERS=1.0.2m -OPENSSL_SHA256=8c6ff15ec6b319b50788f42c7abc2890c08ba5a1cdcd3810eb9092deada37b0f - -case $TARGET in - x86_64-*-linux-*) - OPENSSL_OS=linux-x86_64 - OPENSSL_CC=gcc - OPENSSL_AR=ar - ;; - i686-*-linux-*) - OPENSSL_OS=linux-elf - OPENSSL_CC=gcc - OPENSSL_AR=ar - OPENSSL_SETARCH='setarch i386' - OPENSSL_CFLAGS=-m32 - ;; - arm-linux-androideabi) - OPENSSL_OS=android - OPENSSL_CC=arm-linux-androideabi-gcc - OPENSSL_AR=arm-linux-androideabi-ar - ;; - armv7-linux-androideabi) - OPENSSL_OS=android-armv7 - OPENSSL_CC=arm-linux-androideabi-gcc - OPENSSL_AR=arm-linux-androideabi-ar - ;; - aarch64-linux-android) - OPENSSL_OS=linux-generic64 - OPENSSL_CC=aarch64-linux-android-gcc - OPENSSL_AR=aarch64-linux-android-ar - OPENSSL_CFLAGS="-mandroid -fomit-frame-pointer" - ;; - i686-linux-android) - OPENSSL_OS=android-x86 - OPENSSL_CC=i686-linux-android-gcc - OPENSSL_AR=i686-linux-android-ar - OPENSSL_CFLAGS=no-asm - ;; - x86_64-linux-android) - OPENSSL_OS=linux-x86_64 - OPENSSL_CC=x86_64-linux-android-gcc - OPENSSL_AR=x86_64-linux-android-ar - OPENSSL_CFLAGS="no-asm -mandroid -fomit-frame-pointer" - ;; - arm-*-linux-gnueabi) - OPENSSL_OS=linux-armv4 - OPENSSL_CC=arm-linux-gnueabi-gcc - OPENSSL_AR=arm-linux-gnueabi-ar - ;; - arm-*-linux-gnueabihf) - OPENSSL_OS=linux-armv4 - OPENSSL_CC=arm-linux-gnueabihf-gcc - OPENSSL_AR=arm-linux-gnueabihf-ar - ;; - armv7-*-linux-gnueabihf) - OPENSSL_OS=linux-armv4 - OPENSSL_CC=armv7-linux-gnueabihf-gcc - OPENSSL_AR=armv7-linux-gnueabihf-ar - ;; - aarch64-*-linux-gnu) - OPENSSL_OS=linux-aarch64 - OPENSSL_CC=aarch64-linux-gnu-gcc - OPENSSL_AR=aarch64-linux-gnu-ar - ;; - x86_64-*-freebsd) - OPENSSL_OS=BSD-x86_64 - OPENSSL_CC=x86_64-unknown-freebsd10-gcc - OPENSSL_AR=x86_64-unknown-freebsd10-ar - ;; - x86_64-*-netbsd) - OPENSSL_OS=BSD-x86_64 - OPENSSL_CC=x86_64-unknown-netbsd-gcc - OPENSSL_AR=x86_64-unknown-netbsd-ar - ;; - powerpc-*-linux-*) - OPENSSL_OS=linux-ppc - OPENSSL_CC=powerpc-linux-gnu-gcc - OPENSSL_AR=powerpc-linux-gnu-ar - ;; - powerpc64-*-linux-*) - OPENSSL_OS=linux-ppc64 - OPENSSL_CC=powerpc64-linux-gnu-gcc - OPENSSL_AR=powerpc64-linux-gnu-ar - OPENSSL_CFLAGS=-m64 - ;; - powerpc64le-*-linux-*) - OPENSSL_OS=linux-ppc64le - OPENSSL_CC=powerpc64le-linux-gnu-gcc - OPENSSL_AR=powerpc64le-linux-gnu-ar - ;; - mips-*-linux-*) - OPENSSL_OS=linux-mips32 - OPENSSL_CC=mips-linux-gnu-gcc - OPENSSL_AR=mips-linux-gnu-ar - ;; - mipsel-*-linux-*) - OPENSSL_OS=linux-mips32 - OPENSSL_CC=mipsel-linux-gnu-gcc - OPENSSL_AR=mipsel-linux-gnu-ar - ;; - mips64-*-linux-*) - OPENSSL_OS=linux64-mips64 - OPENSSL_CC=mips64-linux-gnuabi64-gcc - OPENSSL_AR=mips64-linux-gnuabi64-ar - ;; - mips64el-*-linux-*) - OPENSSL_OS=linux64-mips64 - OPENSSL_CC=mips64el-linux-gnuabi64-gcc - OPENSSL_AR=mips64el-linux-gnuabi64-ar - ;; - s390x-*-linux-*) - OPENSSL_OS=linux64-s390x - OPENSSL_CC=s390x-linux-gnu-gcc - OPENSSL_AR=s390x-linux-gnu-ar - ;; - *) - echo "can't cross compile OpenSSL for $TARGET" - exit 1 - ;; -esac - -install=`pwd`/target/$TARGET/openssl/openssl-install/$OPENSSL_VERS - - -if [ -L $install -a -d $install-final ]; then - # $install is the "right" place for the build. See below for why it's a symlink - echo 'Using cached OpenSSL static libs' -else - # Clean up any builds of previous versions from the cache - rm -rf $(dirname $install)/* - - - mkdir -p target/$TARGET/openssl - out=`pwd`/target/$TARGET/openssl/openssl-$OPENSSL_VERS.tar.gz - curl -o $out https://www.openssl.org/source/openssl-$OPENSSL_VERS.tar.gz - sha256sum $out > $out.sha256 - test $OPENSSL_SHA256 = `cut -d ' ' -f 1 $out.sha256` - - tar xf $out -C target/$TARGET/openssl - (cd target/$TARGET/openssl/openssl-$OPENSSL_VERS && \ - CC=$OPENSSL_CC \ - AR=$OPENSSL_AR \ - $SETARCH ./Configure --prefix=$install no-dso $OPENSSL_OS $OPENSSL_CFLAGS -fPIC && \ - make -j4 && \ - make install) - - # Travis will cache the parent directory. That's fine, but want a way of marking the - # install "complete". In this setup, if the build fails there will be no -final and - # the whole thing starts again (which is fine). - # The same reasoning is why to cache the install-target directory rather than - # the build directory in the first place (make should be able to sort itself out in - # that case, but that's relying on intuitive timestamps in the presence of caching etc) - mv $install $install-final - ln -s $install-final $install -fi - -# Variables to the openssl-sys crate to link statically against the OpenSSL we -# just compiled above -export OPENSSL_STATIC=1 -export OPENSSL_DIR=$install - -# ============================================================================== -# Actually delgate to the test script itself -# ============================================================================== - -# Our only writable directory is `target`, so place all output there and go -# ahead and throw the home directory in there as well. -export CARGO_TARGET_DIR=`pwd`/target -export CARGO_HOME=`pwd`/target/cargo-home -export CARGO_TARGET_${upper_target}_LINKER=$OPENSSL_CC - -exec sh ci/run.sh diff --git a/ci/run.sh b/ci/run.sh index c95df5fd20..a48c157456 100644 --- a/ci/run.sh +++ b/ci/run.sh @@ -7,10 +7,10 @@ echo "toolchain versions\n------------------" rustc -vV cargo -vV -cargo build --locked -v --release --target $TARGET +cargo build --locked -v --release --target $TARGET --features vendored-openssl if [ -z "$SKIP_TESTS" ]; then - cargo test --release -p download --target $TARGET - cargo test --release -p rustup-dist --target $TARGET - cargo test --release --target $TARGET + cargo test --release -p download --target $TARGET --features vendored-openssl + cargo test --release -p rustup-dist --target $TARGET --features vendored-openssl + cargo test --release --target $TARGET --features vendored-openssl fi