Skip to content

Commit d9b4bcc

Browse files
committed
Excuse regex from doing rustdoc tests atop stage1.
Hopefully final step to get `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 688da7c commit d9b4bcc

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
@@ -793,8 +793,27 @@ else
793793
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
794794
endif
795795

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

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

0 commit comments

Comments
 (0)