CMake: Helpful error message when Rust version too old#1481
Draft
val-ms wants to merge 1 commit intoCisco-Talos:mainfrom
Draft
CMake: Helpful error message when Rust version too old#1481val-ms wants to merge 1 commit intoCisco-Talos:mainfrom
val-ms wants to merge 1 commit intoCisco-Talos:mainfrom
Conversation
3e8b463 to
9caa738
Compare
9caa738 to
4f361f2
Compare
51f37c2 to
30703cd
Compare
It isn't obvious if a build fails because the Rust version is too low.
The FindRust.cmake module already has logic to check the min supported
Rus version. This commit make use of that, adding a Rust version var at
the top of CMakeLists.txt. We will have to update it any time we run
`cargo update`, before releasing a new feature version.
If your Rust version is too low (or you artificially crank up the min
version for testing, the error will look like this:
-- Rust tool `cargo` found: /home/micah/.cargo/bin/cargo, 1.85.0
-- Rust tool `rustc` found: /home/micah/.cargo/bin/rustc, 1.85.0
-- Rust tool `rustup` found: /home/micah/.cargo/bin/rustup, 1.28.1
-- Rust tool `rust-gdb` found: /home/micah/.cargo/bin/rust-gdb, 9.2
-- Rust tool `rust-lldb` not found: Failed to determine version.
-- Rust tool `rustdoc` found: /home/micah/.cargo/bin/rustdoc, 1.85.0
-- Rust tool `rustfmt` found: /home/micah/.cargo/bin/rustfmt, 1.8.0
-- Rust tool `bindgen` not found.
CMake Error at cmake/FindRust.cmake:412 (message):
Your Rust toolchain is to old to build this project:
1.85.0 < 1.100.0
Call Stack (most recent call first):
CMakeLists.txt:144 (find_package)
-- Configuring incomplete, errors occurred!
Fixes: Cisco-Talos#1480
30703cd to
2320326
Compare
jhumlick
approved these changes
Jun 3, 2025
Contributor
Author
|
This PR's new test hangs in the github runner and I have no idea why. Will mark it as a draft until I can revisit and figure it out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It isn't obvious if a build fails because the Rust version is too low.
The FindRust.cmake module already has logic to check the min supported Rus version. This commit make use of that, adding a Rust version var at the top of CMakeLists.txt. We will have to update it any time we run
cargo update, before releasing a new feature version.If your Rust version is too low (or you artificially crank up the min version for testing, the error will look like this:
Fixes: #1480
I have also updated the min Rust version in clamav-documentation where it talks about installing Rust: Cisco-Talos/clamav-documentation@02f6902