Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backporting fixes to 1.14.0 #3352

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ os: linux
services:
- docker

git:
depth: 1

matrix:
include:
# stable linux builds, tested
- env: TARGET=x86_64-unknown-linux-gnu
ALT=i686-unknown-linux-gnu
IMAGE=dist
MAKE_TARGETS="test distcheck doc install uninstall"
ALLOW_PR=1
- env: TARGET=i686-unknown-linux-gnu
IMAGE=dist
MAKE_TARGETS=test-unit-i686-unknown-linux-gnu
Expand All @@ -29,7 +33,6 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
CFG_DISABLE_CROSS_TESTS=1
os: osx
install: brew uninstall openssl && brew install openssl --universal --without-test

# stable musl target, tested
- env: TARGET=x86_64-unknown-linux-musl
Expand Down Expand Up @@ -58,13 +61,13 @@ matrix:
IMAGE=cross
- env: TARGET=mips64-unknown-linux-gnuabi64
IMAGE=cross
rust: nightly
rust: beta
- env: TARGET=mips64el-unknown-linux-gnuabi64
IMAGE=cross
rust: nightly
rust: beta
- env: TARGET=s390x-unknown-linux-gnu
IMAGE=cross
rust: nightly
rust: beta
- env: TARGET=powerpc-unknown-linux-gnu
IMAGE=cross
rust: beta
Expand All @@ -87,7 +90,7 @@ matrix:
IMAGE=dist
MAKE_TARGETS="test distcheck doc install uninstall"
DEPLOY=0
rust: nightly
rust: nightly-2016-11-26

exclude:
- rust: stable
Expand All @@ -100,11 +103,15 @@ before_script:
sh -s -- --add-target=$ALT --disable-sudo -y --prefix=`rustc --print sysroot`;
fi
script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
SRC=. src/ci/run.sh $TARGET;
else
src/ci/docker/run.sh $IMAGE $TARGET;
fi
- >
if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto-cargo" ]; then
echo skipping, not a full build;
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
SRC=. src/ci/run.sh $TARGET;
else
src/ci/docker/run.sh $IMAGE $TARGET;
fi

after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
Expand All @@ -122,14 +129,9 @@ notifications:
email:
on_success: never

branches:
only:
- master
- auto-cargo

before_deploy:
- mkdir -p deploy/$TRAVIS_COMMIT
- cp target/$TARGET/release/dist/cargo-nightly-$TARGET.tar.gz
- cp target/$TARGET/release/dist/cargo-*-$TARGET.tar.gz
deploy/$TRAVIS_COMMIT

deploy:
Expand Down
62 changes: 46 additions & 16 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ include config.mk

export PATH := $(dir $(CFG_RUSTC)):$(PATH)

ifdef CFG_ENABLE_NIGHTLY
CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL)-nightly
CFG_PACKAGE_VERS = nightly
else
CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL)
CFG_PACKAGE_VERS=$(CFG_RELEASE)
ifeq ($(CFG_RELEASE_CHANNEL),stable)
CFG_RELEASE=$(CFG_RELEASE_NUM)
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
else ifeq ($(CFG_RELEASE_CHANNEL),beta)
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
CFG_PACKAGE_VERS=beta
else ifeq ($(CFG_RELEASE_CHANNEL),nightly)
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
CFG_PACKAGE_VERS=nightly
else ifeq ($(CFG_RELEASE_CHANNEL),dev)
CFG_RELEASE=$(CFG_RELEASE_NUM)-dev
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-dev
endif

CFG_BUILD_DATE = $(shell date +%F)

ifeq ($(wildcard .git),)
Expand Down Expand Up @@ -96,7 +103,8 @@ test-unit-$(1): target/openssl/$(1).stamp cargo-$(1)
@mkdir -p $$(CFG_BUILD_DIR)/target/$(1)/cit
$$(CARGO) test --target $(1) \
--manifest-path $(S)Cargo.toml \
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only)
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only) -- \
--quiet
endef
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))

Expand Down Expand Up @@ -172,17 +180,19 @@ OPENSSL_OS_aarch64-unknown-linux-gnu := linux-aarch64
OPENSSL_OS_arm-unknown-linux-gnueabi := linux-armv4
OPENSSL_OS_arm-unknown-linux-gnueabihf := linux-armv4
OPENSSL_OS_armv7-unknown-linux-gnueabihf := linux-armv4
OPENSSL_OS_i686-apple-darwin := darwin-i386-cc
OPENSSL_OS_i686-unknown-freebsd := BSD-x86-elf
OPENSSL_OS_i686-unknown-linux-gnu := linux-elf
OPENSSL_OS_i686-unknown-linux-musl := linux-elf
OPENSSL_OS_mips-unknown-linux-gnu := linux-mips32
OPENSSL_OS_mipsel-unknown-linux-gnu := linux-mips32
OPENSSL_OS_mips64-unknown-linux-gnuabi64 := linux64-mips64
OPENSSL_OS_mips64el-unknown-linux-gnuabi64 := linux64-mips64
OPENSSL_OS_mipsel-unknown-linux-gnu := linux-mips32
OPENSSL_OS_powerpc-unknown-linux-gnu := linux-ppc
OPENSSL_OS_powerpc64-unknown-linux-gnu := linux-ppc64
OPENSSL_OS_powerpc64le-unknown-linux-gnu := linux-ppc64le
OPENSSL_OS_s390x-unknown-linux-gnu := linux64-s390x
OPENSSL_OS_x86_64-apple-darwin := darwin64-x86_64-cc
OPENSSL_OS_x86_64-unknown-freebsd := BSD-x86_64
OPENSSL_OS_x86_64-unknown-linux-gnu := linux-x86_64
OPENSSL_OS_x86_64-unknown-linux-musl := linux-x86_64
Expand All @@ -192,6 +202,7 @@ OPENSSL_AR_aarch64-unknown-linux-gnu := aarch64-linux-gnu-ar
OPENSSL_AR_arm-unknown-linux-gnueabi := arm-linux-gnueabi-ar
OPENSSL_AR_arm-unknown-linux-gnueabihf := arm-linux-gnueabihf-ar
OPENSSL_AR_armv7-unknown-linux-gnueabihf := armv7-linux-gnueabihf-ar
OPENSSL_AR_i686-apple-darwin := ar
OPENSSL_AR_i686-unknown-freebsd := i686-unknown-freebsd10-ar
OPENSSL_AR_i686-unknown-linux-gnu := ar
OPENSSL_AR_i686-unknown-linux-musl := ar
Expand All @@ -203,6 +214,7 @@ OPENSSL_AR_powerpc-unknown-linux-gnu := powerpc-linux-gnu-ar
OPENSSL_AR_powerpc64-unknown-linux-gnu := powerpc64-linux-gnu-ar
OPENSSL_AR_powerpc64le-unknown-linux-gnu := powerpc64le-linux-gnu-ar
OPENSSL_AR_s390x-unknown-linux-gnu := s390x-linux-gnu-ar
OPENSSL_AR_x86_64-apple-darwin := ar
OPENSSL_AR_x86_64-unknown-freebsd := x86_64-unknown-freebsd10-ar
OPENSSL_AR_x86_64-unknown-linux-gnu := ar
OPENSSL_AR_x86_64-unknown-linux-musl := ar
Expand All @@ -211,6 +223,7 @@ OPENSSL_CC_aarch64-unknown-linux-gnu := aarch64-linux-gnu-gcc
OPENSSL_CC_arm-unknown-linux-gnueabi := arm-linux-gnueabi-gcc
OPENSSL_CC_arm-unknown-linux-gnueabihf := arm-linux-gnueabihf-gcc
OPENSSL_CC_armv7-unknown-linux-gnueabihf := armv7-linux-gnueabihf-gcc
OPENSSL_CC_i686-apple-darwin := clang
OPENSSL_CC_i686-unknown-freebsd := i686-unknown-freebsd10-gcc
OPENSSL_CC_i686-unknown-linux-gnu := gcc
OPENSSL_CC_i686-unknown-linux-musl := musl-gcc
Expand All @@ -222,20 +235,28 @@ OPENSSL_CC_powerpc-unknown-linux-gnu := powerpc-linux-gnu-gcc
OPENSSL_CC_powerpc64-unknown-linux-gnu := powerpc64-linux-gnu-gcc-5
OPENSSL_CC_powerpc64le-unknown-linux-gnu := powerpc64le-linux-gnu-gcc
OPENSSL_CC_s390x-unknown-linux-gnu := s390x-linux-gnu-gcc
OPENSSL_CC_x86_64-apple-darwin := clang
OPENSSL_CC_x86_64-unknown-freebsd := x86_64-unknown-freebsd10-gcc
OPENSSL_CC_x86_64-unknown-linux-gnu := gcc
OPENSSL_CC_x86_64-unknown-linux-musl := musl-gcc
OPENSSL_CC_x86_64-unknown-netbsd := x86_64-unknown-netbsd-gcc

SETARCH_i686-unknown-linux-gnu := setarch i386
OPENSSL_CFLAGS_i686-apple-darwin := -m32
OPENSSL_CFLAGS_i686-unknown-linux-gnu := -m32
OPENSSL_CFLAGS_i686-unknown-linux-musl := -m32

define BUILD_OPENSSL
ifdef OPENSSL_OS_$(1)
ifdef CFG_ENABLE_NIGHTLY

ifdef CFG_ENABLE_BUILD_OPENSSL

cargo-$(1): export OPENSSL_STATIC := 1
test-unit-$(1): export OPENSSL_STATIC := 1

OPENSSL_INSTALL_$(1) := $$(CFG_BUILD_DIR)/target/openssl/$(1)-install

ifdef OPENSSL_OS_$(1)

target/openssl/$(1).stamp: target/openssl/openssl-$$(OPENSSL_VERS).tar.gz \
| target/openssl/
mkdir -p target/openssl/$(1)
Expand All @@ -250,27 +271,36 @@ target/openssl/$(1).stamp: target/openssl/openssl-$$(OPENSSL_VERS).tar.gz \
touch $$@

# variables read by various build scripts to find openssl
cargo-$(1): export OPENSSL_STATIC := 1
cargo-$(1): export OPENSSL_DIR := $$(OPENSSL_INSTALL_$(1))
test-unit-$(1): export OPENSSL_STATIC := 1
test-unit-$(1): export OPENSSL_DIR := $$(OPENSSL_INSTALL_$(1))

# build libz statically into the cargo we're producing
cargo-$(1): export LIBZ_SYS_STATIC := 1
else

else # !OPENSSL_OS_$(1)
target/openssl/$(1).stamp:

endif
else

else # !CFG_ENABLE_BUILD_OPENSSL
target/openssl/$(1).stamp:
endif

endef

$(foreach target,$(CFG_TARGET),$(eval $(call BUILD_OPENSSL,$(target))))

ifeq ($(shell uname),Darwin)
SHASUM := shasum -a 256
else
SHASUM := sha256sum
endif

target/openssl/openssl-$(OPENSSL_VERS).tar.gz: | target/openssl/
curl -o $(@) https://www.openssl.org/source/openssl-$(OPENSSL_VERS).tar.gz
sha256sum $(@) > $(@).sha256
curl -o $(@).tmp https://www.openssl.org/source/openssl-$(OPENSSL_VERS).tar.gz
$(SHASUM) $(@).tmp > $(@).sha256
test $(OPENSSL_SHA256) = `cut -d ' ' -f 1 $(@).sha256`
mv $(@).tmp $(@)

target/openssl/:
mkdir -p $(@)
Expand Down
23 changes: 10 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
environment:
matrix:
- TARGET: x86_64-pc-windows-gnu
ARCH: amd64
BITS: 64
CFG_DISABLE_CROSS_TESTS: 1
MAKE_TARGETS: test-unit-x86_64-pc-windows-gnu
- TARGET: i686-pc-windows-gnu
ARCH: x86
BITS: 32
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci
MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
Expand All @@ -15,13 +13,12 @@ environment:
MAKE_TARGETS: test-unit-i686-pc-windows-gnu
- TARGET: i686-pc-windows-msvc
BITS: 32
ARCH: x86
MAKE_TARGETS: test-unit-i686-pc-windows-msvc
CFG_DISABLE_CROSS_TESTS: 1
ALLOW_PR: 1
- TARGET: x86_64-pc-windows-msvc
OTHER_TARGET: i686-pc-windows-msvc
BITS: 64
ARCH: amd64
MAKE_TARGETS: test-unit-x86_64-pc-windows-msvc

install:
Expand All @@ -38,6 +35,8 @@ install:
- cargo -V
- git submodule update --init

clone_depth: 1

build: false

test_script:
Expand All @@ -48,17 +47,15 @@ cache:
- C:\Users\appveyor\.cargo\registry

after_test:
- mkdir %APPVEYOR_REPO_COMMIT%
- copy target\%TARGET%\release\dist\cargo-nightly-%TARGET%.tar.gz
%APPVEYOR_REPO_COMMIT%

branches:
only:
- master
- auto-cargo
- ps: New-Item -Path "${env:APPVEYOR_REPO_COMMIT}" -ItemType "directory"
- ps: New-Item -Path "target" -ItemType "directory" -Force
- ps: New-Item -Path "target/${env:TARGET}" -ItemType "directory" -Force
- ps: New-Item -Path "target/${env:TARGET}/release" -ItemType "directory" -Force
- ps: New-Item -Path "target/${env:TARGET}/release/dist" -ItemType "directory" -Force
- ps: Get-ChildItem -Path target\${env:TARGET}\release\dist -Filter '*.tar.gz' | Move-Item -Destination ${env:APPVEYOR_REPO_COMMIT}

artifacts:
- path: $(APPVEYOR_REPO_COMMIT)\cargo-nightly-$(TARGET).tar.gz
- path: $(APPVEYOR_REPO_COMMIT)\cargo-*-$(TARGET).tar.gz
name: cargo

deploy:
Expand Down
49 changes: 9 additions & 40 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ VAL_OPTIONS=""

opt debug 1 "build with extra debug fun"
opt optimize 1 "build with optimizations"
opt nightly 0 "build nightly packages"
opt verify-install 1 "verify installed binaries work"
opt option-checking 1 "complain about unrecognized options in this configure script"
opt cross-tests 1 "run cross-compilation tests"
opt build-openssl 0 "compile OpenSSL at build time to link to"
valopt prefix "/usr/local" "set installation prefix"
valopt local-rust-root "" "set prefix for local rust binary"

Expand Down Expand Up @@ -336,6 +336,14 @@ valopt docdir "${CFG_PREFIX}/share/doc/cargo" "install extra docs"
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
valopt libdir "${CFG_PREFIX}/lib" "install libraries"

if [ -e ${CFG_SRC_DIR}.git ]
then
valopt release-channel "dev" "the name of the release channel to build"
else
msg "git: no git directory. Changing default release channel to stable"
valopt release-channel "stable" "the name of the release channel to build"
fi

if [ $HELP -eq 1 ]
then
echo
Expand Down Expand Up @@ -385,45 +393,6 @@ if [ "$CFG_SRC_DIR" != "$CFG_BUILD_DIR" ]; then
putvar CFG_CUSTOM_BUILD_DIR
fi

if [ ! -z "$CFG_ENABLE_NIGHTLY" ]; then
need_cmd curl
if [ ! -f .cargo/config ]; then
mkdir -p .cargo
cat > .cargo/config <<-EOF
[target.arm-unknown-linux-gnueabi]
linker = "arm-linux-gnueabi-gcc"
[target.arm-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.armv7-unknown-linux-gnueabihf]
linker = "armv7-linux-gnueabihf-gcc"
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.i686-unknown-freebsd]
linker = "i686-unknown-freebsd10-gcc"
[target.x86_64-unknown-freebsd]
linker = "x86_64-unknown-freebsd10-gcc"
[target.x86_64-unknown-netbsd]
linker = "x86_64-unknown-netbsd-gcc"
[target.powerpc-unknown-linux-gnu]
linker = "powerpc-linux-gnu-gcc"
[target.powerpc64-unknown-linux-gnu]
linker = "powerpc64-linux-gnu-gcc-5"
[target.powerpc64le-unknown-linux-gnu]
linker = "powerpc64le-linux-gnu-gcc"
[target.mips-unknown-linux-gnu]
linker = "mips-linux-gnu-gcc"
[target.mipsel-unknown-linux-gnu]
linker = "mipsel-linux-gnu-gcc"
[target.mips64el-unknown-linux-gnuabi64]
linker = "mips64el-linux-gnuabi64-gcc"
[target.mips64-unknown-linux-gnuabi64]
linker = "mips64-linux-gnuabi64-gcc"
[target.s390x-unknown-linux-gnu]
linker = "s390x-linux-gnu-gcc"
EOF
fi
fi

step_msg "writing configuration"

putvar CFG_SRC_DIR
Expand Down
16 changes: 16 additions & 0 deletions src/ci/docker/cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
FROM alexcrichton/rust-slave-linux-cross:2016-10-11c
ENTRYPOINT []

ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-linux-gnueabi-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-linux-gnueabihf-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
CARGO_TARGET_I686_UNKNOWN_FREEBSD_LINKER=i686-unknown-freebsd10-gcc \
CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER=x86_64-unknown-freebsd10-gcc \
CARGO_TARGET_X86_64_UNKNOWN_NETBSD_LINKER=x86_64-unknown-netbsd-gcc \
CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-linux-gnu-gcc \
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc \
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc-5 \
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc
Loading