Skip to content

Commit 5185c04

Browse files
committed
Merge remote-tracking branch 'origin/main' into issue-2998-ub-rfc
Conflicts: - rfc/src/SUMMARY.md
2 parents aef9cb8 + 5a6a5f3 commit 5185c04

561 files changed

Lines changed: 10432 additions & 10312 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bench.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ jobs:
5555
os: ubuntu-20.04
5656
kani_dir: new
5757

58-
- name: Build Kani (new variant)
59-
run: pushd new && cargo build-dev
60-
61-
- name: Build Kani (old variant)
62-
run: pushd old && cargo build-dev
63-
6458
- name: Copy benchmarks from new to old
6559
run: rm -rf ./old/tests/perf ; cp -r ./new/tests/perf ./old/tests/
6660

.github/workflows/cbmc-latest.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ jobs:
3232
os: ${{ matrix.os }}
3333
kani_dir: 'kani'
3434

35-
- name: Build Kani
36-
working-directory: ./kani
37-
run: cargo build-dev
38-
3935
- name: Checkout CBMC under "cbmc"
4036
uses: actions/checkout@v4
4137
with:

.github/workflows/cbmc-update.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
env:
3131
GH_TOKEN: ${{ github.token }}
3232
run: |
33-
grep ^CBMC_VERSION kani-dependencies >> $GITHUB_ENV
33+
grep ^CBMC_VERSION kani-dependencies | sed 's/"//g' >> $GITHUB_ENV
3434
CBMC_LATEST=$(gh -R diffblue/cbmc release list | grep Latest | awk '{print $1}' | cut -f2 -d-)
3535
echo "CBMC_LATEST=$CBMC_LATEST" >> $GITHUB_ENV
3636
# check whether the version has changed at all
@@ -47,8 +47,8 @@ jobs:
4747
elif ! git ls-remote --exit-code origin cbmc-$CBMC_LATEST ; then
4848
CBMC_LATEST_MAJOR=$(echo $CBMC_LATEST | cut -f1 -d.)
4949
CBMC_LATEST_MINOR=$(echo $CBMC_LATEST | cut -f2 -d.)
50-
sed -i "s/^CBMC_MAJOR=.*/CBMC_MAJOR=\"$CBMC_MAJOR\"/" kani-dependencies
51-
sed -i "s/^CBMC_MINOR=.*/CBMC_MINOR=\"$CBMC_MINOR\"/" kani-dependencies
50+
sed -i "s/^CBMC_MAJOR=.*/CBMC_MAJOR=\"$CBMC_LATEST_MAJOR\"/" kani-dependencies
51+
sed -i "s/^CBMC_MINOR=.*/CBMC_MINOR=\"$CBMC_LATEST_MINOR\"/" kani-dependencies
5252
sed -i "s/^CBMC_VERSION=.*/CBMC_VERSION=\"$CBMC_LATEST\"/" kani-dependencies
5353
git diff
5454
if ! ./scripts/kani-regression.sh ; then
@@ -79,7 +79,7 @@ jobs:
7979
token: ${{ github.token }}
8080
title: 'CBMC upgrade to ${{ env.CBMC_LATEST }} failed'
8181
body: >
82-
Updating CBMC from ${{ evn.CBMC_VERSION }} to ${{ env.CBMC_LATEST }} failed.
82+
Updating CBMC from ${{ env.CBMC_VERSION }} to ${{ env.CBMC_LATEST }} failed.
8383
8484
The failed automated run
8585
[can be found here.](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})

.github/workflows/kani-m1.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/kani.yml

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
20-
os: [macos-13, ubuntu-20.04, ubuntu-22.04]
20+
os: [macos-13, ubuntu-20.04, ubuntu-22.04, macos-14]
2121
steps:
2222
- name: Checkout Kani
2323
uses: actions/checkout@v4
@@ -27,9 +27,6 @@ jobs:
2727
with:
2828
os: ${{ matrix.os }}
2929

30-
- name: Build Kani
31-
run: cargo build-dev
32-
3330
- name: Execute Kani regression
3431
run: ./scripts/kani-regression.sh
3532

@@ -88,47 +85,19 @@ jobs:
8885
with:
8986
os: ubuntu-20.04
9087

91-
- name: Build Kani using release mode
92-
run: cargo build-dev -- --release
93-
9488
- name: Execute Kani performance tests
9589
run: ./scripts/kani-perf.sh
9690
env:
9791
RUST_TEST_THREADS: 1
9892

99-
bookrunner:
93+
documentation:
10094
runs-on: ubuntu-20.04
10195
permissions:
10296
contents: write
10397
steps:
10498
- name: Checkout Kani
10599
uses: actions/checkout@v4
106100

107-
- name: Setup Kani Dependencies
108-
uses: ./.github/actions/setup
109-
with:
110-
os: ubuntu-20.04
111-
112-
- name: Build Kani
113-
run: cargo build-dev
114-
115-
- name: Install book runner dependencies
116-
run: ./scripts/setup/install_bookrunner_deps.sh
117-
118-
- name: Generate book runner report
119-
run: cargo run -p bookrunner
120-
env:
121-
DOC_RUST_LANG_ORG_CHANNEL: nightly
122-
123-
- name: Print book runner text results
124-
run: cat build/output/latest/html/bookrunner.txt
125-
126-
- name: Print book runner failures grouped by stage
127-
run: python3 scripts/ci/bookrunner_failures_by_stage.py build/output/latest/html/index.html
128-
129-
- name: Detect unexpected book runner failures
130-
run: ./scripts/ci/detect_bookrunner_failures.sh build/output/latest/html/bookrunner.txt
131-
132101
- name: Install book dependencies
133102
run: ./scripts/setup/ubuntu/install_doc_deps.sh
134103

.github/workflows/release.yml

Lines changed: 128 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,32 @@ jobs:
4444
os: macos-13
4545
arch: x86_64-apple-darwin
4646

47+
build_bundle_macos_aarch64:
48+
name: BuildBundle-MacOs-ARM
49+
runs-on: macos-14
50+
permissions:
51+
contents: write
52+
outputs:
53+
version: ${{ steps.bundle.outputs.version }}
54+
bundle: ${{ steps.bundle.outputs.bundle }}
55+
package: ${{ steps.bundle.outputs.package }}
56+
crate_version: ${{ steps.bundle.outputs.crate_version }}
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@v4
60+
61+
- name: Setup Kani Dependencies
62+
uses: ./.github/actions/setup
63+
with:
64+
os: macos-14
65+
66+
- name: Build bundle
67+
id: bundle
68+
uses: ./.github/actions/build-bundle
69+
with:
70+
os: macos-14
71+
arch: aarch64-apple-darwin
72+
4773
build_bundle_linux:
4874
name: BuildBundle-Linux
4975
runs-on: ubuntu-20.04
@@ -82,7 +108,7 @@ jobs:
82108
build-essential bash-completion curl lsb-release sudo g++ gcc flex \
83109
bison make patch git python3.7 python3.7-dev python3.7-distutils
84110
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
85-
curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py
111+
curl -s https://bootstrap.pypa.io/pip/3.7/get-pip.py -o get-pip.py
86112
python3 get-pip.py --force-reinstall
87113
rm get-pip.py
88114
@@ -101,6 +127,106 @@ jobs:
101127
os: linux
102128
arch: x86_64-unknown-linux-gnu
103129

130+
test-use-local-toolchain:
131+
name: TestLocalToolchain
132+
needs: [build_bundle_macos, build_bundle_linux]
133+
strategy:
134+
matrix:
135+
os: [macos-13, ubuntu-20.04, ubuntu-22.04]
136+
include:
137+
- os: macos-13
138+
rust_target: x86_64-apple-darwin
139+
prev_job: ${{ needs.build_bundle_macos.outputs }}
140+
- os: ubuntu-20.04
141+
rust_target: x86_64-unknown-linux-gnu
142+
prev_job: ${{ needs.build_bundle_linux.outputs }}
143+
- os: ubuntu-22.04
144+
rust_target: x86_64-unknown-linux-gnu
145+
prev_job: ${{ needs.build_bundle_linux.outputs }}
146+
runs-on: ${{ matrix.os }}
147+
steps:
148+
- name: Download bundle
149+
uses: actions/download-artifact@v3
150+
with:
151+
name: ${{ matrix.prev_job.bundle }}
152+
153+
- name: Download kani-verifier crate
154+
uses: actions/download-artifact@v3
155+
with:
156+
name: ${{ matrix.prev_job.package }}
157+
158+
- name: Check download
159+
run: |
160+
ls -lh .
161+
162+
- name: Get toolchain version used to setup kani
163+
run: |
164+
tar zxvf ${{ matrix.prev_job.bundle }}
165+
DATE=$(cat ./kani-${{ matrix.prev_job.version }}/rust-toolchain-version | cut -d'-' -f2,3,4)
166+
echo "Nightly date: $DATE"
167+
echo "DATE=$DATE" >> $GITHUB_ENV
168+
169+
- name: Install Kani from path
170+
run: |
171+
tar zxvf ${{ matrix.prev_job.package }}
172+
cargo install --locked --path kani-verifier-${{ matrix.prev_job.crate_version }}
173+
174+
- name: Create a custom toolchain directory
175+
run: mkdir -p ${{ github.workspace }}/../custom_toolchain
176+
177+
- name: Fetch the nightly tarball
178+
run: |
179+
echo "Downloading Rust toolchain from rust server."
180+
curl --proto '=https' --tlsv1.2 -O https://static.rust-lang.org/dist/$DATE/rust-nightly-${{ matrix.rust_target }}.tar.gz
181+
tar -xzf rust-nightly-${{ matrix.rust_target }}.tar.gz
182+
./rust-nightly-${{ matrix.rust_target }}/install.sh --prefix=${{ github.workspace }}/../custom_toolchain
183+
184+
- name: Ensure installation is correct
185+
run: |
186+
cargo kani setup --use-local-bundle ./${{ matrix.prev_job.bundle }} --use-local-toolchain ${{ github.workspace }}/../custom_toolchain/
187+
188+
- name: Ensure that the rustup toolchain is not present
189+
run: |
190+
if [ ! -e "~/.rustup/toolchains/" ]; then
191+
echo "Default toolchain file does not exist. Proceeding with running tests."
192+
else
193+
echo "::error::Default toolchain exists despite not installing."
194+
exit 1
195+
fi
196+
197+
- name: Checkout tests
198+
uses: actions/checkout@v4
199+
200+
- name: Move rust-toolchain file to outside kani
201+
run: |
202+
mkdir -p ${{ github.workspace }}/../post-setup-tests
203+
cp -r tests/cargo-ui ${{ github.workspace }}/../post-setup-tests
204+
cp -r tests/kani/Assert ${{ github.workspace }}/../post-setup-tests
205+
ls ${{ github.workspace }}/../post-setup-tests
206+
207+
- name: Run cargo-kani tests after moving
208+
run: |
209+
for dir in supported-lib-types/rlib multiple-harnesses verbose; do
210+
>&2 echo "Running test $dir"
211+
pushd ${{ github.workspace }}/../post-setup-tests/cargo-ui/$dir
212+
cargo kani
213+
popd
214+
done
215+
216+
- name: Check --help and --version
217+
run: |
218+
>&2 echo "Running cargo kani --help and --version"
219+
pushd ${{ github.workspace }}/../post-setup-tests/Assert
220+
cargo kani --help && cargo kani --version
221+
popd
222+
223+
- name: Run standalone kani test
224+
run: |
225+
>&2 echo "Running test on file bool_ref"
226+
pushd ${{ github.workspace }}/../post-setup-tests/Assert
227+
kani bool_ref.rs
228+
popd
229+
104230
test_bundle:
105231
name: TestBundle
106232
needs: [build_bundle_macos, build_bundle_linux]
@@ -284,7 +410,7 @@ jobs:
284410
OWNER: '${{ github.repository_owner }}'
285411

286412
- name: Build and push
287-
uses: docker/build-push-action@v5
413+
uses: docker/build-push-action@v6
288414
with:
289415
context: .
290416
file: scripts/ci/Dockerfile.bundle-release-20-04

.github/workflows/toolchain-upgrade.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,11 @@ jobs:
3030
env:
3131
GH_TOKEN: ${{ github.token }}
3232
run: |
33-
current_toolchain_date=$(grep ^channel rust-toolchain.toml | sed 's/.*nightly-\(.*\)"/\1/')
34-
echo "current_toolchain_date=$current_toolchain_date" >> $GITHUB_ENV
35-
current_toolchain_epoch=$(date --date $current_toolchain_date +%s)
36-
next_toolchain_date=$(date --date "@$(($current_toolchain_epoch + 86400))" +%Y-%m-%d)
37-
echo "next_toolchain_date=$next_toolchain_date" >> $GITHUB_ENV
38-
if gh issue list -S \
39-
"Toolchain upgrade to nightly-$next_toolchain_date failed" \
40-
--json number,title | grep title ; then
41-
echo "next_step=none" >> $GITHUB_ENV
42-
elif ! git ls-remote --exit-code origin toolchain-$next_toolchain_date ; then
43-
echo "next_step=create_pr" >> $GITHUB_ENV
44-
sed -i "/^channel/ s/$current_toolchain_date/$next_toolchain_date/" rust-toolchain.toml
45-
git diff
46-
git clone --filter=tree:0 https://github.com/rust-lang/rust rust.git
47-
cd rust.git
48-
current_toolchain_hash=$(curl https://static.rust-lang.org/dist/$current_toolchain_date/channel-rust-nightly-git-commit-hash.txt)
49-
echo "current_toolchain_hash=$current_toolchain_hash" >> $GITHUB_ENV
50-
next_toolchain_hash=$(curl https://static.rust-lang.org/dist/$next_toolchain_date/channel-rust-nightly-git-commit-hash.txt)
51-
echo "next_toolchain_hash=$next_toolchain_hash" >> $GITHUB_ENV
52-
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
53-
echo "git_log<<$EOF" >> $GITHUB_ENV
54-
git log --oneline $current_toolchain_hash..$next_toolchain_hash | \
55-
sed 's#^#https://github.com/rust-lang/rust/commit/#' >> $GITHUB_ENV
56-
echo "$EOF" >> $GITHUB_ENV
57-
cd ..
58-
rm -rf rust.git
59-
if ! cargo build-dev ; then
60-
echo "next_step=create_issue" >> $GITHUB_ENV
61-
else
62-
if ! ./scripts/kani-regression.sh ; then
63-
echo "next_step=create_issue" >> $GITHUB_ENV
64-
fi
65-
fi
66-
else
67-
echo "next_step=none" >> $GITHUB_ENV
68-
fi
33+
source scripts/toolchain_update.sh
34+
35+
- name: Clean untracked files
36+
run: git clean -f
37+
6938
- name: Create Pull Request
7039
if: ${{ env.next_step == 'create_pr' }}
7140
uses: peter-evans/create-pull-request@v6

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ no_llvm_build
4848
/tmp/
4949
# Created by default with `src/ci/docker/run.sh`
5050
/obj/
51+
# Created by kani-compiler
52+
*.rlib
53+
*.rmeta
54+
*.mir
5155

5256
## Temporary files
5357
*~
@@ -74,10 +78,8 @@ package-lock.json
7478
tests/rustdoc-gui/src/**.lock
7579

7680
# Before adding new lines, see the comment at the top.
77-
/.litani_cache_dir
7881
/.ninja_deps
7982
/.ninja_log
80-
/tests/bookrunner
8183
*Cargo.lock
8284
tests/kani-dependency-test/diamond-dependency/build
8385
tests/kani-multicrate/type-mismatch/mismatch/target

.gitmodules

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
[submodule "src/doc/nomicon"]
2-
path = tools/bookrunner/rust-doc/nomicon
3-
url = https://github.com/rust-lang/nomicon.git
4-
[submodule "src/doc/reference"]
5-
path = tools/bookrunner/rust-doc/reference
6-
url = https://github.com/rust-lang/reference.git
7-
[submodule "src/doc/rust-by-example"]
8-
path = tools/bookrunner/rust-doc/rust-by-example
9-
url = https://github.com/rust-lang/rust-by-example.git
101
[submodule "firecracker"]
112
path = firecracker
123
url = https://github.com/firecracker-microvm/firecracker.git

0 commit comments

Comments
 (0)