Skip to content

build(nix): fix vendorHash + sandbox tests, automate hash upkeep - #1255

Merged
dayvidpham merged 1 commit into
jonathanung:mainfrom
dayvidpham:fix/nix-vendor-hash
Aug 28, 2026
Merged

dayvidpham merged 1 commit into
jonathanung:mainfrom
dayvidpham:fix/nix-vendor-hash

Conversation

@dayvidpham

Copy link
Copy Markdown
Collaborator

Problem

nix build on main fails twice over:

  1. vendorHash mismatchgo.sum changed but flake.nix still had the old hash:
    specified: sha256-ax5mSaryrwb+vSoqm6+Brl6RnA/2WZm+z+eEdxubhtQ=
    got:       sha256-kEJmV3MQt8k5KuXBjYoUy7+ZZrD3aTljpBziaRndJcU=
    
  2. Sandbox test failures (hidden behind feat: /effort command to set reasoning effort per provider #1) — TestRunEvalSWEBenchDryRun, TestRunEvalTBenchDryRun, TestRunEvalTBenchWithTasksDir, TestRunEvalSweepDryRun all mkdir under $HOME, which is the unwritable /homeless-shelter in the Nix sandbox.

Neither surfaced in CI because no job runs Nix.

Changes

  • flake.nix: correct vendorHash; preCheck sets HOME to a tmpdir.
  • scripts/update-nix-vendor-hash.sh / make nix-vendor-hash: swaps in lib.fakeHash, builds only .#default.goModules (the fixed-output module-download derivation — no compile), and writes the reported hash back. Restores the original on any failure.
  • .github/workflows/nix-vendor-hash.yml: on pushes to main touching go.mod/go.sum/go.work*/flake.*, recomputes and pushes chore(nix): update vendorHash if drifted. Also workflow_dispatch.

Verified

  • nix build .#default succeeds (tests pass in sandbox).
  • Script reports "already current" on the right hash and correctly rewrites a deliberately stale one.

Notes

  • Uses GITHUB_TOKEN; a bot push won't re-trigger other workflows. Fine for a hash fixup on main, but swap in a PAT/App token if you want CI to re-run on it.

🤖 Generated with Claude Code

nix build failed with a vendorHash mismatch (go.sum drifted), and once
past that, four cmd/strike eval tests failed because they mkdir under
$HOME, which is the unwritable /homeless-shelter in the Nix sandbox.

- flake.nix: update vendorHash; set HOME to a tmpdir in preCheck
- scripts/update-nix-vendor-hash.sh + `make nix-vendor-hash`: recompute
  the hash by building only .#default.goModules (the fixed-output module
  derivation), no compile
- .github/workflows/nix-vendor-hash.yml: run on pushes to main touching
  go.mod/go.sum/go.work*/flake.*, push a fixup commit on drift

Files: flake.nix, Makefile, scripts/update-nix-vendor-hash.sh, .github/workflows/nix-vendor-hash.yml

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dayvidpham
dayvidpham merged commit 1b4d31f into jonathanung:main Aug 28, 2026
3 checks passed
dayvidpham added a commit to dayvidpham/dotfiles that referenced this pull request Aug 28, 2026
- tuicr: new input github:agavra/tuicr, exposed as pkgs.tuicr via
  overlay (flake exports packages.<system>.default, not .tuicr), and
  added to minttea's home packages
- strike: move input from dayvidpham/strike feat/nix-installable-flake
  to github:jonathanung/strike now that jonathanung/strike#1255 (vendorHash
  fix + sandbox HOME workaround) is merged; lock at 1b4d31f
- reorder inputs so "My stuff" section groups own forks

Files: flake.nix, flake.lock, users/minttea/home.nix

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant