[PR #11533] fix(ci): portable hash parsing in nix-hashes workflow #13825

Closed
opened 2026-02-16 18:18:39 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11533

State: closed
Merged: Yes


Summary

  • Fix hash parsing to work on both GNU (Linux) and BSD (macOS) systems

Problem

PR #11495 introduced a regression where darwin hashes in nix/hashes.json include got: prefix (e.g., got:sha256-... instead of sha256-...).

The sed -E regex using \s+ behaves differently on BSD sed (macOS) vs GNU sed (Linux), causing the substitution to fail on darwin runners.

Ref: https://github.com/anomalyco/opencode/pull/11530#issuecomment-3829329185

Solution

Replace complex sed parsing with portable grep -oE to extract sha256 hashes directly. Use tail -n1 to get the got: hash (second match) since nix outputs specified: hash first.

Ref: #11530

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11533 **State:** closed **Merged:** Yes --- ## Summary - Fix hash parsing to work on both GNU (Linux) and BSD (macOS) systems ## Problem PR #11495 introduced a regression where darwin hashes in `nix/hashes.json` include `got:` prefix (e.g., `got:sha256-...` instead of `sha256-...`). The `sed -E` regex using `\s+` behaves differently on BSD sed (macOS) vs GNU sed (Linux), causing the substitution to fail on darwin runners. Ref: https://github.com/anomalyco/opencode/pull/11530#issuecomment-3829329185 ## Solution Replace complex sed parsing with portable `grep -oE` to extract sha256 hashes directly. Use `tail -n1` to get the `got:` hash (second match) since nix outputs `specified:` hash first. Ref: #11530
yindo added the pull-request label 2026-02-16 18:18:39 -05:00
yindo closed this issue 2026-02-16 18:18:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13825