ci: fix nix build (bech32 vendoring failure) - #4
Merged
Conversation
The "Merge new-index branch into cake-update-v1" merge (9dffb84) resolved the Cargo.lock conflict by taking the upstream side for the crate stanzas while keeping the `silentpayments` git package from the cake side. That dropped every package only silentpayments depends on, leaving the lock internally inconsistent: the `silentpayments` entry referenced `bech32 0.9.1`, `bitcoin_hashes 0.13.0` and `secp256k1 0.28.2`, none of which had a [[package]] stanza of their own. The cargo-based CI jobs do not pass --locked, so they silently repaired the lock over the network and stayed green. The `nix` job builds with crane, which vendors strictly from the committed Cargo.lock into a directory source that replaces crates-io and then builds offline, so the missing stanzas were unrecoverable: error: failed to select a version for the requirement `bech32 = "^0.9"` candidate versions found which didn't match: 0.11.0, 0.8.1 Regenerate the lock with the pinned toolchain (cargo 1.75.0, per rust-toolchain.toml). The change is purely additive: 5 packages added, none removed, no existing version changed, silentpayments git rev unchanged. Verified with `cargo check --locked --release --all-features` (the same resolution crane performs offline), which now succeeds and compiles bech32 0.9.1, bitcoin_hashes 0.13.1, secp256k1 0.28.2 and silentpayments. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plain cargo silently repairs an inconsistent Cargo.lock over the network, which is how the merge-corrupted lock fixed in the previous commit shipped unnoticed in February and only surfaced in the nix job's offline vendored build. With --locked, the fast check job fails immediately on any lock/manifest mismatch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Root cause
Cargo.lockis internally inconsistent — it is missing the[[package]]stanzas for the crates that onlysilentpaymentsdepends on.The
silentpaymentsentry declares:but the lock only contained
bech320.8.1 and 0.11.0, and had nobitcoin_hashes 0.13.xorsecp256k1 0.28.xat all. Theelectrspackage entry had also lost its ownhexdependency (declared ashex = "0.4"inCargo.toml).This was introduced by commit
9dffb84"Merge new-index branch into cake-update-v1" (2026-02-13). TheCargo.lockconflict was resolved by taking the upstream (new-index) side for the crate stanzas, while keeping thesilentpaymentspackage entry from the cake side:cf9e03b(cake parent)477c1a3(new-index parent)9dffb84(merge result)Why only the
nixjob failsThe
check/test/test-liquidjobs run plaincargo, which does not pass--locked. Cargo silently repairs the incomplete lock over the network and carries on, so those jobs stay green and the corruption goes unnoticed.The
nixjob builds with crane, which vendors dependencies strictly from the committedCargo.lockinto a directory source that replaces thecrates-ioregistry, then builds offline. A stanza that isn't in the lock simply doesn't get vendored and cannot be recovered:The
--all-featuresinflake.nix(added inc7d0da2as an earlier attempt at this bug) is what pulls thesilent-paymentsfeature — and thereforesilentpayments— into the deps derivation. It is correct and is left as-is; the lock was the actual problem.The fix
Regenerated
Cargo.lockwith the pinned toolchain (cargo 1.75.0, matchingrust-toolchain.tomland the CI jobs). The change is purely additive:Added (5):
bech32 0.9.1,bitcoin_hashes 0.13.1,hex-conservative 0.1.2,secp256k1 0.28.2,secp256k1-sys 0.9.2Removed (0). No existing package version changed. Lock format stays
version = 3. Thesilentpaymentsgit rev is unchanged (48e2730d).Also incidental and required:
silentpayments' danglingbitcoin_hashes 0.13.0reference now resolves to the real0.13.1;electrsregains its declaredhexdependency; and existing barehex-conservativereferences are version-disambiguated now that two versions coexist.Evidence
--lockedis a faithful proxy for crane's offline vendored build — it forbids exactly the network lock-repair that masks this bug:Historical failures
The
nixjob has failed on every run ofcake-update-v2since the branch's first CI run on 2026-02-24, and identically on the unrelated PR #3:cake-update-v2run 22369719686 (2026-02-24, first run on the branch) — through run 22379579959 (2026-02-25); 11 runs, all failingbech32 = ^0.9signature, confirming it is a base-branch defect and not PR perf(sp): eliminate per-tx DB iterator reads in tweaks.subscribe #3's workThe last green CI run was 21997190123 on
new-index(2026-02-13), which predates silentpayments on that branch entirely.Caveat
cargo check --all-features --all-targets(crane's exact command, including dev-dependencies) cannot be reproduced on macOS: theelectrumddev-dependency'sbuild.rsdefinesdownload_filename()only undercfg(all(target_os = "linux", target_arch = "x86_64"))and calls it unconditionally, so it fails to compile on any other platform regardless ofELECTRUMD_SKIP_DOWNLOAD. That is pre-existing and unrelated to this change; CI runs linux-x86_64, where it compiles. The all-features check above was run without--all-targetsfor this reason, and thenixcheck on this PR is the authoritative verification.🤖 Generated with Claude Code