From 952334977c4953b9d04d93e6984264919066c7da Mon Sep 17 00:00:00 2001 From: Stephane Segning Lambou Date: Fri, 18 Sep 2026 14:02:50 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20unbreak=20main=20=E2=80=94=20rand=200.10?= =?UTF-8?q?=20API=20move=20and=20napi=20runtime/derive=20skew?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `main` has failed `Code Linting and SAST`, `Tests`, `Code Checks`, `Lint`, `Build CLI (Linux)` and `Build Docker image` on every push since 2026-09-13. Two independent breakages, neither previously root-caused: 1. `rand` 0.10 moved `Rng::fill` onto a new `RngExt` trait, so `crates/vym-fyi-model/src/services/slug.rs`'s `rand::rng().fill(..)` no longer resolves. The workspace pins `rand = "0.10"`, so the caret range picked the breaking major up silently. One import line. 2. `napi` and `napi-derive` are both pinned `"3"`, and drifted apart under that range: the lockfile held `napi` 3.8.6 against `napi-derive` 3.6.5 (backed by `napi-derive-backend` 6.1.3). The derive macro expands to calls the older runtime crate does not expose — `napi::bindgen_prelude::{from_raw_optional_field, from_raw_required_field, get_named_property_raw, set_named_property_raw}`, `NativeBorrowBarrier`, `NativeBorrowScope` — producing 19 E0425/E0433 errors that all originate inside the `#[napi]` attribute macro rather than in any source line a reader would suspect. `cargo update -p napi` resolves 3.8.6 -> 3.12.2. Lockfile-only for the second; no manifest range changed for either. Co-Authored-By: Claude Opus 5 --- Cargo.lock | 31 ++++++++++------------- crates/vym-fyi-model/src/services/slug.rs | 2 +- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 537d219..c838c45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -506,12 +506,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "ctor" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "400a21f1014a968ec518c7ccdf9b4a4ed0cac8c56ccb6d604f8b91f00110501e" - [[package]] name = "ctor" version = "1.0.13" @@ -603,7 +597,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -810,7 +804,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows-link 0.1.3", + "windows-link 0.2.1", "windows-result", ] @@ -1518,13 +1512,14 @@ dependencies = [ [[package]] name = "napi" -version = "3.8.6" +version = "3.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e55037284865448ecf329baa86a4d05401f647ebde99f5747b640d32c2c5226" +checksum = "58c5f4d5375213fdb7be2655e152386e82f026f9a5ba36a75556e11359aafe09" dependencies = [ "bitflags", - "ctor 0.11.1", + "ctor", "futures", + "libc", "napi-build", "napi-sys", "nohash-hasher", @@ -1545,7 +1540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "350057056a30368aa76c11a0d406b0aa61321710be2c36656ab4f6efe0b785a2" dependencies = [ "convert_case", - "ctor 1.0.13", + "ctor", "napi-derive-backend", "proc-macro2", "quote", @@ -1567,9 +1562,9 @@ dependencies = [ [[package]] name = "napi-sys" -version = "3.2.1" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb602b84d7c1edae45e50bbf1374696548f36ae179dfa667f577e384bb90c2b" +checksum = "4d29a242104e456960e6c6479847570be731c1a92b8f8c05ddfb5439e5c09915" dependencies = [ "libloading", ] @@ -1849,7 +1844,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -2097,7 +2092,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -2334,7 +2329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2635,7 +2630,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/crates/vym-fyi-model/src/services/slug.rs b/crates/vym-fyi-model/src/services/slug.rs index be75cad..385bc12 100644 --- a/crates/vym-fyi-model/src/services/slug.rs +++ b/crates/vym-fyi-model/src/services/slug.rs @@ -1,4 +1,4 @@ -use rand::Rng; +use rand::RngExt; /// Generate a random, URL-safe slug with at least `min_len` characters. ///