Skip to content

Commit 5fa96e9

Browse files
committed
Auto merge of #29237 - alexcrichton:packaging, r=brson
It looks like the target libs aren't actually the same across hosts so instead of always packaging the target libs from CFG_BUILD take the target libs from the host if we have them and then only failing that do we take them from CFG_BUILD. Closes #29228
2 parents e518c05 + 0528eff commit 5fa96e9

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

mk/dist.mk

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,25 @@ endef
256256

257257
$(foreach host,$(CFG_HOST),\
258258
$(eval $(call DEF_INSTALLER,$(host))))
259-
$(foreach target,$(CFG_TARGET),\
259+
260+
# When generating packages for the standard library, we've actually got a lot of
261+
# artifacts to choose from. Each of the CFG_HOST compilers will have a copy of
262+
# the standard library for each CFG_TARGET, but we only want to generate one
263+
# standard library package. As a result, for each entry in CFG_TARGET we need to
264+
# pick a CFG_HOST to get the standard library from.
265+
#
266+
# In theory it doesn't actually matter what host we choose as it should be the
267+
# case that all hosts produce the same set of libraries for a target (regardless
268+
# of the host itself). Currently there is a bug in the compiler, however, which
269+
# means this is not the case (see #29228 and #29235). To solve the first of
270+
# those bugs, we prefer to select a standard library from the host it was
271+
# generated from, allowing plugins to work in more situations.
272+
#
273+
# For all CFG_TARGET entries in CFG_HOST, however, we just pick CFG_BUILD as the
274+
# host we slurp up a standard library from.
275+
$(foreach host,$(CFG_HOST),\
276+
$(eval $(call DEF_INSTALLER_TARGETS,$(host),$(host))))
277+
$(foreach target,$(filter-out $(CFG_HOST),$(CFG_TARGET)),\
260278
$(eval $(call DEF_INSTALLER_TARGETS,$(CFG_BUILD),$(target))))
261279

262280
ifdef CFG_WINDOWSY_$(CFG_BUILD)

0 commit comments

Comments
 (0)