File tree 2 files changed +44
-4
lines changed
2 files changed +44
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ on: [push, pull_request]
4
4
env :
5
5
RUSTDOCFLAGS : -Dwarnings
6
6
RUSTFLAGS : -Dwarnings
7
+ RUST_LLVM_VERSION : 18.0-2024-02-13
8
+ RUST_COMPILER_RT_ROOT : ./compiler-rt
7
9
8
10
jobs :
9
11
test :
@@ -115,12 +117,18 @@ jobs:
115
117
path : /tmp/.buildx-cache
116
118
key : ${{ matrix.target }}-buildx-${{ github.sha }}
117
119
restore-keys : ${{ matrix.target }}-buildx-
118
-
120
+
121
+ - name : Cache compiler-rt
122
+ id : cache-compiler-rt
123
+ uses : actions/cache@v4
124
+ with :
125
+ path : compiler-rt
126
+ key : ${{ runner.os }}-compiler-rt-${{ env.RUST_LLVM_VERSION }}
119
127
- name : Download compiler-rt reference sources
128
+ if : steps.cache-compiler-rt.outputs.cache-hit != 'true'
120
129
run : |
121
- curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/18.0-2024-02-13.tar.gz
122
- tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-18.0-2024-02-13/compiler-rt
123
- echo RUST_COMPILER_RT_ROOT=./compiler-rt >> $GITHUB_ENV
130
+ curl -L -o code.tar.gz "https://github.com/rust-lang/llvm-project/archive/rustc/${RUST_LLVM_VERSION}.tar.gz"
131
+ tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-${RUST_LLVM_VERSION}/compiler-rt
124
132
shell : bash
125
133
126
134
# Non-linux tests just use our raw script
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Download LLVM's compiler-rt only if it does not exist or is out of date
4
+
5
+ set -eauxo pipefail
6
+
7
+ url=" https://github.com/rust-lang/llvm-project/archive/rustc/18.0-2024-02-13.tar.gz"
8
+ rt_path=" llvm-project-rustc-18.0-2024-02-13/compiler-rt"
9
+ expected_sha=" "
10
+
11
+ download () {
12
+ curl -L -o code.tar.gz " $url "
13
+ tar xzf code.tar.gz --strip-components 1 " $rt_path "
14
+ }
15
+
16
+ existing_hash=$(
17
+ find compiler-rt -type f -print0 |
18
+ sort -z |
19
+ xargs -0 shasum -a 256 |
20
+ shasum -U -a 256 |
21
+ cut -d' ' ' -f1 |
22
+ tr -d ' \n '
23
+ )
24
+
25
+ if [ "$existing_hash" = "$expected_sha" ]; then
26
+ echo "Got expected sha ' $expected_sha ' ; nothing to do"
27
+ exit
28
+ fi
29
+
30
+ echo "Got $existing_hash; expected $expected_sha. Downloading"
31
+
32
+ download()
You can’t perform that action at this time.
0 commit comments