From 029ec050456091bab7f8ab622ea5cc6d68191123 Mon Sep 17 00:00:00 2001
From: Caleb Zulawski <caleb.zulawski@gmail.com>
Date: Sun, 25 Aug 2024 12:07:25 -0400
Subject: [PATCH] Test RISC-V V extension

---
 .github/workflows/ci.yml | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8b5213376d8..82fa5f9f2f6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -204,11 +204,10 @@ jobs:
         target_feature: [default]
         include:
           - { target: powerpc64le-unknown-linux-gnu, target_feature: "+vsx" }
+          - { target: riscv64gc-unknown-linux-gnu, target_feature: "+v,+zvl128b" }
           # Fails due to QEMU floating point errors, probably handling subnormals incorrectly.
           # This target is somewhat redundant, since ppc64le has altivec as well.
           # - { target: powerpc-unknown-linux-gnu, target_feature: "+altivec" }
-          # We should test this, but cross currently can't run it
-          # - { target: riscv64gc-unknown-linux-gnu, target_feature: "+v,+zvl128b" }
 
     steps:
       - uses: actions/checkout@v2
@@ -216,20 +215,12 @@ jobs:
         run: rustup target add ${{ matrix.target }}
 
       - name: Install Cross
-        # Equivalent to `cargo install cross`, but downloading a prebuilt
-        # binary. Ideally we wouldn't hardcode a version, but the version number
-        # being part of the tarball means we can't just use the download/latest
-        # URL :(
-        run: |
-          CROSS_URL=https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-gnu.tar.gz
-          mkdir -p "$HOME/.bin"
-          curl -sfSL --retry-delay 10 --retry 5 "${CROSS_URL}" | tar zxf - -C "$HOME/.bin"
-          echo "$HOME/.bin" >> $GITHUB_PATH
+        run: cargo install cross --git https://github.com/cross-rs/cross --rev d8631fe4f4e8bb4c4b24417a35544857fb42ee22
 
       - name: Configure Emulated CPUs
         run: |
           echo "CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER=qemu-ppc -cpu e600" >> $GITHUB_ENV
-          # echo "CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER=qemu-riscv64 -cpu rv64,zba=true,zbb=true,v=true,vlen=256,vext_spec=v1.0" >> $GITHUB_ENV
+          echo "CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER=qemu-riscv64 -cpu rv64,zba=true,zbb=true,v=true,vlen=256,vext_spec=v1.0" >> $GITHUB_ENV
 
       - name: Configure RUSTFLAGS
         shell: bash