Skip to content

Commit 55aa1e6

Browse files
committed
Use rust-installer for installation
This is just a refactoring of the current installer so that Rust and Cargo use the same codebase. cc #16456
1 parent 65bca02 commit 55aa1e6

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
[submodule "src/jemalloc"]
1212
path = src/jemalloc
1313
url = https://github.com/rust-lang/jemalloc.git
14+
[submodule "src/rust-installer"]
15+
path = src/rust-installer
16+
url = https://github.com/rust-lang/rust-installer

mk/dist.mk

+14-7
Original file line numberDiff line numberDiff line change
@@ -209,33 +209,40 @@ distcheck-osx: dist-osx
209209
# Unix binary installer tarballs
210210
######################################################################
211211

212+
NON_INSTALLED_PREFIXES=COPYRIGHT,LICENSE-APACHE,LICENSE-MIT,README.md,doc
213+
212214
define DEF_INSTALLER
213215

214216
$$(eval $$(call DEF_PREPARE,dir-$(1)))
215217

216218
dist-install-dir-$(1): PREPARE_HOST=$(1)
217219
dist-install-dir-$(1): PREPARE_TARGETS=$(2)
218-
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
220+
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)-image
219221
dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
220222
dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
221223
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
222224
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
223225
dist-install-dir-$(1): PREPARE_CLEAN=true
224226
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
225-
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
226-
> tmp/dist/manifest-$(1).in
227-
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
228-
# Add remaining non-installed files
229227
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
230228
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
231229
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
232230
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
233231
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
234-
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
235232

236233
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
237234
@$(call E, build: $$@)
238-
$$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1)
235+
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
236+
--product-name=Rust \
237+
--verify-bin=rustc \
238+
--rel-manifest-dir=rustlib \
239+
--success-message=Rust-is-ready-to-roll. \
240+
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
241+
--work-dir=tmp/dist \
242+
--output-dir=dist \
243+
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
244+
--package-name=$$(PKG_NAME)-$(1)
245+
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
239246

240247
endef
241248

mk/install.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif
2525
# Remove tmp files because it's a decent amount of disk space
2626
$(Q)rm -R tmp/dist
2727

28-
prepare_install: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
28+
prepare_install: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
2929

3030
uninstall:
3131
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
@@ -38,7 +38,7 @@ endif
3838
# Remove tmp files because it's a decent amount of disk space
3939
$(Q)rm -R tmp/dist
4040

41-
prepare_uninstall: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
41+
prepare_uninstall: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
4242

4343
.PHONY: install prepare_install uninstall prepare_uninstall
4444

src/rust-installer

Submodule rust-installer added at 26ee157

0 commit comments

Comments
 (0)