Skip to content

Commit 7746a33

Browse files
committed
Auto merge of #33825 - alexcrichton:fix-beta, r=aturon
mk: Fix bootstrapping cross-hosts on beta The beta builds are currently failing, unfortunately, due to what is presumably some odd behavior with our makefiles. The wrong bootstrap key is being used to generate the stage1 cross-compiled libraries, which fails the build. Interestingly enough if the targets are directly specified as part of the build then it works just fine! Just a bare `make` fails... Instead of trying to understand what's happening in the makefiles instead just tweak how we configure the bootstrap key in a way that's more likely to work.
2 parents 90d9a51 + a2434eb commit 7746a33

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

mk/target.mk

+20-9
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ $(foreach host,$(CFG_HOST), \
4242
$(foreach crate,$(CRATES), \
4343
$(eval $(call RUST_CRATE_FULLDEPS,$(stage),$(target),$(host),$(crate)))))))
4444

45+
# $(1) stage
46+
# $(2) target
47+
# $(3) host
48+
define DEFINE_BOOTSTRAP_KEY
49+
BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3) := $$(CFG_BOOTSTRAP_KEY)
50+
ifeq ($(1),0)
51+
ifeq ($(3),$$(CFG_BUILD))
52+
BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3) := $$(CFG_BOOTSTRAP_KEY_STAGE0)
53+
endif
54+
endif
55+
endef
56+
57+
$(foreach host,$(CFG_TARGET), \
58+
$(foreach target,$(CFG_TARGET), \
59+
$(foreach stage,$(STAGES), \
60+
$(eval $(call DEFINE_BOOTSTRAP_KEY,$(stage),$(target),$(host))))))
61+
4562
# RUST_TARGET_STAGE_N template: This defines how target artifacts are built
4663
# for all stage/target architecture combinations. This is one giant rule which
4764
# works as follows:
@@ -65,12 +82,9 @@ $(foreach host,$(CFG_HOST), \
6582
# $(4) is the crate name
6683
define RUST_TARGET_STAGE_N
6784

68-
ifeq ($(1),0)
69-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
70-
export RUSTC_BOOTSTRAP_KEY := $$(CFG_BOOTSTRAP_KEY_STAGE0)
71-
endif
72-
7385
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2)
86+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
87+
export RUSTC_BOOTSTRAP_KEY := $$(BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3))
7488
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
7589
$$(CRATEFILE_$(4)) \
7690
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
@@ -118,11 +132,8 @@ endef
118132
# $(4) - name of the tool being built
119133
define TARGET_TOOL
120134

121-
ifeq ($(1),0)
122135
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
123-
export RUSTC_BOOTSTRAP_KEY := $$(CFG_BOOTSTRAP_KEY_STAGE0)
124-
endif
125-
136+
export RUSTC_BOOTSTRAP_KEY := $$(BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3))
126137
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
127138
$$(TOOL_SOURCE_$(4)) \
128139
$$(TOOL_INPUTS_$(4)) \

0 commit comments

Comments
 (0)