Skip to content

Commit 7b620df

Browse files
committed
Excuse regex from doing rustdoc tests atop stage1.
Hopefully final baby-step to getting `make check-stage1` working again. The use of a special-case check for regex here is ugly but is analogous other similar checks for regex such as the one that landed in PR rust-lang#13844. The way this is written, the user will get a reminder that doc-crate-regex is being skipped whenever their rules attempt to do the crate documentation tests. This is deliberate: I want people running `make check-stage1` to be reminded about which cases are being skipped. (But if such echo noise is considered offensive, it can obviously be removed.)
1 parent 7da9e87 commit 7b620df

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

mk/tests.mk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,27 @@ else
790790
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
791791
endif
792792

793+
# (Issue #13732, #14000) The doc for the regex crate includes uses of
794+
# the `regex!` macro from the regex_macros crate. There is normally a
795+
# dependence injected that makes the target's regex depend upon the
796+
# host's regex_macros (see #13845), but that dependency injection is
797+
# currently skipped for stage1 as a special case.
798+
#
799+
# Therefore, as a further special case, this conditional skips
800+
# attempting to run the doc tests for the regex crate atop stage1,
801+
# (since there is no regex_macros crate for the stage1 rustc to load).
802+
#
803+
# (Another approach for solving this would be to inject the desired
804+
# dependence for stage1 as well, by setting things up to generate a
805+
# regex_macros crate that was compatible with the stage1 rustc and
806+
# thus re-enable our ability to run this test.)
807+
ifeq (stage$(1)-crate-$(4),stage1-crate-regex)
808+
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec:
809+
@$$(call E, skipping doc-crate-$(4) as it uses macros and cannot run at stage$(1))
810+
else
793811
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
794812
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
813+
endif
795814

796815
ifeq ($(2),$$(CFG_BUILD))
797816
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))

0 commit comments

Comments
 (0)