Skip to content

Commit 49c4b6f

Browse files
authored
Upgrade toolchain to 2025-03-18 (#3959)
The main change to get the toolchain upgrade to 2025-03-18 to work is to make this change in `kani-regression.sh`: ```diff -RUSTFLAGS="-D warnings" cargo build --target-dir /tmp/kani_build_warnings +RUSTFLAGS="-D warnings" cargo build --target-dir /tmp/kani_build_warnings --no-default-features --features cprover ``` Explanation: 1. `cargo build` suppresses warnings from dependencies unless they're local dependencies (e.g. included with `path = ...`) (see rust-lang/cargo#8546) 2. Since we integrate `charon` as a git submodule and add it as a dependency using `path = ...`, its warnings are not suppressed 3. The toolchain upgrade includes adding a `#[must_use]` attribute on an enum used in charon: rust-lang/rust@2439623278. This results in a warning that causes the `RUSTFLAGS="-D warnings" cargo build` to fail: https://github.com/model-checking/kani/actions/runs/13914318184/job/38934470822#step:4:2983 The short-term solution in this PR is to exclude the Charon feature when building with `-D warnings`. The long-term solution is to fix the warning in upstream Charon (if it's not already fixed), and update our Charon pin to point to a commit that includes the fix. Updating the Charon pin requires us to upgrade our MIR to ULLBC module though, which will require a non-trivial amount of work since it's 2.5 months old. Resolves #3944 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent c0b3286 commit 49c4b6f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

kani-compiler/src/kani_compiler.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub fn run(args: Vec<String>) {
4141
}
4242

4343
/// Configure the LLBC backend (Aeneas's IR).
44+
#[allow(unused)]
4445
fn llbc_backend(_queries: Arc<Mutex<QueryDb>>) -> Box<dyn CodegenBackend> {
4546
#[cfg(feature = "llbc")]
4647
return Box::new(LlbcCodegenBackend::new(_queries));
@@ -49,6 +50,7 @@ fn llbc_backend(_queries: Arc<Mutex<QueryDb>>) -> Box<dyn CodegenBackend> {
4950
}
5051

5152
/// Configure the cprover backend that generates goto-programs.
53+
#[allow(unused)]
5254
fn cprover_backend(_queries: Arc<Mutex<QueryDb>>) -> Box<dyn CodegenBackend> {
5355
#[cfg(feature = "cprover")]
5456
return Box::new(GotocCodegenBackend::new(_queries));

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
[toolchain]
5-
channel = "nightly-2025-03-17"
5+
channel = "nightly-2025-03-18"
66
components = ["llvm-tools", "rustc-dev", "rust-src", "rustfmt"]

scripts/kani-regression.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ cargo clean --manifest-path "$FEATURES_MANIFEST_PATH"
105105
# Setting RUSTFLAGS like this always resets cargo's build cache resulting in
106106
# all tests to be re-run. I.e., cannot keep re-runing the regression from where
107107
# we stopped.
108-
RUSTFLAGS="-D warnings" cargo build --target-dir /tmp/kani_build_warnings
108+
# Only run with the `cprover` feature to avoid compiling the `charon` library
109+
# which is not our code and may have warnings. The downside is that we wouldn't
110+
# detect any warnings in the charon code path. TODO: Remove
111+
# `--no-default-features --features cprover` when the warnings in charon are
112+
# fixed and we advance the charon pin to that version
113+
RUSTFLAGS="-D warnings" cargo build --target-dir /tmp/kani_build_warnings --no-default-features --features cprover
109114

110115
echo
111116
echo "All Kani regression tests completed successfully."

0 commit comments

Comments
 (0)