Trigger JavaScript CI on dependency manifest changes - #1787
Draft
DanGould wants to merge 1 commit into
Draft
Conversation
The JavaScript workflow is the only place the tree is compiled for wasm32-unknown-unknown. It builds through payjoin-ffi's `wasm_js` feature, which resolves to `getrandom/js` — the browser entropy backend behind the input/output shuffle in payjoin/src/core/receive/common/mod.rs. That backend is supplied entirely by the dependency graph, so a dependency bump can drop it without touching a single file under payjoin-ffi/ and the workflow's path filter would skip the build. The concrete case ahead of us is bitcoin 0.33, which moves rand 0.8 -> 0.9 and getrandom 0.2 -> 0.3, where the `js` feature is replaced by `wasm_js` *plus* a required RUSTFLAGS='--cfg getrandom_backend="wasm_js"'. A feature-only declaration silently stops being sufficient. Gate on the manifests and the lockfile so any dependency change runs the wasm build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DanGould
marked this pull request as draft
August 5, 2026 04:25
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.
Problem
javascript.ymlis the only workflow that compiles the tree forwasm32-unknown-unknown, and itspull_requesttrigger is filtered topayjoin-ffi/**(plus the flake, added in 1d8fe17).That build is load-bearing for more than the bindings.
ubrn.web.config.yamlbuilds with:which resolves through
payjoin-ffi/Cargo.toml:14(wasm_js = ["getrandom/js"]) to getrandom's browser backend. That backend is what supplies entropy torand::thread_rng()inpayjoin/src/core/receive/common/mod.rs:90and:310— the input and output shuffles. Onwasm32-unknown-unknownthere is no OS randomness syscall, so without it there is no entropy source at all.The backend is contributed entirely by the dependency graph. A dependency bump can drop it without touching a single file under
payjoin-ffi/, and the path filter means CI never builds wasm to find out.The concrete case is close: bumping
bitcoin0.32 → 0.33 moves rand 0.8 → 0.9 and getrandom 0.2 → 0.3. In getrandom 0.3 thejsfeature is removed and replaced by awasm_jsfeature plus a requiredRUSTFLAGS='--cfg getrandom_backend="wasm_js"'. A feature-only declaration silently stops being sufficient — and the name collision with our ownwasm_jsfeature makeswasm_js = ["getrandom/wasm_js"]look correct while still being incomplete.Fix
Add the manifests and the lockfile to the path filter, so any dependency change runs the wasm build:
This targets the dependency vector specifically. Source edits under
payjoin/cannot change which getrandom backend is selected; dependency changes necessarily touchCargo.lock.Why not a standalone
cargo checkjob in rust.ymlThat was the first thing I tried, and it does not work:
uniffi_coreneedswasm-unstable-single-threadedon wasm32, and that feature is only applied to the ubrn-generated crate viawasm-manifest-patch.toml. Reproducing it outside ubrn means duplicating the patch, which is exactly the sort of thing that drifts. Widening the existing, working build's trigger is the cheaper and more honest fix.Trade-off
Nearly every PR touches
Cargo.lock, so in practice this runs the 2-OS JavaScript build on most PRs. If that's too much CI time, the narrower option isCargo.lockalone (dependency resolution is what actually matters here) — happy to trim.Conversely, if you'd rather also catch source-level wasm breakage — something like a
std::time::Instantcreeping intopayjoin/whereweb-timeis needed — addingpayjoin/**would cover that too, at more CI cost.Testing
wasm_js→getrandom/jsactivation: enabling the feature pullswasm-bindgeninto the dependency graph, which only enters via getrandom's js backend.cargo checkfailure above is real, not a toolchain artifact (run insidenix develop .#javascript, which provides the wasm32 target and theCC_wasm32_unknown_unknown/AR_wasm32_unknown_unknownthat secp256k1-sys needs).yq '.on.pull_request.paths').payjoin-ffi/javascript/contrib/test.sh. It fails in my environment atnpm ciwithyarn: command not found— theuniffi-bindgen-react-nativegit dependency'spreparescript shells out to yarn, which thejavascriptdevshell doesn't provide. GitHub's ubuntu/macos runners ship yarn preinstalled, so CI is unaffected, but it may be worth adding yarn tojavascriptDevShellseparately so the script is runnable under plainnix develop.🤖 Generated with Claude Code