Skip to content

Commit 2349471

Browse files
authored
Merge pull request #92 from AkihiroSuda/dev
`make artifacts`: remove dependency on GNU tar and GNU coreutils
2 parents 117bee8 + 605e0d2 commit 2349471

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.github/workflows/qemu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: launchctl print system/io.github.lima-vm.socket_vmnet
4141
- name: Install test dependencies
4242
run: |
43-
brew install qemu bash coreutils
43+
brew install qemu bash
4444
- name: Test (shared mode)
4545
run: ./test/test.sh /var/run/socket_vmnet
4646
# Bridged mode cannot be tested on GHA

.github/workflows/release.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ jobs:
3232
fetch-depth: 0
3333
ref: ${{ github.event.pull_request.head.sha }}
3434
- name: "Install dependencies"
35-
# coreutils: For `gtouch -d @${SOURCE_DATE_EPOCH}`
3635
# diffoscope: For `make test.repro`
37-
run: brew install coreutils diffoscope
36+
run: brew install diffoscope
3837
- name: "Test reproducibility"
3938
run: |
4039
make test.repro

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ PREFIX ?= /opt/socket_vmnet
55
DEBUG ?=
66

77
export SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct)
8-
# https://reproducible-builds.org/docs/archives/
9-
TAR ?= gtar --sort=name --mtime="@$(SOURCE_DATE_EPOCH)" --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime
10-
TOUCH ?= gtouch -d @$(SOURCE_DATE_EPOCH)
8+
SOURCE_DATE_EPOCH_ISO8601 := $(shell date -u -Iseconds -r $(SOURCE_DATE_EPOCH) | sed -e s/+00:00/Z/)
9+
10+
TAR ?= tar --uid=0 --gid=0 --numeric-owner
11+
TOUCH ?= touch -d $(SOURCE_DATE_EPOCH_ISO8601)
1112
# Not necessary to use GNU's gzip
1213
GZIP ?= gzip -9 -n
1314
DIFFOSCOPE ?= diffoscope
@@ -130,7 +131,10 @@ define make_artifacts
130131
rm -rf _artifacts/$(1)
131132
$(MAKE) ARCH=$(1) DESTDIR=_artifacts/$(1) install.bin install.doc
132133
file -bp _artifacts/$(1)/$(PREFIX)/bin/socket_vmnet | grep -q "Mach-O 64-bit executable $(1)"
133-
$(TAR) -C _artifacts/$(1) -cf _artifacts/socket_vmnet-$(VERSION_TRIMMED)-$(1).tar ./
134+
# BSD tar does not have `--mtime=TIMESTAMP` option
135+
find _artifacts/$(1) -exec $(TOUCH) {} \;
136+
# BSD tar does not have `--sort=name` option
137+
(cd _artifacts/$(1) && find -s . -print0 | $(TAR) -cf ../socket_vmnet-$(VERSION_TRIMMED)-$(1).tar --null -n --files-from /dev/stdin)
134138
$(GZIP) _artifacts/socket_vmnet-$(VERSION_TRIMMED)-$(1).tar
135139
rm -rf _artifacts/$(1)
136140
$(MAKE) clean

0 commit comments

Comments
 (0)