fix: pin logos-libp2p-module's libp2p input to a SHA (deleted upstream branch) - #94
Conversation
…m branch) The nightly bump's "Update flake.lock" step failed: error: unable to download 'https://api.github.com/repos/vacp2p/nim-libp2p/commits/feat/cbind/xpr-decode': HTTP error 422 logos-libp2p-module pins its `libp2p` input to the upstream branch `vacp2p/nim-libp2p/feat/cbind/xpr-decode`, which was deleted. Re-locking that input (nix flake lock --update-input logos-libp2p-module) re-resolves the branch ref and 422s, so the candidate is never staged. Override `libp2p` at the workspace level to the exact SHA the branch last pointed at (7c73484c — what the lock already resolved to; never merged to master, reachable only by SHA). Behavior-preserving. Because the nightly runs `ws sync-graph` BEFORE the lock update — which regenerates the auto-inputs block of flake.nix — a hand-edited override would be wiped every run. So the override is emitted by sync-graph itself via a new `get_manual_url_overrides` helper (mirrors `get_manual_follows`), and also applied to the committed flake.nix/flake.lock so master is self-consistent now. Stopgap until logos-libp2p-module SHA-pins libp2p in its own flake.nix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens the workspace’s Nix flake graph generation so the nightly lock update doesn’t fail when a downstream repo pins a now-deleted upstream branch, by overriding that downstream repo’s transitive input to a specific commit SHA.
Changes:
- Add a
scripts/wshook (get_manual_url_overrides) sows sync-graphcan emit per-repo transitive input URL overrides into the generatedflake.nixinputs block. - Apply a workspace-level override for
logos-libp2p-module’s transitivelibp2pinput, pinning it to a specificnim-libp2pSHA. - Re-lock the workspace so the
libp2pnode resolves viarev(SHA) rather than an upstreamref.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/ws | Introduces and wires a new sync-graph mechanism to emit transitive input URL overrides per repo. |
| flake.nix | Adds the logos-libp2p-module.inputs.libp2p.url override to pin nim-libp2p by SHA. |
| flake.lock | Updates the locked libp2p node to point to the SHA-pinned nim-libp2p revision. |
| local url_overrides | ||
| url_overrides=$(get_manual_url_overrides "$input_name") | ||
| if [[ -z "$follows_sorted" && -z "$url_overrides" ]]; then |
There was a problem hiding this comment.
Fixed in 8174c91 — the kept overrides are now sorted (printf | sort) before emission, so multiple overrides produce deterministic, idempotent output.
| while IFS=$'\t' read -r u_iname u_url; do | ||
| [[ -z "$u_iname" ]] && continue | ||
| echo " inputs.${u_iname}.url = \"${u_url}\";" >> "$flake_inputs_tmp" | ||
| done <<< "$url_overrides" |
There was a problem hiding this comment.
Fixed in 8174c91 — each override iname is now filtered against the downstream flake's declared_set (the same guard the follows path uses); a non-declared input is skipped with a warning instead of emitting a stale override.
Address review feedback on get_manual_url_overrides emission: - Filter each override iname against the downstream flake's declared_set (same guard the follows path uses) so a renamed/removed upstream input can't leave a stale override that adds a spurious lock node; warn on skip. - Sort the kept overrides for deterministic, idempotent flake.nix output when a repo ever declares more than one override. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Problem
The Nightly Bump fails at Update flake.lock:
logos-libp2p-modulepins itslibp2pinput to the upstream branchgithub:vacp2p/nim-libp2p/feat/cbind/xpr-decode, which has been deleted upstream. The nightly step runsnix flake lock --update-input logos-libp2p-module, which re-resolves that branch ref → 422 → the step dies and the candidate is never staged.The last-locked commit
7c73484cstill exists but was never merged to master (diverged, reachable only by SHA), so there's no living ref to track — it must be pinned by SHA.Fix
Override
logos-libp2p-module'slibp2pinput at the workspace level to that exact SHA (7c73484cc0c57a5f649dd3d277cef1c7c4de28f0) — the commit the lock already resolved to, so it's behavior-preserving. No change to thelogos-libp2p-modulerepo.Three changes:
scripts/ws— newget_manual_url_overrideshelper (mirrorsget_manual_follows), wired into thecmd_sync_graphflake.nix writer. This is the durable part: the nightly runsws sync-graphbefore the lock update, which regenerates the auto-inputs block — so a hand-edited override would be wiped every run. The override must be emitted by sync-graph.flake.nix— one line pinning the input to the SHA (matches what sync-graph now emits → idempotent).flake.lock— re-locked so thelibp2pnode'soriginal+lockedboth point at the SHA.nix/dep-graph.nixis untouched (a URL override adds no workspace follows).Verification
nix flake lock --update-input logos-libp2p-module(the exact nightly command) now exits0with no 422.ws sync-graphre-emits the override forlogos-libp2p-module, so it survives the nightly.Follow-up
Stopgap until
logos-libp2p-moduleSHA-pinslibp2pin its ownflake.nix; the override can be dropped once that lands.🤖 Generated with Claude Code