Skip to content

fix(nix): verify dependency hashes before releases - #59881

Open
clementpoiret wants to merge 2 commits into
anomalyco:devfrom
clementpoiret:dev
Open

clementpoiret wants to merge 2 commits into
anomalyco:devfrom
clementpoiret:dev

Conversation

@clementpoiret

@clementpoiret clementpoiret commented Oct 28, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #59882

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Nix evaluation misses stale node_modules hashes. Build dependencies natively on all three supported systems, dispatch Nix checks for hash-bot PRs, and gate releases on them.
nix-eval should be run and pass before merging

This problem actually occured with current v2.2.0 release: it can't be installed with the flake, because hashes were updated after the release.

How did you verify your code works?

Workflow linting, ShellCheck, and bot-script smoke tests passed. The Linux dependency build reproduced the existing hash mismatch; hashes remain unchanged.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #52863, #59601

@clementpoiret
clementpoiret requested a review from a team October 28, 2026 11:21
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't run this: it only changes CI workflows, which need GitHub Actions and Nix. I reviewed it by reading the workflows and scripts against each other (release.yml, check-nix.yml, bot-nix-hashes.yml, publish.sh, tag-release.sh, nix/node_modules.nix).

Building node_modules per system is a good idea and would have caught the stale hashes in 2.2.0. As wired up, though, I think it would cause problems:

  1. Every dev and beta build is gated, not just stable releases. release.yml runs on every push to dev and beta, and the new nix job has no condition. bot-nix-hashes only computes new hashes after a dependency change lands on dev. So every commit that changes bun.lock would fail its own dev/beta build until the bot's hash PR merges, and every build now waits on three Nix runners, including macOS.
  2. The concurrency group collides when check-nix.yml is called from release.yml (inline).
  3. Requiring nix-deps on dev, as the description asks maintainers to do, would block every PR that changes dependencies. Those PRs can't pass the check, because their hashes are only produced after merge by the bot. A required check here would need to run only on the bot's bot/nix-hashes PR, or the hash update would need to happen inside the PR.

Public API: unchanged (CI only).

Related: #59601, #59403

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/check-nix.yml Resolved
@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three earlier points are addressed: the release Nix gate now runs only for stable releases, and the downstream jobs keep running when it's skipped on dev/beta; the concurrency group is isolated per run; and nix-deps only runs for the bot's bot/nix-hashes branch or release, with nix-eval as the stable check. I couldn't run it (Actions + Nix aren't available here), so I checked it by reading the needs/if chain of every job in release.yml.

Public API: unchanged (CI only).

One leftover: the description still asks maintainers to make the nix-deps checks required on dev. On ordinary PRs that matrix is skipped, and its per-system checks never report, so requiring them would leave every PR waiting. nix-eval is the check to require; worth updating the description so it isn't set up the wrong way.

@clementpoiret

Copy link
Copy Markdown
Author

For context, il happens to nearly all releases, making opencode hard to install on NixOS using the flake. E.g., current v2.2.5 is also broken

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nix: v2.2.0 build fails with node_modules hash mismatch

1 participant