aboutsummaryrefslogtreecommitdiff
path: root/ci/verify-repro.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/verify-repro.sh')
-rwxr-xr-xci/verify-repro.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/ci/verify-repro.sh b/ci/verify-repro.sh
new file mode 100755
index 0000000..d412713
--- /dev/null
+++ b/ci/verify-repro.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Build the native libs twice and diff them, catching nondeterminism early.
+# Requires the Android NDK and Go.
+set -eu
+
+root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
+a=$(mktemp -d)
+b=$(mktemp -d)
+trap 'rm -rf "$a" "$b"' EXIT
+
+make -C "$root" native
+cp -r "$root/app/src/main/jniLibs" "$a/jniLibs"
+
+rm -rf "$root/app/src/main/jniLibs" "$root/rsync/work" "$root/out"
+make -C "$root" native
+cp -r "$root/app/src/main/jniLibs" "$b/jniLibs"
+
+if diff -r "$a/jniLibs" "$b/jniLibs"; then
+ echo "verify-repro: native libs are bit-identical"
+else
+ echo "verify-repro: NONDETERMINISM detected" >&2
+ exit 1
+fi