Skip to content

Commit 7dfc61f

Browse files
authored
Increment Sail version, and consolidate version usage in CI. (#1963)
Make the `sail-setup` action use the Sail version in `cmake/sail_required_version.txt` by default. --------- Signed-off-by: Prashanth Mundkur <prashanth@riscv.org>
1 parent 5e2ebde commit 7dfc61f

7 files changed

Lines changed: 30 additions & 17 deletions

File tree

‎.github/actions/sail-setup/action.yml‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ inputs:
88
sail-version:
99
description: 'Sail version to install (use "latest" to build from source)'
1010
required: false
11-
default: "0.20.2"
1211
install-clang:
1312
description: "Install latest Clang"
1413
required: false
1514
default: "false"
1615

16+
# The 'default' Sail version below is the one specified in `cmake/sail_required_version.txt`.
1717
# This is the current CI Platform/Target support matrix:
1818
#
1919
# | RISC-V Model |sail-riscv-tests|first-party-tests| Rocq | Lean | Linux boot
@@ -93,33 +93,43 @@ runs:
9393
cmake_suffix="universal"
9494
fi
9595
curl --location https://github.com/Kitware/CMake/releases/download/v${{ inputs.cmake-version }}/cmake-${{ inputs.cmake-version }}-${{ runner.os }}-$cmake_suffix.tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
96+
97+
- name: Set Sail version
98+
shell: bash
99+
run: |
100+
if [ -n ${{ inputs.sail-version }} ]; then
101+
echo "SAIL_VERSION=$(cat cmake/sail_required_version.txt)" >> $GITHUB_ENV
102+
else
103+
echo "SAIL_VERSION=${{ inputs.sail-version }}" >> $GITHUB_ENV
104+
fi
105+
96106
- name: Restore cached opam (macOS or latest Sail)
97-
if: runner.os == 'macOS' || inputs.sail-version == 'latest'
107+
if: runner.os == 'macOS' || env.SAIL_VERSION == 'latest'
98108
id: cache-opam-restore
99109
uses: actions/cache/restore@v4
100110
with:
101111
path: ~/.opam
102-
key: ${{ runner.os }}-${{ runner.arch }}-cmake-${{ inputs.cmake-version }}-sail-${{ inputs.sail-version }}-opam
112+
key: ${{ runner.os }}-${{ runner.arch }}-cmake-${{ inputs.cmake-version }}-sail-${{ env.SAIL_VERSION }}-opam
103113

104114
- name: Install Sail (Linux binary)
105-
if: runner.os == 'Linux' && inputs.sail-version != 'latest'
115+
if: runner.os == 'Linux' && env.SAIL_VERSION != 'latest'
106116
shell: bash
107117
run: |
108118
sudo mkdir -p /usr/local
109-
curl --location https://github.com/rems-project/sail/releases/download/${{ inputs.sail-version }}-binary/sail-$(uname)-$(arch).tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
119+
curl --location https://github.com/rems-project/sail/releases/download/${{ env.SAIL_VERSION }}-binary/sail-$(uname)-$(arch).tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
110120
111121
- name: Install Sail (macOS opam)
112-
if: runner.os == 'macOS' && steps.cache-opam-restore.outputs.cache-hit != 'true' && inputs.sail-version != 'latest'
122+
if: runner.os == 'macOS' && steps.cache-opam-restore.outputs.cache-hit != 'true' && env.SAIL_VERSION != 'latest'
113123
shell: bash
114124
run: |
115125
opam init --auto-setup --bare
116126
opam switch create default 5.3.0
117127
eval $(opam env)
118128
opam update
119-
opam install -y sail.${{ inputs.sail-version }}
129+
opam install -y sail.${{ env.SAIL_VERSION }}
120130
121131
- name: Install opam (latest Sail)
122-
if: inputs.sail-version == 'latest'
132+
if: env.SAIL_VERSION == 'latest'
123133
shell: bash
124134
run: |
125135
if [ "${{ runner.os }}" = "Linux" ]; then
@@ -129,14 +139,14 @@ runs:
129139
fi
130140
131141
- name: Setup opam (latest Sail)
132-
if: inputs.sail-version == 'latest' && steps.cache-opam-restore.outputs.cache-hit != 'true'
142+
if: env.SAIL_VERSION == 'latest' && steps.cache-opam-restore.outputs.cache-hit != 'true'
133143
shell: bash
134144
run: |
135145
opam init --yes --no-setup --shell=sh --compiler=5.3.0
136146
opam install dune
137147
138148
- name: Install Sail (latest Sail)
139-
if: inputs.sail-version == 'latest'
149+
if: env.SAIL_VERSION == 'latest'
140150
shell: bash
141151
run: |
142152
git clone https://github.com/rems-project/sail.git
@@ -146,7 +156,7 @@ runs:
146156
147157
- name: Save cached opam (macOS or latest Sail)
148158
# Update cache only on the master branch
149-
if: (runner.os == 'macOS' || inputs.sail-version == 'latest') && github.ref == 'refs/heads/master'
159+
if: (runner.os == 'macOS' || env.SAIL_VERSION == 'latest') && github.ref == 'refs/heads/master'
150160
id: cache-opam-save
151161
uses: actions/cache/save@v4
152162
with:

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ jobs:
5858

5959
- name: Get tests version
6060
run: |
61-
SAIL_RISCV_TESTS_VERSION=$(cat test/sail_riscv_tests_version.txt)
62-
echo "SAIL_RISCV_TESTS_VERSION=$SAIL_RISCV_TESTS_VERSION" >> $GITHUB_ENV
61+
echo "SAIL_RISCV_TESTS_VERSION=$(cat test/sail_riscv_tests_version.txt)" >> $GITHUB_ENV
6362
6463
- name: Restore cached tests
6564
uses: actions/cache/restore@v6

‎.github/workflows/release.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
container: ${{ matrix.container }}
5252

5353
env:
54-
SAIL_VERSION: "0.20.2"
5554
# This helps with reproducible builds by not embedding variable timestamps in files.
5655
# This is needed in particular for the Debian package's compressed changelog.
5756
# See the comments in `cmake/packaging.cmake`.

‎.github/workflows/run-full-tests.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,24 @@ jobs:
3232
RISCV_VECTOR_TESTS_V256_E64,
3333
RISCV_VECTOR_TESTS_V512_E64,
3434
]
35+
3536
steps:
3637
- name: Check out repository code
3738
uses: actions/checkout@v7
3839
with:
3940
# Git history is needed for `git describe` in the build to work.
4041
fetch-depth: 0
42+
4143
- name: Common setup
4244
uses: ./.github/actions/sail-setup
4345
with:
4446
install-clang: "true"
47+
4548
- name: Build simulator
4649
run: |
4750
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_${{ matrix.TEST_SUITE }}=TRUE -DENABLE_LTO=TRUE
4851
ninja -C build all
52+
4953
- name: Run tests
5054
run: |
5155
ctest --test-dir build --output-on-failure

‎README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ $ ./build_simulator.sh
8383

8484
will build the simulator at `build/c_emulator/sail_riscv_sim`.
8585

86-
If you get an error message saying `sail: unknown option '--require-version'.` it's because your Sail compiler is too old. You need version 0.20.2 or later.
87-
8886
By default [`build_simulator.sh`](./build_simulator.sh) will download and build [libgmp](https://gmplib.org).
8987
To use a system installation of libgmp, run `env DOWNLOAD_GMP=FALSE ./build_simulator.sh` instead.
9088

‎cmake/sail_required_version.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.20.2
1+
0.20.3

‎doc/ChangeLog.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- Whether the `mcountinhibit` CSR is supported, and if so, which
99
bits are writable, can now be specified; see `base.mcountinhibit`.
1010

11+
- Other notes:
12+
- The model now requires the Sail 0.20.3 compiler version.
13+
1114
# Release notes for version 0.14.1
1215

1316
This is primarily a bug-fix release with fixes for the issues listed

0 commit comments

Comments
 (0)