From 48b1aa2a21ab687549025f0e5aff9a4e12c5aeac Mon Sep 17 00:00:00 2001 From: Xin Date: Sat, 3 Oct 2026 12:30:06 +0100 Subject: [PATCH] fix: pin Rust toolchain via rust-toolchain.toml, fix deprecated f64 path CI's dtolnay/rust-toolchain@stable floats to the newest stable, so its clippy -D warnings gate drifts ahead of local toolchains - rustc 1.99 newly deprecates the std::f64 module constants, failing lint-rust on a 'use std::f64' in config.rs tests (local 1.97 was silent). Remove the import so f64::INFINITY resolves to the associated constant. Pin 1.99.0 in rust-toolchain.toml: rustup applies it automatically to local builds, CI, and the V8 archive builder containers, making lint results reproducible everywhere. Bump deliberately; same policy as the ruff pin (#14). --- docs/contributing/development.md | 2 +- rust-toolchain.toml | 7 +++++++ src/runtime/config.rs | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/docs/contributing/development.md b/docs/contributing/development.md index 5d1fbb5..3066974 100644 --- a/docs/contributing/development.md +++ b/docs/contributing/development.md @@ -6,7 +6,7 @@ Building on Linux and Windows requires compiling `rusty_v8` from source, which can take 30+ minutes and requires additional dependencies (Python, Clang/LLVM, etc.). See the [rusty_v8 build documentation](https://github.com/denoland/rusty_v8?tab=readme-ov-file#build-v8-from-source) for platform-specific requirements. - **Python**: 3.10 or higher -- **Rust**: Latest stable toolchain (install via [rustup](https://rust-lang.org/tools/install/)) +- **Rust**: Install via [rustup](https://rust-lang.org/tools/install/); the version is pinned in `rust-toolchain.toml` and rustup selects it automatically, keeping local builds, lints, and CI on the same toolchain - **uv**: Fast Python package manager (install via [uv docs](https://docs.astral.sh/uv/getting-started/installation/)) - **Make**: Build automation tool (usually pre-installed on macOS/Linux) diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..44f7243 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,7 @@ +# Single source of truth for the Rust toolchain: rustup picks this up +# automatically for local builds, CI, and the V8 archive builder containers, +# so lint results (clippy -D warnings) stay reproducible everywhere. +# Bump deliberately; `make all` must pass under the new version. +[toolchain] +channel = "1.99.0" +components = ["clippy", "rustfmt"] diff --git a/src/runtime/config.rs b/src/runtime/config.rs index c2b4240..ed7b3d3 100644 --- a/src/runtime/config.rs +++ b/src/runtime/config.rs @@ -498,7 +498,6 @@ impl RuntimeConfig { mod tests { use super::*; use pyo3::types::PyFloat; - use std::f64; #[test] fn test_default_config() {