WIP: chore(lint): the workspace passes clippy for Windows' target, as mise.toml says the builder is checked for Windows #2830

Draft
llun wants to merge 1 commit from llun/Longshot:fix/mod-api-win-clippy into mod-api
Member

Summary

For #2822 (into mod-api). mise.toml says the Windows target is there to check the builder for Windows (cargo clippy --target x86_64-pc-windows-gnullvm). On mod-api, that check (-D warnings, as CI runs clippy on Linux) fails on three things only a Windows build sees:

  • builder/crates/build-core/src/control.rs: into_game, which is #[cfg(windows)], comes after the test modules (items_after_test_module). Moved above them, unchanged.
  • builder/crates/build-core/src/channel.rs: on Windows Passed holds pid alone, so its hand-written Default is one a derive would make (derivable_impls). Linux's out_fd starts at -1, which a derive would not do, so the hand-written one stays, with the lint allowed off Unix.
  • builder/crates/build-compile/src/rust.rs: the tests' builds() is used by #[cfg(unix)] tests only (dead_code). It gets #[cfg(unix)], like fake_cargo beside it.

Each change sits behind its cfg: Linux's build and its clippy see the same code as before.

Testing

Tested: Windows 11, RTX 5080, NVIDIA 621.40.

  • Clippy: cargo clippy --keep-going --workspace --exclude modtool --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings and the same for -p modtool, as CI's two clippy runs split them, with llvm-mingw as the C compiler. On mod-api @ eaf4a48b they fail with the three errors above (build-core first, which stops its dependents). Here both pass.
  • Tests: cargo test -p build-core -p build-compile --target x86_64-pc-windows-gnullvm passes, except three tests that fail the same way on mod-api on Windows: files_windows::tests::the_cache_takes_files_folders_renames_and_removes, driver_caches::tests::the_caches_are_longshots_own_unless_one_is_named and toolchain::tests::the_builder_s_llvm_comes_before_emsdk_and_the_path.
  • In the game: a builder built from this branch started the game confined through longshot-builder game with a profile: sandbox: in the AppContainer, the builder reached …, mods: the builder's channel is open, the mods started, and the game played until the run's time limit. (The builder had #2726's broker change applied locally beneath it: on plain mod-api a confined start with a profile stops at the save folder.)
  • cargo fmt --check on both crates and mise run lint pass.

Still to test: None.

Measurements

Nothing to measure: lint attributes, a cfg on a test helper, and a function moved within its file. The program built is the same on Linux, and on Windows only the order of items changes.

Risks

The sandbox: not touched. These are lint attributes, a test helper's cfg, and a function moved within its file. Passed's default (the channel's fd and pid) is the same value on both systems.

None for players. A revert is enough.

Checklist

Ready for review

  • One topic, on current mod-api (#2822's head); the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (The checks this change reaches pass, apart from the three named above, which fail the same way on mod-api. mod-api's whole suite has failures on Windows that this PR doesn't change.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary For [#2822](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822) (into `mod-api`). `mise.toml` says the Windows target is there to check the builder for Windows (`cargo clippy --target x86_64-pc-windows-gnullvm`). On `mod-api`, that check (`-D warnings`, as CI runs clippy on Linux) fails on three things only a Windows build sees: - `builder/crates/build-core/src/control.rs`: `into_game`, which is `#[cfg(windows)]`, comes after the test modules (`items_after_test_module`). Moved above them, unchanged. - `builder/crates/build-core/src/channel.rs`: on Windows `Passed` holds `pid` alone, so its hand-written `Default` is one a derive would make (`derivable_impls`). Linux's `out_fd` starts at -1, which a derive would not do, so the hand-written one stays, with the lint allowed off Unix. - `builder/crates/build-compile/src/rust.rs`: the tests' `builds()` is used by `#[cfg(unix)]` tests only (`dead_code`). It gets `#[cfg(unix)]`, like `fake_cargo` beside it. Each change sits behind its `cfg`: Linux's build and its clippy see the same code as before. ## Testing **Tested:** Windows 11, RTX 5080, NVIDIA 621.40. - **Clippy:** `cargo clippy --keep-going --workspace --exclude modtool --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` and the same for `-p modtool`, as CI's two clippy runs split them, with llvm-mingw as the C compiler. On `mod-api` @ eaf4a48b they fail with the three errors above (`build-core` first, which stops its dependents). Here both pass. - **Tests:** `cargo test -p build-core -p build-compile --target x86_64-pc-windows-gnullvm` passes, except three tests that fail the same way on `mod-api` on Windows: `files_windows::tests::the_cache_takes_files_folders_renames_and_removes`, `driver_caches::tests::the_caches_are_longshots_own_unless_one_is_named` and `toolchain::tests::the_builder_s_llvm_comes_before_emsdk_and_the_path`. - **In the game:** a builder built from this branch started the game confined through `longshot-builder game` with a profile: `sandbox: in the AppContainer, the builder reached …`, `mods: the builder's channel is open`, the mods started, and the game played until the run's time limit. (The builder had #2726's broker change applied locally beneath it: on plain `mod-api` a confined start with a profile stops at the save folder.) - `cargo fmt --check` on both crates and `mise run lint` pass. **Still to test:** None. ## Measurements Nothing to measure: lint attributes, a `cfg` on a test helper, and a function moved within its file. The program built is the same on Linux, and on Windows only the order of items changes. ## Risks **The sandbox:** not touched. These are lint attributes, a test helper's `cfg`, and a function moved within its file. `Passed`'s default (the channel's fd and pid) is the same value on both systems. None for players. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `mod-api` (#2822's head); the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). (The checks this change reaches pass, apart from the three named above, which fail the same way on `mod-api`. `mod-api`'s whole suite has failures on Windows that this PR doesn't change.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore(lint): the workspace passes clippy for Windows' target, as mise.toml says the builder is checked for Windows
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
4a960e04e6
`cargo clippy --target x86_64-pc-windows-gnullvm -- -D warnings` (mise.toml: "the Windows target checks the builder for
Windows") failed on three things that only a Windows build sees:
- build-core/src/control.rs: into_game, #[cfg(windows)], came after the test modules (items_after_test_module): moved
  above them, unchanged;
- build-core/src/channel.rs: Passed's Default holds pid alone on Windows, which a derive would make
  (derivable_impls); Linux's out_fd starts at -1, which it would not: allowed where it is not unix;
- build-compile/src/rust.rs: the tests' builds() is used by #[cfg(unix)] tests only (dead_code): #[cfg(unix)], as
  fake_cargo beside it.
Linux's build and its clippy are unchanged: each change is behind its cfg.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in the game: Windows 11, RTX 5080, NVIDIA 621.40: a builder built from this branch (with #2726's broker change applied locally beneath it) started the game confined through longshot-builder game with a profile: sandbox: in the AppContainer, the builder reached ..., mods: the builder's channel is open (31 ops), Skip title screen and the profile's mods started, and it played until the run's time limit.

Tested in the game: Windows 11, RTX 5080, NVIDIA 621.40: a builder built from this branch (with #2726's broker change applied locally beneath it) started the game confined through `longshot-builder game` with a profile: `sandbox: in the AppContainer, the builder reached ...`, `mods: the builder's channel is open (31 ops)`, Skip title screen and the profile's mods started, and it played until the run's time limit.
Author
Member

Risks now says how this change stands with the sandbox (what it touches, and why the confined game reaches nothing more).

Risks now says how this change stands with the sandbox (what it touches, and why the confined game reaches nothing more).
llun force-pushed fix/mod-api-win-clippy from 4a960e04e6
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
to 12a347da9c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
2026-11-29 23:27:38 +00:00
Compare
Author
Member

Rebased onto mod-api's newest (4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.

Rebased onto mod-api's newest (4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.
llun force-pushed fix/mod-api-win-clippy from 12a347da9c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
to 712ffe86b3
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
2026-11-29 23:58:39 +00:00
Compare
Author
Member

Rebased onto mod-api @ 816d2354 (#2837, headless shots of the mods' UI), now 712ffe86. No conflict, and the diff is the same as before (same git patch-id). #2837 touches none of this PR's files.

Rebased onto `mod-api` @ 816d2354 ([#2837](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2837), headless shots of the mods' UI), now 712ffe86. No conflict, and the diff is the same as before (same `git patch-id`). #2837 touches none of this PR's files.
llun force-pushed fix/mod-api-win-clippy from 712ffe86b3
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
to f6f37da0d6
All checks were successful
PR description / Title and description (pull_request_target) Successful in 1m12s
2026-11-30 00:39:15 +00:00
Compare
llun force-pushed fix/mod-api-win-clippy from f6f37da0d6
All checks were successful
PR description / Title and description (pull_request_target) Successful in 1m12s
to d9c6e4a67e
All checks were successful
PR description / Title and description (pull_request_target) Successful in 21s
2026-11-30 00:43:07 +00:00
Compare
Author
Member

Rebased onto mod-api @ c5e5b676: it was re-squashed onto main @ 46291934 (#2833) twice today (cdbb8551, then c5e5b676), which made this PR show main's and the whole mod API's diff. Now d9c6e4a6, the same diff as before (same git patch-id), no conflict. The new base brings main's newest code, so I ran it again on the rebased head: cargo clippy --workspace --all-targets (and -p modtool) for x86_64-pc-windows-gnullvm with -D warnings passes.

Rebased onto `mod-api` @ c5e5b676: it was re-squashed onto main @ 46291934 (#2833) twice today (cdbb8551, then c5e5b676), which made this PR show main's and the whole mod API's diff. Now d9c6e4a6, the same diff as before (same `git patch-id`), no conflict. The new base brings main's newest code, so I ran it again on the rebased head: `cargo clippy --workspace --all-targets` (and `-p modtool`) for `x86_64-pc-windows-gnullvm` with `-D warnings` passes.
All checks were successful
PR description / Title and description (pull_request_target) Successful in 21s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/mod-api-win-clippy:llun-fix/mod-api-win-clippy'
git switch 'llun-fix/mod-api-win-clippy'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'mod-api'
git merge --no-ff 'llun-fix/mod-api-win-clippy'
git switch 'llun-fix/mod-api-win-clippy'
git rebase 'mod-api'
git switch 'mod-api'
git merge --ff-only 'llun-fix/mod-api-win-clippy'
git switch 'llun-fix/mod-api-win-clippy'
git rebase 'mod-api'
git switch 'mod-api'
git merge --no-ff 'llun-fix/mod-api-win-clippy'
git switch 'mod-api'
git merge --squash 'llun-fix/mod-api-win-clippy'
git switch 'mod-api'
git merge --ff-only 'llun-fix/mod-api-win-clippy'
git switch 'mod-api'
git merge 'llun-fix/mod-api-win-clippy'
git push origin 'mod-api'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2830
No description provided.