@@ -27,18 +27,28 @@ WFLAGS_ST2 = -D warnings
2727# $(2) is the target triple
2828# $(3) is the host triple
2929
30+ # Every recipe in TARGET_STAGE_N outputs to $$(TLIB$(1)_T_$(2)_H_$(3),
31+ # a directory that can be cleaned out during the middle of a run of
32+ # the get-snapshot.py script. Therefore, every recipe needs to have
33+ # an order-only dependency either on $(SNAPSHOT_RUSTC_POST_CLEANUP) or
34+ # on $$(TSREQ$(1)_T_$(2)_H_$(3)), to ensure that no products will be
35+ # put into the target area until after the get-snapshot.py script has
36+ # had its chance to clean it out; otherwise the other products will be
37+ # inadvertantly included in the clean out.
3038
3139define TARGET_STAGE_N
3240
3341$$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /libmorestack.a: \
3442 rt/$(2 ) /stage$(1 ) /arch/$$(HOST_$(2 ) ) /libmorestack.a \
35- | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /
43+ | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) / \
44+ $(SNAPSHOT_RUSTC_POST_CLEANUP )
3645 @$$(call E, cp: $$@ )
3746 $$(Q ) cp $$< $$@
3847
3948$$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /$(CFG_RUNTIME_$(2 ) ) : \
4049 rt/$(2 ) /stage$(1 ) /$(CFG_RUNTIME_$(2 ) ) \
41- | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /
50+ | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) / \
51+ $(SNAPSHOT_RUSTC_POST_CLEANUP )
4252 @$$(call E, cp: $$@ )
4353 $$(Q ) cp $$< $$@
4454
@@ -77,7 +87,8 @@ ifneq ($$(findstring $(2),$$(CFG_HOST_TRIPLES)),)
7787
7888$$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /$(CFG_RUSTLLVM_$(3 ) ) : \
7989 rustllvm/$(2 ) /$(CFG_RUSTLLVM_$(3 ) ) \
80- | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /
90+ | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) / \
91+ $(SNAPSHOT_RUSTC_POST_CLEANUP )
8192 @$$(call E, cp: $$@ )
8293 $$(Q ) cp $$< $$@
8394
0 commit comments