Skip to content

Commit b26972e

Browse files
committed
Make bors check that compiletest builds from both stage0 and stage1 rustc.
---- To reproduce issue on commit ba24610 it does not suffice to add just `check-build-compiletest` to `check-secondary`; one must also ensure that `check-build-compiletest` precedes the satisification of the `check` rule. Otherwise hidden dependencies of `compiletest` would end up getting satisfied when make builds `rustc` at each stage in order to eventually run `check-stage2`. So to handle that I moved `check-secondary` before `check` in the `check-all` rule that bors uses, and for good measure, I also put `check-build-compiltest` at the front of the `check-secondary` rule's dependencies. My understanding is that running `check-secondary` should be relatively cheap, and thus such a reordering will not hurt bors. ---- Fix #17883.
1 parent 7dbd434 commit b26972e

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

mk/tests.mk

+26-3
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,29 @@ check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
199199

200200
# Some less critical tests that are not prone to breakage.
201201
# Not run as part of the normal test suite, but tested by bors on checkin.
202-
check-secondary: check-lexer check-pretty
202+
check-secondary: check-build-compiletest check-lexer check-pretty
203203

204204
# check + check-secondary.
205-
check-all: check check-secondary
205+
#
206+
# Issue #17883: build check-secondary first so hidden dependencies in
207+
# e.g. building compiletest are exercised (resolve those by adding
208+
# deps to rules that need them; not by putting `check` first here).
209+
check-all: check-secondary check
206210

207211
# Pretty-printing tests.
208212
check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec
209213

214+
define DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE
215+
check-stage$(1)-build-compiletest: $$(HBIN$(1)_H_$(CFG_BUILD))/compiletest$$(X_$(CFG_BUILD))
216+
endef
217+
218+
$(foreach stage,$(STAGES), \
219+
$(eval $(call DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE,$(stage))))
220+
221+
check-build-compiletest: \
222+
check-stage1-build-compiletest \
223+
check-stage2-build-compiletest
224+
210225
.PHONY: cleantmptestlogs cleantestlibs
211226

212227
cleantmptestlogs:
@@ -720,6 +735,13 @@ PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
720735
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
721736
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
722737
PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
738+
# The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in
739+
# external crates.
740+
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass =
741+
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc
742+
PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
743+
PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
744+
PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
723745
PRETTY_DIRNAME_pretty-rpass = run-pass
724746
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
725747
PRETTY_DIRNAME_pretty-rfail = run-fail
@@ -738,7 +760,8 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
738760

739761
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
740762
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
741-
$$(PRETTY_DEPS_$(4))
763+
$$(PRETTY_DEPS_$(4)) \
764+
$$(PRETTY_DEPS$(1)_H_$(3)_$(4))
742765
@$$(call E, run pretty-rpass [$(2)]: $$<)
743766
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
744767
$$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \

0 commit comments

Comments
 (0)