From 595bfea9c5fef44c1e166610b43204fe8f7e5965 Mon Sep 17 00:00:00 2001 From: DanGould Date: Wed, 16 Sep 2026 17:20:36 +0800 Subject: [PATCH 1/2] Resolve every binding build against the lockfile yoke-derive 0.8.3, published on 2026-09-15, calls str::from_utf8 and so needs Rust 1.87, but it declares no rust-version, so the MSRV-aware resolver cannot skip it on our 1.85 toolchain. Cargo-recent.lock pins 0.8.2, yet three binding build paths never see that lockfile and now fail to compile: - The Dart native wrapper is a workspace of its own, and test.sh deleted its Cargo.lock before every build. - ubrn generates the wasm crate as a workspace of its own under the gitignored rust_modules/, with no lockfile, and the JavaScript test-utils napi addon is a standalone workspace too. - The NuGet native asset script, and the pack job's bare call to the C# bindings script, never sourced the lockfile helper at all. Seed each of those workspaces from Cargo-recent.lock instead. cargo keeps every pinned version that applies and resolves only the crates specific to that workspace. Verified on a scratch crate depending on url 2.5.8: a fresh resolution picks yoke-derive 0.8.3, the seeded one keeps 0.8.2 and prunes the lockfile to the 37 packages in use. Make use_lockfile a no-op when the lockfile is already in place, so contrib/test.sh can keep calling scripts/generate_bindings.sh now that the latter takes the lockfile itself when run bare. Consumers who build the published Dart package resolve the wrapper fresh, so they still hit the yoke-derive break until it ships a rust-version or a fix; that is outside this repository's control. --- contrib/lockfile.sh | 4 ++++ payjoin-ffi/csharp/scripts/build_nuget_native.sh | 6 ++++++ payjoin-ffi/csharp/scripts/generate_bindings.sh | 6 ++++++ payjoin-ffi/dart/contrib/test.sh | 4 ++-- payjoin-ffi/javascript/scripts/generate_bindings.sh | 7 +++++++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/contrib/lockfile.sh b/contrib/lockfile.sh index 39f68d53f..eae3fa10f 100644 --- a/contrib/lockfile.sh +++ b/contrib/lockfile.sh @@ -16,6 +16,10 @@ _cleanup_lockfile() { use_lockfile() { local src="$1" + # Already in place, from an enclosing script or an earlier run. + if cmp -s "$src" "$LOCKFILE"; then + return 0 + fi if ! mkdir "$LOCKDIR" 2>/dev/null; then echo "Another instance is running. If you're sure it's not, remove $LOCKDIR and try again." >&2 exit 1 diff --git a/payjoin-ffi/csharp/scripts/build_nuget_native.sh b/payjoin-ffi/csharp/scripts/build_nuget_native.sh index 979c9aef9..6a9c94fe4 100755 --- a/payjoin-ffi/csharp/scripts/build_nuget_native.sh +++ b/payjoin-ffi/csharp/scripts/build_nuget_native.sh @@ -101,6 +101,12 @@ rid_to_cross_tool() { SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CSHARP_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" + +REPO_ROOT="$(cd "$CSHARP_DIR/../.." && pwd)" +cd "$REPO_ROOT" +source contrib/lockfile.sh +use_lockfile Cargo-recent.lock + cd "$CSHARP_DIR" RID=${PAYJOIN_FFI_RID:-$(detect_rid)} diff --git a/payjoin-ffi/csharp/scripts/generate_bindings.sh b/payjoin-ffi/csharp/scripts/generate_bindings.sh index 7826fe30d..a4016c037 100755 --- a/payjoin-ffi/csharp/scripts/generate_bindings.sh +++ b/payjoin-ffi/csharp/scripts/generate_bindings.sh @@ -25,6 +25,12 @@ fi # Get the directory where this script is located SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" +cd "$REPO_ROOT" +source contrib/lockfile.sh +use_lockfile Cargo-recent.lock + # Navigate to payjoin-ffi directory (parent of csharp, which is parent of scripts) cd "$SCRIPT_DIR/../.." diff --git a/payjoin-ffi/dart/contrib/test.sh b/payjoin-ffi/dart/contrib/test.sh index 227491e50..d248fa642 100755 --- a/payjoin-ffi/dart/contrib/test.sh +++ b/payjoin-ffi/dart/contrib/test.sh @@ -11,8 +11,8 @@ use_lockfile Cargo-recent.lock cd "$REPO_ROOT/payjoin-ffi/dart" -echo "==> Cleaning nested Cargo.lock..." -rm -f native/Cargo.lock +echo "==> Seeding the nested workspace's Cargo.lock from the maintained lockfile..." +cp "$REPO_ROOT/Cargo-recent.lock" native/Cargo.lock echo "==> Generating FFI bindings..." bash ./scripts/generate_bindings.sh diff --git a/payjoin-ffi/javascript/scripts/generate_bindings.sh b/payjoin-ffi/javascript/scripts/generate_bindings.sh index 31f601fab..6ff7b1b1c 100755 --- a/payjoin-ffi/javascript/scripts/generate_bindings.sh +++ b/payjoin-ffi/javascript/scripts/generate_bindings.sh @@ -31,6 +31,13 @@ if command -v rustup >/dev/null 2>&1 && rustup target add wasm32-unknown-unknown fi +# ubrn's generated wasm crate and the test-utils napi addon are workspaces of +# their own; seed both from the maintained lockfile. +JS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +mkdir -p "$JS_DIR/rust_modules/wasm" +cp "$JS_DIR/../../Cargo-recent.lock" "$JS_DIR/rust_modules/wasm/Cargo.lock" +cp "$JS_DIR/../../Cargo-recent.lock" "$JS_DIR/test-utils/Cargo.lock" + npm run build # The test-utils addon is a dev-only native helper for the integration tests. From adb897d86656abac266e82a046e4ae0a42f00d0b Mon Sep 17 00:00:00 2001 From: DanGould Date: Wed, 16 Sep 2026 17:30:00 +0800 Subject: [PATCH 2/2] Pin yoke-derive 0.8.2 for pub.dev consumers The lockfile seeding in the previous commit covers this repository's CI, but anyone who builds the published Dart package resolves the native wrapper fresh on the rustup 1.85.1 toolchain its rust-toolchain.toml selects, with no lockfile at all. That build picks yoke-derive 0.8.3 today and fails, because the crate needs Rust 1.87 and declares no rust-version for the resolver to honour. A direct pin in the wrapper manifest is the only lever that reaches those consumers. It takes effect on the next pub.dev release. Drop it once yoke-derive publishes a version that declares its rust-version or builds on 1.85 again. --- payjoin-ffi/dart/native/Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/payjoin-ffi/dart/native/Cargo.toml b/payjoin-ffi/dart/native/Cargo.toml index bf209bc2c..4a18acbe9 100644 --- a/payjoin-ffi/dart/native/Cargo.toml +++ b/payjoin-ffi/dart/native/Cargo.toml @@ -21,3 +21,9 @@ crate-type = ["staticlib", "cdylib"] payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "60d0adbf4ee8e60090209d55e9864893a4acc30e", features = [ "dart", ] } +# Not used directly. yoke-derive 0.8.3 needs Rust 1.87 but declares no rust-version, +# so consumers' fresh resolution on the toolchain above picks it. Drop once upstream fixes it. +yoke-derive = "=0.8.2" + +[package.metadata.cargo-machete] +ignored = ["yoke-derive"]