From 834dd1b15241927dde79a5b26fecd0c76c4ef25f Mon Sep 17 00:00:00 2001 From: spacebear Date: Wed, 5 Aug 2026 13:07:37 -0400 Subject: [PATCH] Prefer MSRV-compatible deps in the ubrn build The uniffi-bindgen-react-native command is compiled from source during binding generation, from a workspace that ships no lock file, so cargo resolves its dependency graph fresh on every run and takes the newest semver-compatible release of each crate. When one of those raises its MSRV past the javascript dev shell's pinned toolchain, the build breaks: error: rustc 1.85.0 is not supported by the following package: globset@0.4.20 requires rustc 1.88 globset 0.4.20, published 2026-08-04, did exactly that. The existing workaround pinned each offending crate by hand with cargo add, a list that only grows as dependencies drift, and wrote those pins into node_modules as a side effect. Set CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback instead. Cargo's MSRV-aware resolver then prefers versions compatible with the rustc in use, deriving globset 0.4.19 and home 0.5.11 on its own, the same versions the manual pins named. This only breaks CI on pull requests that touch payjoin-ffi/**, the workflow's path filter, which is why master looks green. --- payjoin-ffi/javascript/scripts/generate_bindings.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/payjoin-ffi/javascript/scripts/generate_bindings.sh b/payjoin-ffi/javascript/scripts/generate_bindings.sh index 3d7b4ec01..c0dac8929 100755 --- a/payjoin-ffi/javascript/scripts/generate_bindings.sh +++ b/payjoin-ffi/javascript/scripts/generate_bindings.sh @@ -14,10 +14,12 @@ if [[ $OS == "Darwin" && -z ${IN_NIX_SHELL:-} ]]; then echo "LLVM flags set: AR=$AR, CC=$CC" fi -# Heinous hack to pin a transitive dependency to be MSRV compatible on 1.85 -cd node_modules/uniffi-bindgen-react-native -cargo add home@=0.5.11 --package uniffi-bindgen-react-native -cd ../.. +# The ubrn command is compiled from source during the build below, from a +# workspace that ships no lock file, so cargo resolves it fresh every run and +# picks up crates whose MSRV has moved past this shell's toolchain. Ask cargo +# to prefer versions compatible with the rustc in use instead of pinning each +# drifting crate by hand. +export CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback # rustup target add is a no-op against a nix-provided toolchain # (no rustup home, targets baked into the nix derivation instead).