File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 os : ubuntu-24.04
2323 steps :
2424 - uses : actions/checkout@v6
25- - name : Install Rust
26- run : rustup update nightly --no-self-update && rustup default nightly
25+ - name : Install Dependencies
26+ run : |
27+ rustup update nightly --no-self-update
28+ rustup default nightly
29+ sudo apt-get install -y llvm # Needed to build the C++ APFloat
30+ - name : Download llvm source
31+ run : ./etc/download-llvm.sh
32+ # This should also cache LLVM since it downloads to `target/llvm-downloads`
2733 - uses : Swatinem/rust-cache@v2
34+ with :
35+ key : ${{ matrix.target }}
36+
2837 - name : Build and run tests
2938 run : cargo test --workspace
3039
4857 - uses : Swatinem/rust-cache@v2
4958 - run : |
5059 # strip the fuzz crate that uses a newer edition
51- sed '/members =/d' Cargo.toml
60+ sed -i '/members =/d' Cargo.toml
5261 cargo build --package rustc_apfloat
5362
5463 rustfmt :
Original file line number Diff line number Diff line change @@ -12,8 +12,13 @@ version="$(
1212llvm_hash=" ${version##* -} "
1313
1414target_dir=" ${CARGO_TARGET_DIR:- target} "
15- out_dir=" $target_dir /llvm-downloads/ "
15+ out_dir=" $target_dir /llvm-downloads"
1616mkdir -p " $out_dir "
1717
18+ if [ -d " $out_dir /llvm-project-$llvm_hash " ] && [ " ${1:- } " != " -f" ]; then
19+ echo Download already exists. Pass ' -f' to overwrite.
20+ exit
21+ fi
22+
1823tgz_url=" https://codeload.github.com/llvm/llvm-project/tar.gz/$llvm_hash "
1924curl -sS " $tgz_url " | tar -C " $out_dir " -xz
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ class FloatEval {
127127 rm = APFloat::rmNearestTiesToAway;
128128 break ;
129129 default :
130- printf (" unsupported rounding mode %d\n " , rm );
130+ printf (" unsupported rounding mode %d\n " , static_cast < int8_t >(rm) );
131131 exit (1 );
132132 }
133133
@@ -175,7 +175,7 @@ class FloatEval {
175175 a.convert (sem, rm, &cvt_exact);
176176 break ;
177177 default :
178- printf (" unrecognized op tag %d" , tag);
178+ printf (" unrecognized op tag %d" , static_cast < int8_t >( tag) );
179179 exit (1 );
180180 }
181181
You can’t perform that action at this time.
0 commit comments