Skip to content

Commit f48e576

Browse files
committed
Auto merge of #67733 - pietroalbini:gha-2, r=alexcrichton
GitHub Actions: preparations, part 2 This PR adds the second batch of commits in preparation for GitHub Actions: * Removed hardcoded Azure Pipelines variables from `publish_toolstate.sh` * Fixed a bug in `shared.sh`'s GitHub Actions support * Fixed binutils missing from MSYS2 on Windows 2019 (GitHub Actions-specific) * Fixed wrong sysroot in macOS 10.15 onwards (GitHub Actions-specific) This PR does **not** yet add any builders on GitHub Actions. r? @alexcrichton
2 parents 7e393b5 + 39ddbeb commit f48e576

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

src/ci/publish_toolstate.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3-
set -eu
3+
set -euo pipefail
4+
IFS=$'\n\t'
5+
6+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
47

58
# The following lines are also found in src/bootstrap/toolstate.rs,
69
# so if updating here, please also update that file.
@@ -21,7 +24,7 @@ cd rust-toolstate
2124
FAILURE=1
2225
for RETRY_COUNT in 1 2 3 4 5; do
2326
# The purpose is to publish the new "current" toolstate in the toolstate repo.
24-
"$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$GIT_COMMIT" \
27+
"$(ciCheckoutPath)/src/tools/publish_toolstate.py" "$GIT_COMMIT" \
2528
"$GIT_COMMIT_MSG" \
2629
"$MESSAGE_FILE" \
2730
"$TOOLSTATE_REPO_ACCESS_TOKEN"

src/ci/scripts/install-clang.sh

+9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ if isMacOS; then
1414
ciCommandSetEnv CC "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang"
1515
ciCommandSetEnv CXX "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang++"
1616

17+
# macOS 10.15 onwards doesn't have libraries in /usr/include anymore: those
18+
# are now located deep into the filesystem, under Xcode's own files. The
19+
# native clang is configured to use the correct path, but our custom one
20+
# doesn't. This sets the SDKROOT environment variable to the SDK so that
21+
# our own clang can figure out the correct include path on its own.
22+
if ! [[ -d "/usr/include" ]]; then
23+
ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)"
24+
fi
25+
1726
# Configure `AR` specifically so rustbuild doesn't try to infer it as
1827
# `clang-ar` by accident.
1928
ciCommandSetEnv AR "ar"

src/ci/scripts/install-msys2-packages.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ IFS=$'\n\t'
66
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
77

88
if isWindows; then
9-
pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar
9+
pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar \
10+
binutils
1011

1112
# Make sure we use the native python interpreter instead of some msys equivalent
1213
# one way or another. The msys interpreters seem to have weird path conversions

src/ci/shared.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function ciCommandAddPath {
9999
if isAzurePipelines; then
100100
echo "##vso[task.prependpath]${path}"
101101
elif isGitHubActions; then
102-
echo "::add-path::${value}"
102+
echo "::add-path::${path}"
103103
else
104104
echo "ciCommandAddPath only works inside CI!"
105105
exit 1

0 commit comments

Comments
 (0)