chore(lint): main's Rust tier passes the pinned toolchain again #2918
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2918
Loading…
Reference in a new issue
No description provided.
Delete branch "omgitsgela/Longshot:chore/main-rust-tier"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
mainfails its own Rust tier, so CI / Rust (rustfmt, clippy, cargo test, end to end) is red onmainitself and on every pull request rebased onto it. Onmaine6a71a1d, with the toolchainmise.tomlpins (rustc 1.99.1, clippy 0.1.100, rustfmt 1.10.0-stable), the job's first two commands fail:Clippy rejects the borrow because the
PathBufalready satisfies what the parameter takes:Error::io(&o.root.join("…ico"), e)and.at(&out.join("config"))pass&PathBufwhere the value would do. The twounused_must_usesites discard whatusage_errorreturns, anExitCode::from(2)the caller already gives up byreturn 2two lines later. Six sites in total: three&, twolet _ =, and oneassert!the formatter wants wrapped.Read first:
builder/crates/build-compile/src/lib.rs:897-908(the desktop and window icon error paths),builder/crates/build-driver/src/folder.rs:734-739(moving a looselanguage.txtintoconfig/), the twoErrarms atbuilder/crates/longshot-builder/src/after.rs:398andbuilder/crates/longshot-builder/src/play.rs:690, and the one test inbuilder/crates/build-compile/src/toolchain.rs:532.Nothing here is a bug a player can hit: the arguments passed and the behaviour are identical, and the reformat is inside a test. I am not claiming the three commits that carry these sites (
df6003e3,1f8eda51,46291934, all 2026-11-29) were wrong when they landed; I checked the failure atmainand did not chase why the tier was green before, and the fix is the same either way.Overlap worth knowing: the
toolchain.rs:532hunk is byte-identical to the one #2353 already carries (blobf2bc0919). Whichever of the two lands first, the other rebases that hunk away. If #2353 waits on its licensing question, this keepsmaingreen meanwhile.Not #2830: that answers three lints only a Windows-target clippy sees, in
build-coreandbuild-compile/src/rust.rs. No file here is one of those.Testing
Tested: Linux, the pinned toolchain (rustc 1.99.1, clippy 0.1.100, rustfmt 1.10.0-stable).
main: ate6a71a1dboth commands above fail as quoted (-p build-compile --all-targetsalone exits 101; the workspace run adds thebuild-driversite).e88bb3e4: CI's Rust tier in its own order →cargo fmt --all --checkexit 0,cargo clippy --workspace --all-targets --locked -- -D warningsexit 0,cargo test --workspace --lockedexit 0 with 71 test suites reportingokand none failing.cargo clippy --workspace --all-targets --locked --keep-goingis what sized this PR: the first sweep found the three borrows, with those fixed a second sweep found only the twomust_usesites, and with those fixed it finds nothing. Answering one layer per CI run is how a lint fix gets merged and leaves the job red anyway, so all six sites are here.cargo test --workspace --lockedneeds one word of honesty:a64'smatches_llvm_mccompares the decoder against llvm-mc and this PC has no/usr/bin/llvm-mc, so it reportsErr(NotPresent); the test's own message saysLONGSHOT_NO_CLANG=1passes over it, which is what the run above used. CI's container setsLLVM_MC=/usr/bin/llvm-mc, so the cross-check runs there.mise run testcould not run on this PC: mise failed to install its own pypi tools ("Python dependency locks require uv >= 0.12.10"). Running its command directly,python3 -I -B tests/run_all.py --strict, gives 686 passed, 222 failed, 10 skipped in 224 s, and the same suite at maine6a71a1don this PC gives 686 passed, 222 failed, 10 skipped in 225 s: the same count, so this change moves nothing in the game-free checks. The failures are the suite's ownnot found: <tool> (--strict)lines, this checkout having no clang, no vulkan_headers and no unicorn, since--strictcounts a missing tool as a failure instead of skipping it. My first run of this suite read 681/227 and I am recording why, because it is how a bad number gets believed: byte-compiled files from hand-run checks were sitting in the tree and cargo was busy with clippy sweeps at the same time, which fails the suite's synthetic byte-compile step and four checks that shell out to git and cargo. With those cleared and the machine to itself, the two trees agree exactly.tests/test_audio_output_devices.py(it readsbuild-compile/src/lib.rs): it fails identically at maine6a71a1dand here ate88bb3e4,FileNotFoundError: [Errno 2] No such file or directory: 'clang'. The text-only check that reads the same file,tests/test_tracy_win_libs.py, passes here, so no check is being answered by weakening it.Still to test:
Third-party parts and guide screenshots, which stays red for its own unrelated reason and has #2871 waiting. (by hand: whoever reviews reads the CI run on this head; there is no game run to do)x86_64-pc-windows-gnullvm, expecting the same result, since nothing here is platform-specific. (@Beanstalk, or llun, who has that target building)Measurements
Nothing to measure: three
&removed on error paths and one test assert re-wrapped. No game code, no hot path, no switch.Risks
A revert is enough. Nothing changes after updating: the builder writes the same
longshot_brand.resand moves the samelanguage.txt; only how an already-failing call is reported, and one test's layout, are touched. No save,longshot_options.inior cache effect.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (could not run through mise on this PC, and the suite's own command fails only where a tool is absent, as Testing names: clang, vulkan_headers, unicorn)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Not a change the game runs: builder argument handling, Linux, rustc 1.99.1, no GPU. The two unused_must_use lines are the --output error paths and I ran both directly on this PC. longshot-builder play --output nonsense and longshot-builder diagnostics --output nonsense each print: --output: "nonsense" is not json, text, user or recomplauncher, then the usage, and exit with status 2, which is what the doc comment on usage_error promises. The build-driver suite covering the language.txt relocation (tests/driver.rs:163-202) is among the 71 suites that pass.
WIP: chore(lint): main's Rust tier passes the pinned toolchain againto chore(lint): main's Rust tier passes the pinned toolchain againRecommendation: Request changes. The edits preserve the paths, error reporting and exit status while addressing the reported lint failures. The Rust CI job and the Windows Rust tier are still pending. (It stands on L1: The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 14s.)This removes lint failures that prevent the Rust tier from passing, without an intended player-visible behavior change. The cost is a small amount of explicit result handling and test formatting.
Blocking (1): must change before merging.
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 14s.@fixcan do L1.Checks: Still running: 7 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes, according to the author's Linux run: fmt and clippy failed on the base and passed on this head. The workspace tests also passed, with the LLVM cross-check skipped because llvm-mc was absent.
Other systems: The changed paths are in the builder, including Windows executable resources and language-file relocation. The error constructors retain the same paths, and both CLI error arms still report the error and return status 2. No renderer, game runtime, save or GPU behavior is changed; Windows Rust verification remains pending.
Switches: None.
Reviewed:
e88bb3e480againste6a71a1d18: Read AGENTS.md, CONTRIBUTING.md, the PR template, the relevant standards, the full diff and commit message, and the changed functions and their error constructors and callers. The full changed-file reads were truncated, so portions outside the changed functions were only skimmed. The referenced Tooling AGENTS.md was not present, and docs/review-checklist.md does not exist in this checkout.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run during review. The author's Linux results and direct CLI checks are reported in the PR and comment; CI on this head is still running, and the stated Windows Rust run remains outstanding.
Overlaps and merge order: #2353 carries the same toolchain.rs formatting hunk; whichever lands second should rebase it away. The PR reports that #2830 changes different Windows lint sites.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as omgitsgela took it out of WIP. Nothing was run; a maintainer decides.
The game-free suite is now a matched pair instead of one number: 686 passed, 222 failed, 10 skipped at
e88bb3e4in 224 s, and the same 686/222/10 at maine6a71a1din 225 s on this PC. My first run here read 681/227, and the description says why rather than dropping that number: byte-compiled files left in the tree by hand-run checks, plus cargo busy with the clippy sweeps at the same time, which fails the synthetic byte-compile step of the suite and four checks that shell out to git and cargo. Cleared and re-run alone, the two trees agree exactly. The diff is unchanged.L1: that check is red on
main, not on this head, and the base branch is not green either.Measured on this PC with the job's own commands, at both heads:
maine6a71a1d:python3 -I -B scripts/check_guide_screenshots.py --review-sourcesexits 1,Guide screenshot check failed: 3 issue(s).e88bb3e4: the same command exits 1 with the same three issues, byte-identical output.The three are
settings-graphics.pngagainstgpu/vk/device_policy.h,gpu/vk/vk_internal.handgpu/vk/vk_texture.h, eachchanged since reviewed revision sha256:0b99ef10…. All three are renderer files: this PR's diff is five builder Rust files and touches none of them. The other steps of that job pass at both heads:scripts/check_third_party.pyexits 0 (third_party: 17 parts as their notes say),tests/test_guide_screenshots.pyOK,tests/test_launcher_capture.pyOK.That is llun's finding with a fix already waiting: #2836, #2789, #2860 and #2810 edited those three inputs after #2183's review, and #2871 moves the review record onto current
main. I checked #2871 just now: state open, merged false. So there is no green base run of that job to compare against, and once #2871 lands this branch needs no change, only a rebase.What this PR does change, measured the same way at the same two heads: at
e6a71a1dcargo fmt --all --checkfails on one assert andcargo clippy --workspace --all-targets --locked -- -D warningsfails on five lints, so the Rust job cannot get to its tests; ate88bb3e4both exit 0 andcargo test --workspace --lockedexits 0 with 71 suites reporting ok.Wanted: L1 reassigned to #2871, or a re-review of this head with that in mind. If the preference is that no pull request can be reviewed while
Third-party parts and guide screenshotsis red onmain, that is a decision about the check, not about these six sites, and I would rather it be said plainly than answered by@fixtouching files that are not the problem.