Skip to content

build: make build-release.sh portable to macOS - #45

Merged
vmrocha merged 1 commit into
mainfrom
build/portable-release-script
Oct 19, 2026
Merged

vmrocha merged 1 commit into
mainfrom
build/portable-release-script

Conversation

@vmrocha

@vmrocha vmrocha commented Oct 19, 2026

Copy link
Copy Markdown
Owner

build-release.sh could not run on macOS: sha256sum is absent and BSD tar rejects --sort=name / --mtime=@<epoch>.

  • Add a sha256 helper that falls back to shasum -a 256 (identical output format).
  • Replace --sort=name / --mtime with a portable set_tarball_mtimes that normalises each staged file's mtime to the source epoch (date -u -d on GNU, -r on BSD; TZ=UTC touch -t).
  • Entry order is already fixed by the explicit file list, so dropping --sort=name is a no-op on GNU tar; --owner=0 --group=0 --numeric-owner work on both.

Verified on macOS: all four archives build, shasum -a 256 --check passes, entries show uid/gid 0 and the source-epoch mtime, the extracted binary reports the injected version/commit/date, and two runs with identical inputs produce identical checksums. CI (GNU tar) keeps the same flags and output.

@vmrocha
vmrocha merged commit dc19b2b into main Oct 19, 2026
5 checks passed
@vmrocha
vmrocha deleted the build/portable-release-script branch October 19, 2026 02:18
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