From d9278f7ff65b3a4798348d2fc68278b25eaae864 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 11 Dec 2019 15:34:02 +0100 Subject: [PATCH 1/4] ci: make publish_toolstate.sh generic over the CI provider --- src/ci/publish_toolstate.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ci/publish_toolstate.sh b/src/ci/publish_toolstate.sh index 4c047069571..fb828477f98 100755 --- a/src/ci/publish_toolstate.sh +++ b/src/ci/publish_toolstate.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash -set -eu +set -euo pipefail +IFS=$'\n\t' + +source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" # The following lines are also found in src/bootstrap/toolstate.rs, # so if updating here, please also update that file. @@ -21,7 +24,7 @@ cd rust-toolstate FAILURE=1 for RETRY_COUNT in 1 2 3 4 5; do # The purpose is to publish the new "current" toolstate in the toolstate repo. - "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$GIT_COMMIT" \ + "$(ciCheckoutPath)/src/tools/publish_toolstate.py" "$GIT_COMMIT" \ "$GIT_COMMIT_MSG" \ "$MESSAGE_FILE" \ "$TOOLSTATE_REPO_ACCESS_TOKEN" From ae9ca096126cc626fcb503c84e6937478b9161c1 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 26 Nov 2019 11:55:08 +0100 Subject: [PATCH 2/4] ci: fix wrong variable name in shared.sh's ciCommandAddPath --- src/ci/shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/shared.sh b/src/ci/shared.sh index 98120f5dff9..0bfd7ff26cf 100644 --- a/src/ci/shared.sh +++ b/src/ci/shared.sh @@ -99,7 +99,7 @@ function ciCommandAddPath { if isAzurePipelines; then echo "##vso[task.prependpath]${path}" elif isGitHubActions; then - echo "::add-path::${value}" + echo "::add-path::${path}" else echo "ciCommandAddPath only works inside CI!" exit 1 From 846d386b4d84faa6c5f373d0f608e859239465e8 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 27 Nov 2019 15:19:59 +0100 Subject: [PATCH 3/4] ci: install binutils in msys2 --- src/ci/scripts/install-msys2-packages.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ci/scripts/install-msys2-packages.sh b/src/ci/scripts/install-msys2-packages.sh index 36d9202f7a2..843a2bf2d5e 100755 --- a/src/ci/scripts/install-msys2-packages.sh +++ b/src/ci/scripts/install-msys2-packages.sh @@ -6,7 +6,8 @@ IFS=$'\n\t' source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" if isWindows; then - pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar + pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar \ + binutils # Make sure we use the native python interpreter instead of some msys equivalent # one way or another. The msys interpreters seem to have weird path conversions From 39ddbeb87470071113d03fa7dfc34164180c76d6 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 11 Dec 2019 11:06:40 +0100 Subject: [PATCH 4/4] ci: fix wrong sysroot in macos 10.15 onwards In their infinite wisdom, Apple decided that (starting from macOS 10.15 onwards) /usr/include is not the location we should all search in for our beloved C headers. Instead, we should look inside the extremely intuitive and easily guessable new path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include Because why not. --- src/ci/scripts/install-clang.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ci/scripts/install-clang.sh b/src/ci/scripts/install-clang.sh index f0179994e8e..e16a4814197 100755 --- a/src/ci/scripts/install-clang.sh +++ b/src/ci/scripts/install-clang.sh @@ -14,6 +14,15 @@ if isMacOS; then ciCommandSetEnv CC "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang" ciCommandSetEnv CXX "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang++" + # macOS 10.15 onwards doesn't have libraries in /usr/include anymore: those + # are now located deep into the filesystem, under Xcode's own files. The + # native clang is configured to use the correct path, but our custom one + # doesn't. This sets the SDKROOT environment variable to the SDK so that + # our own clang can figure out the correct include path on its own. + if ! [[ -d "/usr/include" ]]; then + ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)" + fi + # Configure `AR` specifically so rustbuild doesn't try to infer it as # `clang-ar` by accident. ciCommandSetEnv AR "ar"