Repository navigation
chore(deps): pin zmk + zephyr to SHAs, add deps-check for upstream updates - #42
Merged
Merged
Conversation
…dates Completes the pinning started in #38. Every west project is now SHA/tag-pinned, so the same repo commit always produces the same firmware. Two floating refs, not one -------------------------- `config/west.yml` pinned zmk to the branch `v0.3-branch+dya`. Pinning it to a SHA is necessary but NOT sufficient: `zmk/app/west.yml` declares zephyr at the *branch* `v3.5.0+zmk-fixes` (confirmed refs/heads/, not a tag), and freezing zmk only freezes the manifest *file* — west still re-resolves that branch name on every update. So zephyr is now redeclared in config/west.yml, where a top-level project definition takes precedence over the same name in an imported manifest. That override must replicate zmk's entry verbatim — clone-depth: 1 plus the entire import name-blocklist — with only `revision` differing. Verified that `west update` still resolves correctly through it: same SHAs, all 20 hal module directories present, and both halves build byte-identically to before the pin (left 420072 B / 111186 B, right 276908 B / 63660 B). Pins: zmk 4493783e, zephyr dacab4875. deps-check ---------- Pinning trades silent auto-updates for explicit ones, so this adds the task that replaces what is given up. It is the counterpart to `doctor`, looking the opposite way: doctor — does the WORKSPACE match the manifest? (drift from the pin) deps-check — has UPSTREAM moved past the manifest? (updates to the pin) Each pin carries a `# track: <ref>` comment naming the upstream branch it was taken from, or `tags` to compare against the newest remote tag. deps-check reads those, does one `git ls-remote` per project (no fetching, no clones), and reports what moved plus the steps to take an update. First run already found two real ones, which is the point: - eyelash_sofle 4848e21 -> cad1477 (main) - runtime-input-processor zmk-v0.3.0.0 -> zmk-v0.4.0.0 Neither is taken here — bumping the board/shield module or jumping a module major version deserves its own change and its own build verification. Implementation note: this task uses a TOML *literal* string ('''), because the embedded Python needs regex escapes (\s, \S, \d) that a basic string would try to interpret as TOML escapes. Docs: CLAUDE.md gets the zephyr-override rule and the warning to mirror upstream changes to that entry when bumping zmk; README gains "3c. Keeping dependencies current". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
Author
CI verification — the zephyr override works from a clean workspaceMy local Run 33678273351 — green, all three targets. Resolved revisions, parsed from that run's own west output: Memory, versus the last pre-pin main build (33675542224):
Byte-for-byte identical. The pins resolve to exactly what was already building, so this changes nothing about the firmware — only whether it stays that way. No release or reflash needed. |
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.
Completes the pinning started in #38. Every west project is now SHA/tag-pinned, so the same repo commit always produces the same firmware.
Pinning zmk alone would not have worked
The dependency chain floats in two places:
v3.5.0+zmk-fixesisrefs/heads/, a branch — verified against the remote. Pinningzmkto a SHA freezes its manifest file, but that file still saysrevision: v3.5.0+zmk-fixes, a name west re-resolves on every update. Zephyr would have kept floating and the pin would have looked complete while being half-done.So
config/west.ymlnow redeclareszephyrtoo, relying on west's rule that a top-level project definition wins over the same name in an imported manifest. The override replicates zmk's entry verbatim —clone-depth: 1plus the entireimport: name-blocklist— with onlyrevisiondiffering.zmkv0.3-branch+dya4493783ezephyrv3.5.0+zmk-fixes(via zmk's manifest)dacab4875, overridden hereNew task:
mise run deps-checkPinning trades silent auto-updates for explicit ones, so this adds what replaces them. It's the counterpart to
doctorand looks the opposite way:doctordeps-checkEach pin carries a
# track: <ref>comment naming the upstream branch its SHA came from, ortagsto compare against the newest remote tag.deps-checkreads those and does onegit ls-remoteper project — no fetching, no clones — then reports what moved and the steps to take it.The first run already found two real updates, which is the whole point:
Neither is taken in this PR. Bumping the board/shield module, or jumping a module across a major version, each deserves its own change and its own build verification — that's exactly the deliberateness pinning is for.
Verification
west updateresolves correctly through the zephyr override — same SHAs, all 20modules/haldirectories present. This was the real risk (clone-depth: 1against a raw SHA rather than a branch name), so it was tested rather than assumed.mise run doctorpassesdeps-checkoutput above, verified against the actual remotesTrade-off, stated plainly
You no longer get cormoran's fixes automatically. That is the cost, and it is real — if nobody runs
deps-check, this repo can sit on a stale base indefinitely. It's worth it because the old failure mode was silent: two CI runs of an unchanged repo could produce different firmware with no signal at all, and you flash straight from CI artifacts. Explicit staleness you can check for beats silent drift you can't.Churn context:
v0.3-branch+dyalast moved 2026-05-04;v3.5.0+zmk-fixeslast moved 2023-09-07. Low, but "hasn't happened in four months" is not "won't happen".One rule to remember
Bumping
zmkmay require mirroring a change intoconfig/west.yml. If a newzmkrevision changes its own zephyr entry (revision,clone-depth, or the blocklist), the override here goes stale silently. Called out inCLAUDE.md, in a comment inconfig/west.yml, and indeps-check's own output.Docs
CLAUDE.md— the zephyr-override rule, the mirroring warning,deps-checkin the workflow listREADME.md— new "3c. Keeping dependencies current"Implementation note:
deps-checkuses a TOML literal string ('''), because its embedded Python needs regex escapes (\s,\S,\d) that a basic string would try to read as TOML escapes.