aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xselftest23
1 files changed, 23 insertions, 0 deletions
diff --git a/selftest b/selftest
new file mode 100755
index 0000000..126f5e8
--- /dev/null
+++ b/selftest
@@ -0,0 +1,23 @@
+#!/bin/bash
+# selftest — build six twice and assert the wheels tarballs are byte-identical.
+# The smallest check that fails if the reproducible-tar normalization breaks.
+set -eu
+
+here=$(cd "$(dirname "$0")" && pwd)
+tmp=$(mktemp -d)
+trap 'rm -rf "$tmp"' EXIT
+
+# Fixed epoch so both runs use the same mtime (we are testing tar determinism,
+# not epoch derivation).
+OUTPUT="$tmp/a" "$here/mkwheels" six 1.16.0 1620000000 >/dev/null
+OUTPUT="$tmp/b" "$here/mkwheels" six 1.16.0 1620000000 >/dev/null
+
+a=$(md5sum "$tmp/a/six-wheels-1.16.0.tar.gz" | cut -d' ' -f1)
+b=$(md5sum "$tmp/b/six-wheels-1.16.0.tar.gz" | cut -d' ' -f1)
+
+if [ "$a" = "$b" ]; then
+ echo "PASS: reproducible ($a)"
+else
+ echo "FAIL: tarballs differ ($a != $b)" >&2
+ exit 1
+fi