Skip to content

Commit b1c92d7

Browse files
committed
check only that symbol names are deterministic
Full binary reproducible builds are not possible on all platforms because linker injects a certain amount of randomness, apparently. Or, at minimum, they don't work reliably yet.
1 parent 4887c94 commit b1c92d7

File tree

1 file changed

+9
-3
lines changed
  • src/test/run-make/reproducible-build

1 file changed

+9
-3
lines changed

src/test/run-make/reproducible-build/Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ all:
33
$(RUSTC) reproducible-build-aux.rs
44
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build1"
55
$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build2"
6-
cmp "$(TMPDIR)/reproducible-build1" "$(TMPDIR)/reproducible-build2" || exit 1
6+
nm "$(TMPDIR)/reproducible-build1" | sort > "$(TMPDIR)/reproducible-build1.nm"
7+
nm "$(TMPDIR)/reproducible-build2" | sort > "$(TMPDIR)/reproducible-build2.nm"
8+
cmp "$(TMPDIR)/reproducible-build1.nm" "$(TMPDIR)/reproducible-build2.nm" || exit 1
79
$(RUSTC) reproducible-build-aux.rs -g
810
$(RUSTC) reproducible-build.rs -g -o"$(TMPDIR)/reproducible-build1-debug"
911
$(RUSTC) reproducible-build.rs -g -o"$(TMPDIR)/reproducible-build2-debug"
10-
cmp "$(TMPDIR)/reproducible-build1-debug" "$(TMPDIR)/reproducible-build2-debug" || exit 1
12+
nm "$(TMPDIR)/reproducible-build1-debug" | sort > "$(TMPDIR)/reproducible-build1-debug.nm"
13+
nm "$(TMPDIR)/reproducible-build2-debug" | sort > "$(TMPDIR)/reproducible-build2-debug.nm"
14+
cmp "$(TMPDIR)/reproducible-build1-debug.nm" "$(TMPDIR)/reproducible-build2-debug.nm" || exit 1
1115
$(RUSTC) reproducible-build-aux.rs -O
1216
$(RUSTC) reproducible-build.rs -O -o"$(TMPDIR)/reproducible-build1-opt"
1317
$(RUSTC) reproducible-build.rs -O -o"$(TMPDIR)/reproducible-build2-opt"
14-
cmp "$(TMPDIR)/reproducible-build1-opt" "$(TMPDIR)/reproducible-build2-opt" || exit 1
18+
nm "$(TMPDIR)/reproducible-build1-opt" | sort > "$(TMPDIR)/reproducible-build1-opt.nm"
19+
nm "$(TMPDIR)/reproducible-build2-opt" | sort > "$(TMPDIR)/reproducible-build2-opt.nm"
20+
cmp "$(TMPDIR)/reproducible-build1-opt.nm" "$(TMPDIR)/reproducible-build2-opt.nm" || exit 1

0 commit comments

Comments
 (0)