From b1a423776cc5e406989f5eecb39dc9156ff474c2 Mon Sep 17 00:00:00 2001 From: Sasha Denisov Date: Thu, 3 Sep 2026 13:47:05 +0200 Subject: [PATCH 1/5] ci(downstream): force payjoin/bdk onto uniffi 0.32 so the jobs exercise 0.32 metadata Both downstream repos still pin uniffi 0.31.2, so their 0.31 metadata can't be read by this PR's 0.32 bindgen (Unexpected metadata type code). Both compile clean on 0.32 (payjoin: 24 tests; bdk-ffi: verified), so bump them in-CI: sed payjoin-ffi's uniffi to 0.32; clone bdk-ffi at its pinned rev, bump it, and local-[patch] bdk-dart onto it (+bump bdk-dart's own uniffi, refresh its lock). Self-contained in the workflow (no forks); drop once upstreams ship 0.32. --- .github/workflows/test-downstream.yml | 39 ++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-downstream.yml b/.github/workflows/test-downstream.yml index 7e2d139..504890a 100644 --- a/.github/workflows/test-downstream.yml +++ b/.github/workflows/test-downstream.yml @@ -42,6 +42,17 @@ jobs: uniffi-dart = { path = "../main" } EOF + - name: Bump payjoin-ffi to uniffi 0.32 + # rust-payjoin still pins uniffi 0.31.2; its 0.31 metadata cannot be read + # by this PR's 0.32 bindgen (`Unexpected metadata type code`). Bump its + # own uniffi to 0.32 so the metadata matches — payjoin-ffi compiles and + # its Dart suite passes unchanged on 0.32 (probed: 24 tests). Removed once + # rust-payjoin ships 0.32 upstream. + run: | + sed -i 's/uniffi = { version = "0.31.2"/uniffi = { version = "0.32"/g' rust-payjoin/payjoin-ffi/Cargo.toml + echo "--- payjoin-ffi uniffi pins now ---" + grep -n 'uniffi = ' rust-payjoin/payjoin-ffi/Cargo.toml || true + - name: Generate dart bindings and run tests run: cd rust-payjoin/payjoin-ffi/dart && bash scripts/generate_bindings.sh && dart test @@ -71,13 +82,39 @@ jobs: - name: Use cache uses: Swatinem/rust-cache@v2 - - name: Patch uniffi-dart dependency + - name: Fetch and bump bdk-ffi to uniffi 0.32 + # bdk-dart re-exports bdk-ffi, pinned by git rev at uniffi 0.31.2 — so the + # metadata bdk_dart_ffi embeds is 0.31 and this PR's 0.32 bindgen cannot + # read it. Clone that exact rev, bump its uniffi to 0.32 (it compiles + # clean on 0.32), and `[patch]` bdk-dart onto the local copy. Removed once + # bdk-ffi ships 0.32 upstream. run: | + BDK_FFI_REV=17c48b8b52ba81cdc58531e75ad1165be0cc25d9 + git init -q bdk-ffi + git -C bdk-ffi remote add origin https://github.com/bitcoindevkit/bdk-ffi.git + git -C bdk-ffi fetch --depth 1 origin "$BDK_FFI_REV" -q + git -C bdk-ffi checkout -q FETCH_HEAD + sed -i 's/uniffi = { version = "=0.31.2"/uniffi = { version = "0.32"/g' bdk-ffi/bdk-ffi/Cargo.toml + echo "--- bdk-ffi uniffi pins now ---" + grep -n 'uniffi = ' bdk-ffi/bdk-ffi/Cargo.toml || true + + - name: Patch bdk-dart onto uniffi 0.32 (uniffi, uniffi-dart, bdk-ffi) + run: | + # bdk-dart's own native crate also pins uniffi 0.31.2 — bump it too. + sed -i 's/uniffi = { version = "=0.31.2"/uniffi = { version = "0.32"/g' bdk-dart/native/Cargo.toml cat >> bdk-dart/native/Cargo.toml << 'EOF' [patch.'https://github.com/Uniffi-Dart/uniffi-dart'] uniffi-dart = { path = "../../main" } + + [patch.'https://github.com/bitcoindevkit/bdk-ffi.git'] + bdk-ffi = { path = "../../bdk-ffi/bdk-ffi" } EOF + # Lockfile pins uniffi 0.31.2 / the old bdk-ffi rev; drop it so the bump + # and patches re-resolve cleanly. + rm -f bdk-dart/native/Cargo.lock + echo "--- bdk-dart native uniffi pins now ---" + grep -n 'uniffi = ' bdk-dart/native/Cargo.toml || true - name: Generate dart bindings and run tests run: cd bdk-dart && bash scripts/generate_bindings.sh && dart test From c1fd2302ff7237da11a11cf4b7fcbeda921d947b Mon Sep 17 00:00:00 2001 From: Sasha Denisov Date: Thu, 3 Sep 2026 13:51:26 +0200 Subject: [PATCH 2/5] ci(downstream): drop bdk-dart's rustc 1.85.1 pin (uniffi 0.32 needs 1.91) --- .github/workflows/test-downstream.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-downstream.yml b/.github/workflows/test-downstream.yml index 504890a..81c9fcd 100644 --- a/.github/workflows/test-downstream.yml +++ b/.github/workflows/test-downstream.yml @@ -113,6 +113,10 @@ jobs: # Lockfile pins uniffi 0.31.2 / the old bdk-ffi rev; drop it so the bump # and patches re-resolve cleanly. rm -f bdk-dart/native/Cargo.lock + # bdk-dart pins rustc 1.85.1 via rust-toolchain.toml, but uniffi 0.32 + # (via our uniffi-dart) needs 1.91 — drop the pin so the job's installed + # stable toolchain (>=1.91) is used. + find bdk-dart bdk-ffi -name rust-toolchain.toml -delete 2>/dev/null || true echo "--- bdk-dart native uniffi pins now ---" grep -n 'uniffi = ' bdk-dart/native/Cargo.toml || true From d199401b77493952913387dee6447c0fa63431d0 Mon Sep 17 00:00:00 2001 From: Sasha Denisov Date: Thu, 3 Sep 2026 13:54:29 +0200 Subject: [PATCH 3/5] ci(downstream): rewrite payjoin+bdk rust-toolchain pins to stable (1.85.1 < 0.32's 1.91) --- .github/workflows/test-downstream.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-downstream.yml b/.github/workflows/test-downstream.yml index 81c9fcd..77a2ff8 100644 --- a/.github/workflows/test-downstream.yml +++ b/.github/workflows/test-downstream.yml @@ -50,6 +50,12 @@ jobs: # rust-payjoin ships 0.32 upstream. run: | sed -i 's/uniffi = { version = "0.31.2"/uniffi = { version = "0.32"/g' rust-payjoin/payjoin-ffi/Cargo.toml + # payjoin's native-assets build pins rustc 1.85.1 (< uniffi 0.32's 1.91 + # floor); rewrite every rust-toolchain.toml to the job's installed + # stable (>=1.91), keeping the stable channel it was already on. + for f in $(find rust-payjoin -name rust-toolchain.toml); do + printf '[toolchain]\nchannel = "stable"\n' > "$f" + done echo "--- payjoin-ffi uniffi pins now ---" grep -n 'uniffi = ' rust-payjoin/payjoin-ffi/Cargo.toml || true @@ -113,10 +119,12 @@ jobs: # Lockfile pins uniffi 0.31.2 / the old bdk-ffi rev; drop it so the bump # and patches re-resolve cleanly. rm -f bdk-dart/native/Cargo.lock - # bdk-dart pins rustc 1.85.1 via rust-toolchain.toml, but uniffi 0.32 - # (via our uniffi-dart) needs 1.91 — drop the pin so the job's installed - # stable toolchain (>=1.91) is used. - find bdk-dart bdk-ffi -name rust-toolchain.toml -delete 2>/dev/null || true + # bdk-dart/bdk-ffi pin rustc 1.85.1 via rust-toolchain.toml, but uniffi + # 0.32 (via our uniffi-dart) needs 1.91 — rewrite each to the job's + # installed stable (>=1.91), keeping the stable channel. + for f in $(find bdk-dart bdk-ffi -name rust-toolchain.toml); do + printf '[toolchain]\nchannel = "stable"\n' > "$f" + done echo "--- bdk-dart native uniffi pins now ---" grep -n 'uniffi = ' bdk-dart/native/Cargo.toml || true From cfe7cbb619525c0ffcd6cfdeff58bb7cb549d771 Mon Sep 17 00:00:00 2001 From: Sasha Denisov Date: Thu, 3 Sep 2026 14:00:04 +0200 Subject: [PATCH 4/5] ci(downstream): bump only rust-toolchain channel, keep targets (RustBuilder needs it) --- .github/workflows/test-downstream.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-downstream.yml b/.github/workflows/test-downstream.yml index 77a2ff8..8944263 100644 --- a/.github/workflows/test-downstream.yml +++ b/.github/workflows/test-downstream.yml @@ -51,10 +51,10 @@ jobs: run: | sed -i 's/uniffi = { version = "0.31.2"/uniffi = { version = "0.32"/g' rust-payjoin/payjoin-ffi/Cargo.toml # payjoin's native-assets build pins rustc 1.85.1 (< uniffi 0.32's 1.91 - # floor); rewrite every rust-toolchain.toml to the job's installed - # stable (>=1.91), keeping the stable channel it was already on. + # floor). Bump only the channel to the job's installed stable (>=1.91), + # preserving the [toolchain] `targets` the RustBuilder hook requires. for f in $(find rust-payjoin -name rust-toolchain.toml); do - printf '[toolchain]\nchannel = "stable"\n' > "$f" + sed -i 's/^channel = .*/channel = "stable"/' "$f" done echo "--- payjoin-ffi uniffi pins now ---" grep -n 'uniffi = ' rust-payjoin/payjoin-ffi/Cargo.toml || true @@ -120,10 +120,11 @@ jobs: # and patches re-resolve cleanly. rm -f bdk-dart/native/Cargo.lock # bdk-dart/bdk-ffi pin rustc 1.85.1 via rust-toolchain.toml, but uniffi - # 0.32 (via our uniffi-dart) needs 1.91 — rewrite each to the job's - # installed stable (>=1.91), keeping the stable channel. + # 0.32 (via our uniffi-dart) needs 1.91. Bump only the channel to the + # job's installed stable (>=1.91), preserving the [toolchain] `targets` + # the RustBuilder hook requires. for f in $(find bdk-dart bdk-ffi -name rust-toolchain.toml); do - printf '[toolchain]\nchannel = "stable"\n' > "$f" + sed -i 's/^channel = .*/channel = "stable"/' "$f" done echo "--- bdk-dart native uniffi pins now ---" grep -n 'uniffi = ' bdk-dart/native/Cargo.toml || true From e7227e938ce6de8f405329428d118e7dbad04216 Mon Sep 17 00:00:00 2001 From: Sasha Denisov Date: Thu, 3 Sep 2026 14:05:28 +0200 Subject: [PATCH 5/5] ci(downstream): pin exact rust 1.91.0 + host target (native_toolchain_rust rejects 'stable') --- .github/workflows/test-downstream.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-downstream.yml b/.github/workflows/test-downstream.yml index 8944263..3811614 100644 --- a/.github/workflows/test-downstream.yml +++ b/.github/workflows/test-downstream.yml @@ -51,10 +51,11 @@ jobs: run: | sed -i 's/uniffi = { version = "0.31.2"/uniffi = { version = "0.32"/g' rust-payjoin/payjoin-ffi/Cargo.toml # payjoin's native-assets build pins rustc 1.85.1 (< uniffi 0.32's 1.91 - # floor). Bump only the channel to the job's installed stable (>=1.91), - # preserving the [toolchain] `targets` the RustBuilder hook requires. + # floor). native_toolchain_rust requires an *exact* channel and a + # `targets` list, so pin 1.91.0 with just the Linux host target (the CI + # only builds for the host). for f in $(find rust-payjoin -name rust-toolchain.toml); do - sed -i 's/^channel = .*/channel = "stable"/' "$f" + printf '[toolchain]\nchannel = "1.91.0"\ntargets = ["x86_64-unknown-linux-gnu"]\n' > "$f" done echo "--- payjoin-ffi uniffi pins now ---" grep -n 'uniffi = ' rust-payjoin/payjoin-ffi/Cargo.toml || true @@ -119,12 +120,11 @@ jobs: # Lockfile pins uniffi 0.31.2 / the old bdk-ffi rev; drop it so the bump # and patches re-resolve cleanly. rm -f bdk-dart/native/Cargo.lock - # bdk-dart/bdk-ffi pin rustc 1.85.1 via rust-toolchain.toml, but uniffi - # 0.32 (via our uniffi-dart) needs 1.91. Bump only the channel to the - # job's installed stable (>=1.91), preserving the [toolchain] `targets` - # the RustBuilder hook requires. + # bdk-dart/bdk-ffi pin rustc 1.85.1, but uniffi 0.32 needs 1.91. + # native_toolchain_rust requires an *exact* channel and a `targets` + # list, so pin 1.91.0 with just the Linux host target. for f in $(find bdk-dart bdk-ffi -name rust-toolchain.toml); do - sed -i 's/^channel = .*/channel = "stable"/' "$f" + printf '[toolchain]\nchannel = "1.91.0"\ntargets = ["x86_64-unknown-linux-gnu"]\n' > "$f" done echo "--- bdk-dart native uniffi pins now ---" grep -n 'uniffi = ' bdk-dart/native/Cargo.toml || true