aboutsummaryrefslogtreecommitdiff
path: root/ci/verify-repro.sh
blob: d412713b7efac9824da8195d3a7f95c0d22615bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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