Skip to content

Commit b3a732a

Browse files
committed
auto merge of #15928 : brson/rust/dist, r=alexcrichton,alexcrichton
The first commit reverts a similar fix that only solves the `make install` case. This adds the `--enable-dist-host-only` flag to configure to preserve the old behavior, which the nightly bots rely on. The bots will need to be updated soon after this lands (or they will ~double in size). Closes #15711
2 parents c080d26 + e34e86d commit b3a732a

File tree

3 files changed

+29
-26
lines changed

3 files changed

+29
-26
lines changed

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ opt rpath 0 "build rpaths into rustc itself"
422422
opt nightly 0 "build nightly packages"
423423
opt verify-install 1 "verify installed binaries work"
424424
opt jemalloc 1 "build liballoc with jemalloc"
425+
# This is used by the automation to produce single-target nightlies
426+
opt dist-host-only 0 "only install bins for the host architecture"
425427
valopt prefix "/usr/local" "set installation prefix"
426428
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
427429
valopt llvm-root "" "set LLVM root"

mk/dist.mk

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ define DEF_OSX_PKG
156156
$$(eval $$(call DEF_PREPARE,osx-$(1)))
157157

158158
dist-prepare-osx-$(1): PREPARE_HOST=$(1)
159-
dist-prepare-osx-$(1): PREPARE_TARGETS=$(1)
159+
dist-prepare-osx-$(1): PREPARE_TARGETS=$(2)
160160
dist-prepare-osx-$(1): PREPARE_DEST_DIR=tmp/dist/pkgroot-$(1)
161161
dist-prepare-osx-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
162162
dist-prepare-osx-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
@@ -187,7 +187,11 @@ tmp/dist/pkgres-$(1)/%: $(S)src/etc/pkg/%
187187

188188
endef
189189

190-
$(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host))))
190+
ifneq ($(CFG_ENABLE_DIST_HOST_ONLY),)
191+
$(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host),$(host))))
192+
else
193+
$(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host),$(TARGET))))
194+
endif
191195

192196
dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).pkg)
193197

@@ -205,17 +209,19 @@ distcheck-osx: dist-osx
205209
# Unix binary installer tarballs
206210
######################################################################
207211

208-
define DEF_PREPARE_DIST_DIR
209-
210-
dist-install-dir-$(1)$(3): PREPARE_HOST=$(1)
211-
dist-install-dir-$(1)$(3): PREPARE_TARGETS=$(2)
212-
dist-install-dir-$(1)$(3): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
213-
dist-install-dir-$(1)$(3): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
214-
dist-install-dir-$(1)$(3): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
215-
dist-install-dir-$(1)$(3): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
216-
dist-install-dir-$(1)$(3): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
217-
dist-install-dir-$(1)$(3): PREPARE_CLEAN=true
218-
dist-install-dir-$(1)$(3): prepare-base-dir-$(1) docs compiler-docs
212+
define DEF_INSTALLER
213+
214+
$$(eval $$(call DEF_PREPARE,dir-$(1)))
215+
216+
dist-install-dir-$(1): PREPARE_HOST=$(1)
217+
dist-install-dir-$(1): PREPARE_TARGETS=$(2)
218+
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
219+
dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
220+
dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
221+
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
222+
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
223+
dist-install-dir-$(1): PREPARE_CLEAN=true
224+
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
219225
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
220226
> tmp/dist/manifest-$(1).in
221227
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
@@ -227,24 +233,19 @@ dist-install-dir-$(1)$(3): prepare-base-dir-$(1) docs compiler-docs
227233
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
228234
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
229235

230-
endef
231-
232-
define DEF_INSTALLER
233-
234-
$$(eval $$(call DEF_PREPARE,dir-$(1)))
235-
236-
$$(eval $$(call DEF_PREPARE_DIST_DIR,$(1),$(1),))
237-
238-
$$(eval $$(call DEF_PREPARE_DIST_DIR,$(1),$(CFG_TARGET),-with-target-libs))
239-
240236
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
241237
@$(call E, build: $$@)
242238
$$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1)
243239

244240
endef
245241

242+
ifneq ($(CFG_ENABLE_DIST_HOST_ONLY),)
243+
$(foreach host,$(CFG_HOST),\
244+
$(eval $(call DEF_INSTALLER,$(host),$(host))))
245+
else
246246
$(foreach host,$(CFG_HOST),\
247-
$(eval $(call DEF_INSTALLER,$(host))))
247+
$(eval $(call DEF_INSTALLER,$(host),$(CFG_TARGET))))
248+
endif
248249

249250
dist-install-dirs: $(foreach host,$(CFG_HOST),dist-install-dir-$(host))
250251

mk/install.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ else
1414
MAYBE_DISABLE_VERIFY=
1515
endif
1616

17-
install: dist-install-dir-$(CFG_BUILD)-with-target-libs | tmp/empty_dir
17+
install: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
1818
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
1919
# Remove tmp files while we can because they may have been created under sudo
2020
$(Q)rm -R tmp/dist
2121

22-
uninstall: dist-install-dir-$(CFG_BUILD)-with-target-libs | tmp/empty_dir
22+
uninstall: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
2323
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
2424
# Remove tmp files while we can because they may have been created under sudo
2525
$(Q)rm -R tmp/dist

0 commit comments

Comments
 (0)