fix(cargo-gamma-unsafe): avoid clippy::fn_to_numeric_cast_any on the MSRV toolchain - #112
Open
Pato Sandaña (psandana) wants to merge 2 commits into
Open
Conversation
…MSRV toolchain The `dying_resets_the_disposition_to_the_default_before_re_raising` test installed its handler with `record as *const () as libc::sighandler_t`. Clippy 1.95 -- the RUST_MSRV toolchain the publish pipeline builds with -- flags the `record as *const ()` sub-cast under `clippy::fn_to_numeric_cast_any`, so `-D warnings` broke `Build and Test` on linux for both dev and release. Newer clippy (1.97, RUST_LATEST) no longer flags the pointer form, which is why it passed local checks. Widen the function the same way `install_with` and the sibling `every_terminal_signal_is_armed_to_survive_its_own_delivery` test already do -- `record as extern "C" fn(i32) as usize` under an `#[expect(clippy::fn_to_numeric_cast_any, ...)]` -- which the lint fires on identically across 1.95 and 1.97, keeping the expectation fulfilled on both toolchains. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6ff5a5cc-ea89-4c8e-a67a-ab83c17b8224
The SDLSources stage's ESLint tool flags `innerHTML`/`insertAdjacentHTML` usage (`@microsoft/sdl/no-inner-html`) inside `crates/cargo-gamma-lib/src/vendor/mutation-test-elements.js`, the minified mutation-testing-elements 3.9.0 bundle we inline via `include_str!` for offline report rendering. Those three errors broke the Guardian post-analysis step of the publish pipeline. The bundle is vendored third-party code we edit only by re-vendoring, so add the repo-root `guardian_baselines.gdnbaselines` the publish pipeline already looks for (mirroring ox-sdk), suppressing exactly those three findings by their Guardian signatures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6ff5a5cc-ea89-4c8e-a67a-ab83c17b8224
There was a problem hiding this comment.
Pull request overview
This PR fixes two pipeline breaks introduced with cargo-gamma: an MSRV-only clippy lint in cargo-gamma-unsafe tests and a Guardian SDL ESLint failure on a vendored JS bundle used by cargo-gamma-lib.
Changes:
- Adjusts the test-only signal-handler cast to match the production
install_withapproach and keepclippy::fn_to_numeric_cast_anyexpectations stable across MSRV/latest. - Adds a repo-root
guardian_baselines.gdnbaselinesto baseline SDL ESLint@microsoft/sdl/no-inner-htmlfindings originating from the vendored, minifiedmutation-test-elements.jsbundle.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| guardian_baselines.gdnbaselines | Adds Guardian baselines for ESLint findings on vendored JS to unblock SDLSources in Guardian. |
| crates/cargo-gamma-unsafe/src/interrupt.rs | Updates a test to use a consistent, expected function-to-integer handler conversion for libc::signal on MSRV clippy. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
=====================================
Coverage 97.7% 97.7%
=====================================
Files 286 286
Lines 62174 62175 +1
=====================================
+ Hits 60751 60753 +2
+ Misses 1423 1422 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
The
OxidizerOxToolsGitHub.PublishEachCommitrun 40252163 failed onmain(95089c5, "Introduce cargo-gamma (#93)") in two independent places:Cargo clippy--Build and Test {dev,release} on linuxGuardian: Post Analysis--SDLSourcesRoot causes and fixes
1. clippy
fn_to_numeric_cast_any(MSRV-only)The publish pipeline builds with
RUST_MSRV= 1.95 (constants.env), and clippy 1.95 flags therecord as *const ()sub-cast in thedying_resets_the_disposition_to_the_default_before_re_raisingtest. Clippy 1.97 (RUST_LATEST) no longer flags the pointer form, which is why it passed theRUST_LATESTchecks and only broke on the MSRV leg.Fixed by widening the handler the way the production
install_withand the siblingevery_terminal_signal_is_armed_to_survive_its_own_deliverytest already do --record as extern "C" fn(i32) as usizeunder#[expect(clippy::fn_to_numeric_cast_any, ...)]. That form trips the lint identically on 1.95 and 1.97, so the expectation stays fulfilled on both toolchains.2. SDL ESLint
no-inner-htmlon vendored JSmutation-test-elements.jsis the minified mutation-testing-elements 3.9.0 bundle, vendored and inlined viainclude_str!for offline report rendering. The SDL ESLint tool (which runs with--no-ignore, so a plain.eslintignoreis not honored) flags itsinnerHTML/insertAdjacentHTMLusage and breaks Guardian.Fixed by adding the repo-root
guardian_baselines.gdnbaselinesthe pipeline already looks for -- it logged "Baselines file expected at ...\guardian_baselines.gdnbaselines but not found" -- mirroringox-sdk. It baselines exactly those three findings by the Guardian signatures the failing run emitted.Reproduction and verification
x86_64-unknown-linux-gnu(the interrupt module is#[cfg(unix)], so it only surfaces on the linux leg; the windows legs were green).cargo clippy --all-targets --all-features -- -D warningsoncargo-gamma-unsafeis clean on 1.95 and 1.97, dev and release (linux target).cargo +nightly-2026-01-21 fmt --checkandcargo heather(license headers) both pass.Fixes the failures in build 40252163.
/cc Martin Taillefer (@geeknoid)