Skip to content

Bump Rust toolchain to 1.97.1 - #52

Merged
perryqh merged 2 commits into
mainfrom
bump-rust-toolchain-1.97.1
Aug 20, 2026
Merged

Bump Rust toolchain to 1.97.1#52
perryqh merged 2 commits into
mainfrom
bump-rust-toolchain-1.97.1

Conversation

@perryqh

@perryqh perryqh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
  • Moves the pinned toolchain from 1.92.0 to 1.97.1, the current stable release.
  • No CI workflow pins a Rust version, so all four workflows pick this up from rust-toolchain.toml automatically. The release workflow is cargo-dist-generated and installs via rustup, so it inherits it too.

Why there are source changes

  • Rust 1.97's clippy flags a redundant & passed to format-like macros, which 1.92's did not. Under CI's RUSTFLAGS=-Dwarnings these 9 warnings fail the Lints job, so the bump can't land without fixing them.
  • All 8 source/test changes are the same one-character edit: format!("{}", &x) becomes format!("{}", x). Display and Debug forward transparently through references, so formatted output is byte-identical and no behavior changes.

Reviewing this

  • 565183b is entirely mechanical, safe to skim.
  • 6e25d06 is the one substantive line.
  • The lint fixes land first so each commit passes clippy on its own (verified clean under both 1.90 and 1.97), meaning git bisect never lands on a red commit.

Contributor impact

  • Local builds now need 1.97.1; rustup installs it automatically from rust-toolchain.toml.
  • No rust-version/MSRV is declared in Cargo.toml, so no downstream compatibility constraint is affected.

Heads-up: unrelated flaky test

While running the suite locally, test_respect_gitignore_can_be_disabled failed once under full concurrent load, then passed in isolation. This looks like a pre-existing test-isolation bug rather than something introduced here:

  • test_respects_global_gitignore mutates the developer's real global git config (git config --global core.excludesFile) and is marked #[serial].
  • serial_test's #[serial] only serializes against other #[serial] tests, not against unmarked parallel ones, so test_respect_gitignore_can_be_disabled can run while excludesFile is mid-set/unset and pick up a bogus ignore path.
  • This PR touches no gitignore or zeitwerk code, only format arguments.

If CI goes red on that test, this is the likely cause. Worth fixing separately.

Related: a failed local run can leave tests/fixtures/app_with_unnecessary_dependencies/packs/foo/package.yml modified, since test_auto_correct_unnecessary_dependencies rewrites it and skips cleanup when the suite aborts.

Follow-ups noted, deliberately not included

  • parse_utils.rs:149-152 is if name.is_some() { name.unwrap_or_else(|| panic!(...)) }. The panic is unreachable given the guard and wants to be if let Some(..) = name. There is also a stale commented-out copy just above it that still contains the old &node, so it will drift further out of sync.
  • ci.yml uses actions/checkout@v2 (deprecated Node runtime) and audit.yml uses the archived actions-rs/audit-check@v1.

🤖 Generated with Claude Code

perryqh and others added 2 commits August 19, 2026 13:28
Rust 1.97's clippy flags `&x` passed to format-like macros where the
borrow is redundant, since Display and Debug forward transparently
through references. Drop the borrow in the 8 affected call sites.

Formatted output is byte-identical; no logic or error paths change.
Landed ahead of the toolchain bump so each commit passes clippy on its
own (verified clean under both 1.90 and 1.97).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Moves off 1.92.0 to current stable. No CI workflow pins a Rust version, so all jobs pick this up from rust-toolchain.toml automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this to Triage in Modularity Aug 19, 2026
@perryqh
perryqh marked this pull request as ready for review August 19, 2026 18:41
@perryqh
perryqh requested a review from a team as a code owner August 19, 2026 18:41

@dduugg dduugg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — the bump itself is clean and low-risk. Two corrections to the description, both of which will misdirect the next reader if left as-is.

Verified

  • All 8 format-arg edits are behavior-neutral. Every site is a format-like macro (println!/eprintln!/format!/panic!) — no write!, assert!, or structured tracing fields touched, no smart-pointer Display mismatch, and no site where the variable is later moved (format macros only borrow).
  • No rust-version/MSRV in Cargo.toml, and none of the four workflows installs a pinned toolchain — all rely on the runner's rustup reading rust-toolchain.toml, so this file is the whole change surface.
  • 1.97.1 installs and runs with both required components (clippy 0.1.97, rustfmt).
  • parse_utils.rs:149-152 is exactly as described (unreachable unwrap_or_else(|| panic!(...)) behind an is_some() guard, plus a stale commented-out copy still carrying the old &node). Agreed it belongs in its own PR — it's a logic cleanup, not a lint fix.

1. The "Heads-up: unrelated flaky test" diagnosis is incorrect.

The section attributes test_respect_gitignore_can_be_disabled to #[serial] on test_respects_global_gitignore racing over core.excludesFile. That can't be the cause for this test:

  • tests/fixtures/app_with_gitignore_disabled/packwerk.yml sets respect_gitignore: false, and src/packs/walk_directory.rs:146 gates build_gitignore_matcher behind exactly that flag — so this test never reads core.excludesFile at all, mid-set or otherwise.
  • The global pattern written by that test is *.global_ignore, which could never mask ignored_folder/violating.rb.
  • The observed failure is a cache-file creation error, not a missed violation, which independently rules out gitignore matching.

The real cause is the one #54 and #57 identify: common::teardown() globs tests/fixtures/*/tmp/cache/packwerk and deletes every fixture's cache, and gitignore_test.rs calls it from tests running on parallel threads in one binary. The precise window is src/packs/caching/per_file_cache.rs:59 (create_dir_all(parent)) vs :67 (File::create) — losing the parent between those two calls is why it surfaces as EINVAL rather than the ENOENT you'd expect.

Your general point about serial_test semantics (#[serial] only serializes against other #[serial] tests) is correct and worth keeping — it just isn't what breaks this test. Suggest replacing the section with a pointer to #57, which fixes it.

2. The "Follow-ups noted" section is stale.

actions/checkout@v2 and actions-rs/audit-check@v1 were both already fixed on main by #51 and #55main now pins actions/checkout@3d3c42e # v7.0.1 by SHA across ci.yml/audit.yml/zizmor.yml, and audit.yml has moved to taiki-e/install-action. They are still present on this branch, which forks from 0ccf146 — three commits before those landed — so the observation was accurate when written and will simply disappear on rebase. Worth dropping the section so it doesn't read as outstanding work.

Comment thread rust-toolchain.toml
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.92.0"
channel = "1.97.1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: 1.98.0 shipped 2026-08-18, so "the current stable release" in the description is now one behind. Pinning one release back is defensible — just noting the wording no longer matches if landing on current stable was the intent.

.context(format!(
"Reference#defining_pack_name is {}, but that pack is not found in pack set.",
&name
name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging this one site as the one worth actually reading rather than skimming, since it isn't the simple case the rest of the diff is.

name is bound by if let Some(name) = &self.defining_pack_name over an Option<String> field, so name is already &String — meaning the original format!(..., &name) was &&String, a double borrow, not the single &x -> x the description describes.

It is still correct to remove it: the blanket impl<T: Display + ?Sized> Display for &T makes Display transparent through any depth of references, so the formatted output is byte-identical. No change needed. Noting it only because a mechanical &-strip is exactly the kind of edit where a nested borrow can hide a real change, and this is the site a reviewer should verify by hand.

@perryqh
perryqh merged commit 62ef84d into main Aug 20, 2026
12 checks passed
@perryqh
perryqh deleted the bump-rust-toolchain-1.97.1 branch August 20, 2026 21:51
@github-project-automation github-project-automation Bot moved this from Triage to Done in Modularity Aug 20, 2026
iMacTia added a commit to iMacTia/pks that referenced this pull request Aug 21, 2026
One conflict, in `update`'s summary line. rubyatscale#52 bumped the toolchain to 1.97.1 and
the newer clippy removed the needless borrow in `&strict_violations.len()`; this
branch had renamed that binding to `unlisted_strict_violations` when it added the
recorded filter. Resolved as both: the rename kept, the borrow dropped.

Everything else merged clean, including `tests/common/mod.rs`, where rubyatscale#57 adds
`common::Fixture` next to this branch's `RoundTripFixture`. Worth flagging that
they now solve the same problem two ways: rubyatscale#57 copies a fixture to a temp dir and
drops it, while `RoundTripFixture` restores the shared fixture in place. rubyatscale#57
converts `create_test.rs` and `gitignore_test.rs` only, so `update_test.rs` still
uses the older mechanism. Happy to fold the three round-trip tests onto
`common::Fixture` if that is preferred, in this PR or a follow-up.

Verified on the merged tree with the 1.97.1 toolchain the merge brings in:
`cargo test --no-fail-fast` 265 passed 0 failed, clippy with `-Dwarnings` clean,
`cargo fmt --check` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants