Skip to content

Commit

Permalink
Replace sha1sum with gsha1sum on macOS
Browse files Browse the repository at this point in the history
Recent macOS updates introduced /sbin/sha1sum, which is not GNU's
sha1sum and is incompatible with its implementation. This causes the
sha1sum test in make artifact to always pass because the test
currently relies on detecting the string "FAILED" in the stderr
output.

Apple's sha1sum does not support the -c (checksum verification) option,
making it unsuitable for verifying artifact integrity.
  • Loading branch information
otteryc committed Jan 28, 2025
1 parent 418a9e6 commit 29ba3a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mk/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ NC = \033[0m
notice = $(PRINTF) "$(PASS_COLOR)$(strip $1)$(NO_COLOR)\n"

# File utilities
SHA1SUM = sha1sum
SHA1SUM := $(shell which $(SHA1SUM))
ifeq ($(UNAME_S),Darwin)
SHA1SUM = gsha1sum
SHA1SUM := $(shell which $(SHA1SUM))
else
SHA1SUM = sha1sum
SHA1SUM := $(shell which $(SHA1SUM))
endif

ifndef SHA1SUM
SHA1SUM = shasum
SHA1SUM := $(shell which $(SHA1SUM))
Expand Down

0 comments on commit 29ba3a2

Please sign in to comment.