Skip to content

Commit 7b3650d

Browse files
committed
mk: Depend on regex_macros for tests appropriately
There is currently not much precedent for target crates requiring syntax extensions to compile their test versions. This dependency is possible, but can't be encoded through the normal means of DEPS_regex because it is a test-only dependency and it must be a *host* dependency (it's a syntax extension). Closes #13844
1 parent 30e3733 commit 7b3650d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mk/tests.mk

+10
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,16 @@ TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
349349
$$(foreach crate,$$(TARGET_CRATES),\
350350
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
351351
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
352+
353+
# The regex crate depends on the regex_macros crate during testing, but it
354+
# notably depend on the *host* regex_macros crate, not the target version.
355+
# Additionally, this is not a dependency in stage1, only in stage2.
356+
ifeq ($(4),regex)
357+
ifneq ($(1),1)
358+
TESTDEP_$(1)_$(2)_$(3)_$(4) += $$(TLIB$(1)_T_$(3)_H_$(3))/stamp.regex_macros
359+
endif
360+
endif
361+
352362
else
353363
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
354364
endif

0 commit comments

Comments
 (0)