Increase recommended Rust toolchain to 1.98.0 - #4075
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe pull request updates the pinned Rust toolchain from 1.97.0 to 1.98.0 and applies compatibility changes to validation errors, procedural macro wrapping, and systemd binding generation. ChangesRust compatibility updates
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change updates the recommended Rust toolchain and related compatibility code; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🔇 Additional comments (4)
rust-toolchain.toml (1)
2-2: LGTM!src/engine/strat_engine/pool/inspection.rs (1)
281-281: LGTM!src/systemd/bindings.rs (1)
10-10: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
⚠️ Unverified finding
Sandbox verification was unavailable.Preserve the declared Rust 1.87 MSRV.
Cargo.tomldeclares Rust 1.87.0 as the lowest supported toolchain. Thesuspicious_runtime_symbol_definitionslint was added in Rust 1.98, while older compilers report unknown lint attributes as warnings. (github.com)If an MSRV build enables
systemd_compatand denies warnings, this attribute can fail compilation. Add#![allow(unknown_lints)]before this line, or otherwise gate the allowance, then verify the Rust 1.87 build.Verification
stratisd_proc_macros/src/lib.rs (1)
155-155: LGTM!
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f903f060-2aef-4bbd-96b7-c845bd211bee
📒 Files selected for processing (4)
rust-toolchain.tomlsrc/engine/strat_engine/pool/inspection.rssrc/systemd/bindings.rsstratisd_proc_macros/src/lib.rs
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
@coderabbitai I believe that the suspicious_runtime_symbol_definition lint was added earlier than 1.87.0. Our CI compiles a bunch of things with the MSRV and they do seem to be compiling. Also I'm worried that the thing flagged by that lint are actually bad. They were auto-generated by bindgen, and maybe it is auto-generating incorrect code. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== PR diff for relevant file =='
git diff --find-renames origin/main...HEAD -- src/systemd/bindings.rs || true
echo '== bindings.rs outline =='
ast-grep outline src/systemd/bindings.rs --items all || true
echo '== crate attributes and suspicious symbols =='
rg -n -C 4 'suspicious_runtime_symbol_definition|no_mangle|export_name|link_name|#[[:space:]]*\[unsafe' src/systemd/bindings.rs || true
echo '== bindgen-related configuration and locked version =='
rg -n -i -C 3 'bindgen|systemd' Cargo.toml Cargo.lock build.rs src stratisd_proc_macros 2>/dev/null || trueLength of output: 33012 🤖 web_search executed:
Length of output: 16421 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== src/systemd/bindings.rs =='
cat -n src/systemd/bindings.rs
echo '== systemd binding generator =='
sed -n '1,80p' build.rs
echo '== current commit metadata and relevant parent diff =='
git show --no-ext-diff --format=fuller --no-renames HEAD -- src/systemd/bindings.rs
git diff --no-ext-diff --no-renames HEAD^ HEAD -- src/systemd/bindings.rs || true
echo '== generated binding include and declarations referenced by wrapper =='
rg -n -C 5 'include!|strlen|memcpy|memmove|memset|memcmp|bcmp|open|read|write|close|malloc|realloc|free|exit' src/systemd build.rsLength of output: 5412
The lint can flag an imported C declaration such as I could not inspect the exact generated declaration because ✏️ Learnings added
You are interacting with an AI system. |
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
@coderabbitai You were correct, suspicious_runtime_symbols_definitions was introduced after Rust 1.87.0. However, you are the bearer of bad news: since you are correct that proves that the jobs that are supposed to compile with the MSRV are compiling with a newer version instead, i.e., there is a bug in our CI and that needs to be fixed. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Candidate CI workflow files =='
fd -HI -t f -E .git '.*\.(yml|yaml)$|.*\.toml$' .github . 2>/dev/null | sort || true
echo '== MSRV and toolchain references in workflow/configuration files =='
rg -n -i -C 4 \
'msrv|minimum.*rust|rust-version|rustup.*toolchain|toolchain:|1\.87\.0|cargo \+|RUSTUP_TOOLCHAIN|rust-toolchain' \
.github Cargo.toml Cargo.lock rust-toolchain.toml 2>/dev/null || true
echo '== Warning and lint policy =='
rg -n -i -C 4 \
'unknown_lints|warnings|deny\(warnings\)|-D\s*warnings|--deny[= ]warnings|RUSTFLAGS|cap-lints' \
.github Cargo.toml rust-toolchain.toml src stratisd_proc_macros 2>/dev/null || true
echo '== Relevant changed configuration =='
cat -n rust-toolchain.toml
printf '\n== bindings crate attributes ==\n'
sed -n '1,50p' src/systemd/bindings.rsLength of output: 18290
The MSRV build succeeds because #![allow(unknown_lints)]This attribute precedes: #![allow(suspicious_runtime_symbol_definitions)]Rust 1.87.0 does not know Therefore, the passing MSRV jobs do not indicate that they use Rust 1.98.0. The new allowance remains compatible with Rust 1.87.0. You are interacting with an AI system. |
When generating systemd bindings, specify only the functions that stratisd uses. This avoids compiler and clippy warnings that seem important but are actually irrelevant. Signed-off-by: the Mulhern <amulhern@amulhern.bos.csb>
|
@coderabbitai review |
✅ Action performedReview finished.
|
@coderabbitai I decided just to allow the functions stratisd uses, of which there are exactly two which use fundamental types. So none of the clippy or compiler lints that previously affected the generated code are triggered and the generated code is only about 8 lines worth. Seems like an improvement. What do you think? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Relevant PR diff =='
git diff --no-ext-diff --unified=80 origin/main...HEAD -- \
build.rs src/systemd/bindings.rs src/systemd rust-toolchain.toml Cargo.toml || true
echo '== build.rs structure =='
ast-grep outline build.rs --items all || true
echo '== systemd module structure =='
ast-grep outline src/systemd --items all || true
echo '== bindgen configuration and binding inclusion =='
rg -n -C 6 \
'bindgen|allowlist_function|blocklist|generate\(|write_to_file|include!' \
build.rs src/systemd
echo '== Declarations and call sites for allowed systemd functions =='
rg -n -C 5 '\b(sd_notify|syslog)\s*\(' src build.rs
echo '== Lint attributes in generated-binding wrapper =='
rg -n -C 4 '#!\[(allow|deny|warn)' src/systemd/bindings.rs || trueLength of output: 5426
This change has three benefits:
The direct call sites match the allowlist:
The smaller generated file also makes future binding changes easier to inspect. I support this approach. ✏️ Learnings added
You are interacting with an AI system. |
Related stratis-storage/project#888