4 # Objects are reproducible but their path is not.
12 different_source_dirs_rlib \
17 # TODO: Builds of `bin` crate types are not deterministic with debuginfo=2 on
19 # See: https://github.com/rust-lang/rust/pull/87320#issuecomment-920105533
20 # Issue: https://github.com/rust-lang/rust/issues/88982
22 # different_source_dirs_bin \
26 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
28 $(RUSTC) reproducible-build-aux.rs
29 $(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker)
30 $(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker)
31 diff -u "$(TMPDIR)/linker-arguments1" "$(TMPDIR)/linker-arguments2"
34 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
36 $(RUSTC) reproducible-build-aux.rs -g
37 $(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -g
38 $(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -g
39 diff -u "$(TMPDIR)/linker-arguments1" "$(TMPDIR)/linker-arguments2"
42 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
44 $(RUSTC) reproducible-build-aux.rs -O
45 $(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -O
46 $(RUSTC) reproducible-build.rs -C linker=$(call RUN_BINFILE,linker) -O
47 diff -u "$(TMPDIR)/linker-arguments1" "$(TMPDIR)/linker-arguments2"
50 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
51 $(RUSTC) reproducible-build-aux.rs
52 $(RUSTC) reproducible-build.rs --crate-type rlib -L /b
53 cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
54 $(RUSTC) reproducible-build.rs --crate-type rlib -L /a
55 cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
58 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
59 $(RUSTC) reproducible-build-aux.rs
60 $(RUSTC) reproducible-build.rs --crate-type rlib --remap-path-prefix=/a=/c
61 cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
62 $(RUSTC) reproducible-build.rs --crate-type rlib --remap-path-prefix=/b=/c
63 cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
65 different_source_dirs_bin:
66 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
67 $(RUSTC) reproducible-build-aux.rs
69 cp reproducible-build.rs $(TMPDIR)/test
70 $(RUSTC) reproducible-build.rs --crate-type bin --remap-path-prefix=$$PWD=/b
71 cp $(TMPDIR)/reproducible-build $(TMPDIR)/foo
72 (cd $(TMPDIR)/test && $(RUSTC) reproducible-build.rs \
73 --remap-path-prefix=$(TMPDIR)/test=/b \
75 cmp "$(TMPDIR)/reproducible-build" "$(TMPDIR)/foo" || exit 1
77 different_source_dirs_rlib:
78 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
79 $(RUSTC) reproducible-build-aux.rs
81 cp reproducible-build.rs $(TMPDIR)/test
82 $(RUSTC) reproducible-build.rs --crate-type rlib --remap-path-prefix=$$PWD=/b
83 cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
84 (cd $(TMPDIR)/test && $(RUSTC) reproducible-build.rs \
85 --remap-path-prefix=$(TMPDIR)/test=/b \
87 cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
90 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
91 $(RUSTC) reproducible-build-aux.rs
93 cp reproducible-build.rs $(TMPDIR)/test
94 $(RUSTC) reproducible-build.rs --crate-type bin -C debuginfo=2 \
96 cp $(TMPDIR)/reproducible-build $(TMPDIR)/first
97 (cd $(TMPDIR)/test && \
98 $(RUSTC) reproducible-build.rs --crate-type bin -C debuginfo=2 \
99 -Z remap-cwd-prefix=.)
100 cmp "$(TMPDIR)/first" "$(TMPDIR)/reproducible-build" || exit 1
103 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
104 $(RUSTC) reproducible-build-aux.rs
106 cp reproducible-build.rs $(TMPDIR)/test
107 $(RUSTC) reproducible-build.rs --crate-type rlib -C debuginfo=2 \
108 -Z remap-cwd-prefix=.
109 cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfirst.rlib
110 (cd $(TMPDIR)/test && \
111 $(RUSTC) reproducible-build.rs --crate-type rlib -C debuginfo=2 \
112 -Z remap-cwd-prefix=.)
113 cmp "$(TMPDIR)/libfirst.rlib" "$(TMPDIR)/libreproducible_build.rlib" || exit 1
116 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
117 $(RUSTC) reproducible-build-aux.rs
119 cp reproducible-build.rs $(TMPDIR)/test
120 $(RUSTC) reproducible-build.rs --crate-type rlib -C debuginfo=2 \
122 cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfirst.rlib
123 (cd $(TMPDIR)/test && \
124 $(RUSTC) reproducible-build.rs --crate-type rlib -C debuginfo=2 \
125 -Z remap-cwd-prefix=)
126 cmp "$(TMPDIR)/libfirst.rlib" "$(TMPDIR)/libreproducible_build.rlib" || exit 1
129 rm -rf $(TMPDIR) && mkdir $(TMPDIR)
130 $(RUSTC) reproducible-build-aux.rs
131 $(RUSTC) reproducible-build.rs \
132 --extern reproducible_build_aux=$(TMPDIR)/libreproducible_build_aux.rlib \
134 cp $(TMPDIR)/libreproducible_build_aux.rlib $(TMPDIR)/libbar.rlib
135 cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
136 $(RUSTC) reproducible-build.rs \
137 --extern reproducible_build_aux=$(TMPDIR)/libbar.rlib \
139 cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1