From 39e4d963ae3d08a526490eb985267d2fc3a71b5d Mon Sep 17 00:00:00 2001 From: Bruno Fernandez-Ruiz Date: Fri, 14 Aug 2026 20:26:55 +0200 Subject: [PATCH] build: pin the Rust toolchain to 1.97.0 This repository was invisible to the TOOLPIN plan, which enumerated nine Rust repositories from a hand-derived list. scripts/ci/rust_pin_audit.py derives them from their trees instead, and found this one on its first live run. 1.97.0 is the ratified estate version (D207). One target, measured rather than guessed: aarch64-apple-darwin .github/workflows/component-artifacts.yml Verified under the pinned compiler: rustc in-tree rustc 1.97.0 (2d8144b78 2026-07-07) gate cargo clippy --workspace --all-targets -- -D warnings exit 0; cargo test --workspace exit 0, 100 + 4 tests src/main.rs carries three clippy-1.97 changes, and they are not all the same kind. Two are fixes. `clippy::ptr_arg` fires on the unmodified source under 1.97.0, so `Option<&PathBuf>` becomes `Option<&Path>` and `as_ref()` becomes `as_deref()`. One is a SUPPRESSION, stated as such: `#[allow(clippy::too_many_arguments)]` on `onboard_output`. The function took eight arguments before this change and takes eight after, so its arity did not move -- 1.97.0 tightened the default. The suppression is defensible for a print helper whose arguments are all distinct values, but it is a silenced lint rather than a fixed one, and it should not be absorbed into 'pinned the toolchain'. Both lints were confirmed to fire by reverting the source, keeping the pin, and running the repository's own clippy invocation: clippy::ptr_arg clippy::too_many_arguments Fixes #4021 --- rust-toolchain.toml | 9 +++++++++ src/main.rs | 15 ++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..a18bcc5 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,9 @@ +[toolchain] +channel = "1.97.0" +components = ["rustfmt", "clippy"] + +# aarch64-apple-darwin comes from .github/workflows/component-artifacts.yml. +# rustup treats stable and 1.97.0 as different toolchains, so targets a workflow +# installs for stable are absent here. Removing this target strips the macOS +# arm64 cross-compile job while reading as a pure version change. +targets = ["aarch64-apple-darwin"] diff --git a/src/main.rs b/src/main.rs index 1a28a13..3386aa6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use serde_json::{json, Value}; use std::env; use std::fs; use std::io::{self, Read}; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::thread; use std::time::Duration; @@ -1488,8 +1488,8 @@ fn onboard(cli: &Cli, args: &OnboardArgs) -> Result<(), String> { &project_ref, value, args.with_ci_workflow, - workflow_path.as_ref(), - manifest_path.as_ref(), + workflow_path.as_deref(), + manifest_path.as_deref(), variables_outcome, next, ); @@ -1514,13 +1514,14 @@ fn onboard_error_body(value: Option<&Value>, text: &str) -> String { value.map_or_else(|| text.to_string(), Value::to_string) } +#[allow(clippy::too_many_arguments)] fn onboard_output( repo: &str, project_ref: &str, onboard: Value, ci_workflow: bool, - workflow_path: Option<&PathBuf>, - manifest_path: Option<&PathBuf>, + workflow_path: Option<&Path>, + manifest_path: Option<&Path>, variables: Value, next: &str, ) -> (Value, String) { @@ -2771,10 +2772,10 @@ mod tests { use super::*; use clap::CommandFactory; - fn access_args_for(file: &PathBuf) -> AccessApplyArgs { + fn access_args_for(file: &Path) -> AccessApplyArgs { AccessApplyArgs { repo_dir: None, - file: Some(file.clone()), + file: Some(file.to_path_buf()), app_ref: None, tenant_ref: None, account_ref: None,