rollup merge of #20317: brson/rust-installer-v2
This commit is contained in:
commit
cb7599b83e
97
mk/dist.mk
97
mk/dist.mk
|
@ -23,6 +23,8 @@
|
||||||
# * dist-docs - Stage docs for upload
|
# * dist-docs - Stage docs for upload
|
||||||
|
|
||||||
PKG_NAME := $(CFG_PACKAGE_NAME)
|
PKG_NAME := $(CFG_PACKAGE_NAME)
|
||||||
|
DOC_PKG_NAME := rust-docs-$(CFG_PACKAGE_VERS)
|
||||||
|
MINGW_PKG_NAME := rust-mingw-$(CFG_PACKAGE_VERS)
|
||||||
|
|
||||||
# License suitable for displaying in a popup
|
# License suitable for displaying in a popup
|
||||||
LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
|
LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
|
||||||
|
@ -229,10 +231,20 @@ dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
|
||||||
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
|
||||||
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
|
||||||
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
|
||||||
$$(Q)[ ! -d doc ] || cp -r doc $$(PREPARE_DEST_DIR)
|
$$(Q)mkdir -p $$(PREPARE_DEST_DIR)/share/doc/rust
|
||||||
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)/share/doc/rust
|
||||||
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)/share/doc/rust
|
||||||
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)/share/doc/rust
|
||||||
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)/share/doc/rust
|
||||||
|
|
||||||
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
|
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
|
||||||
@$(call E, build: $$@)
|
@$(call E, build: $$@)
|
||||||
|
# Copy essential gcc components into installer
|
||||||
|
ifdef CFG_WINDOWSY_$(1)
|
||||||
|
$$(Q)rm -Rf dist/win-rust-gcc-$(1)
|
||||||
|
$$(Q)$$(CFG_PYTHON) $$(S)src/etc/make-win-dist.py tmp/dist/$$(PKG_NAME)-$(1)-image dist/win-rust-gcc-$(1) $(1)
|
||||||
|
$$(Q)cp -r $$(S)src/etc/third-party tmp/dist/$$(PKG_NAME)-$(1)-image/share/doc/
|
||||||
|
endif
|
||||||
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
||||||
--product-name=Rust \
|
--product-name=Rust \
|
||||||
--verify-bin=rustc \
|
--verify-bin=rustc \
|
||||||
|
@ -242,9 +254,50 @@ dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
|
||||||
--work-dir=tmp/dist \
|
--work-dir=tmp/dist \
|
||||||
--output-dir=dist \
|
--output-dir=dist \
|
||||||
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
|
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
|
||||||
--package-name=$$(PKG_NAME)-$(1)
|
--package-name=$$(PKG_NAME)-$(1) \
|
||||||
|
--component-name=rustc \
|
||||||
|
--legacy-manifest-dirs=rustlib,cargo
|
||||||
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
|
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
|
||||||
|
|
||||||
|
dist-doc-install-dir-$(1): docs compiler-docs
|
||||||
|
$$(Q)mkdir -p tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust
|
||||||
|
$$(Q)cp -r doc tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust/html
|
||||||
|
|
||||||
|
dist/$$(DOC_PKG_NAME)-$(1).tar.gz: dist-doc-install-dir-$(1)
|
||||||
|
@$(call E, build: $$@)
|
||||||
|
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
||||||
|
--product-name=Rust-Documentation \
|
||||||
|
--rel-manifest-dir=rustlib \
|
||||||
|
--success-message=Rust-documentation-is-installed. \
|
||||||
|
--image-dir=tmp/dist/$$(DOC_PKG_NAME)-$(1)-image \
|
||||||
|
--work-dir=tmp/dist \
|
||||||
|
--output-dir=dist \
|
||||||
|
--package-name=$$(DOC_PKG_NAME)-$(1) \
|
||||||
|
--component-name=rust-docs \
|
||||||
|
--legacy-manifest-dirs=rustlib,cargo \
|
||||||
|
--bulk-dirs=share/doc/rust/html
|
||||||
|
$$(Q)rm -R tmp/dist/$$(DOC_PKG_NAME)-$(1)-image
|
||||||
|
|
||||||
|
dist-mingw-install-dir-$(1):
|
||||||
|
$$(Q)mkdir -p tmp/dist/rust-mingw-tmp-$(1)-image
|
||||||
|
$$(Q)rm -Rf tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image
|
||||||
|
$$(Q)$$(CFG_PYTHON) $$(S)src/etc/make-win-dist.py \
|
||||||
|
tmp/dist/rust-mingw-tmp-$(1)-image tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image $(1)
|
||||||
|
|
||||||
|
dist/$$(MINGW_PKG_NAME)-$(1).tar.gz: dist-mingw-install-dir-$(1)
|
||||||
|
@$(call E, build: $$@)
|
||||||
|
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
||||||
|
--product-name=Rust-MinGW \
|
||||||
|
--rel-manifest-dir=rustlib \
|
||||||
|
--success-message=Rust-MinGW-is-installed. \
|
||||||
|
--image-dir=tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image \
|
||||||
|
--work-dir=tmp/dist \
|
||||||
|
--output-dir=dist \
|
||||||
|
--package-name=$$(MINGW_PKG_NAME)-$(1) \
|
||||||
|
--component-name=rust-mingw \
|
||||||
|
--legacy-manifest-dirs=rustlib,cargo
|
||||||
|
$$(Q)rm -R tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(CFG_ENABLE_DIST_HOST_ONLY),)
|
ifneq ($(CFG_ENABLE_DIST_HOST_ONLY),)
|
||||||
|
@ -257,7 +310,16 @@ endif
|
||||||
|
|
||||||
dist-install-dirs: $(foreach host,$(CFG_HOST),dist-install-dir-$(host))
|
dist-install-dirs: $(foreach host,$(CFG_HOST),dist-install-dir-$(host))
|
||||||
|
|
||||||
dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).tar.gz)
|
ifdef CFG_WINDOWSY_$(CFG_BUILD)
|
||||||
|
MAYBE_MINGW_TARBALLS=$(foreach host,$(CFG_HOST),dist/$(MINGW_PKG_NAME)-$(host).tar.gz)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CFG_DISABLE_DOCS),)
|
||||||
|
MAYBE_DOC_TARBALLS=$(foreach host,$(CFG_HOST),dist/$(DOC_PKG_NAME)-$(host).tar.gz)
|
||||||
|
endif
|
||||||
|
|
||||||
|
dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).tar.gz) \
|
||||||
|
$(MAYBE_DOC_TARBALLS) $(MAYBE_MINGW_TARBALLS)
|
||||||
|
|
||||||
# Just try to run the compiler for the build host
|
# Just try to run the compiler for the build host
|
||||||
distcheck-tar-bins: dist-tar-bins
|
distcheck-tar-bins: dist-tar-bins
|
||||||
|
@ -289,27 +351,20 @@ distcheck-docs: dist-docs
|
||||||
# Primary targets (dist, distcheck)
|
# Primary targets (dist, distcheck)
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
ifdef CFG_WINDOWSY_$(CFG_BUILD)
|
MAYBE_DIST_TAR_SRC=dist-tar-src
|
||||||
|
MAYBE_DISTCHECK_TAR_SRC=distcheck-tar-src
|
||||||
dist: dist-win dist-tar-bins
|
|
||||||
|
|
||||||
distcheck: distcheck-win
|
|
||||||
$(Q)rm -Rf tmp/distcheck
|
|
||||||
@echo
|
|
||||||
@echo -----------------------------------------------
|
|
||||||
@echo "Rust ready for distribution (see ./dist)"
|
|
||||||
@echo -----------------------------------------------
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
# FIXME #13224: On OS X don't produce tarballs simply because --exclude-vcs don't work.
|
# FIXME #13224: On OS X don't produce tarballs simply because --exclude-vcs don't work.
|
||||||
# This is a huge hack because I just don't have time to figure out another solution.
|
# This is a huge hack because I just don't have time to figure out another solution.
|
||||||
ifeq ($(CFG_OSTYPE), apple-darwin)
|
ifeq ($(CFG_OSTYPE), apple-darwin)
|
||||||
MAYBE_DIST_TAR_SRC=
|
MAYBE_DIST_TAR_SRC=
|
||||||
MAYBE_DISTCHECK_TAR_SRC=
|
MAYBE_DISTCHECK_TAR_SRC=
|
||||||
else
|
endif
|
||||||
MAYBE_DIST_TAR_SRC=dist-tar-src
|
|
||||||
MAYBE_DISTCHECK_TAR_SRC=distcheck-tar-src
|
# Don't bother with source tarballs on windows just because we historically haven't.
|
||||||
|
ifeq ($(CFG_OSTYPE), pc-windows-gnu)
|
||||||
|
MAYBE_DIST_TAR_SRC=
|
||||||
|
MAYBE_DISTCHECK_TAR_SRC=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CFG_DISABLE_DOCS),)
|
ifneq ($(CFG_DISABLE_DOCS),)
|
||||||
|
@ -320,15 +375,13 @@ MAYBE_DIST_DOCS=dist-docs
|
||||||
MAYBE_DISTCHECK_DOCS=distcheck-docs
|
MAYBE_DISTCHECK_DOCS=distcheck-docs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
dist: $(MAYBE_DIST_TAR_SRC) dist-osx dist-tar-bins $(MAYBE_DIST_DOCS)
|
dist: $(MAYBE_DIST_TAR_SRC) dist-osx dist-win dist-tar-bins $(MAYBE_DIST_DOCS)
|
||||||
|
|
||||||
distcheck: $(MAYBE_DISTCHECK_TAR_SRC) distcheck-osx distcheck-tar-bins $(MAYBE_DISTCHECK_DOCS)
|
distcheck: $(MAYBE_DISTCHECK_TAR_SRC) distcheck-osx distcheck-win distcheck-tar-bins $(MAYBE_DISTCHECK_DOCS)
|
||||||
$(Q)rm -Rf tmp/distcheck
|
$(Q)rm -Rf tmp/distcheck
|
||||||
@echo
|
@echo
|
||||||
@echo -----------------------------------------------
|
@echo -----------------------------------------------
|
||||||
@echo "Rust ready for distribution (see ./dist)"
|
@echo "Rust ready for distribution (see ./dist)"
|
||||||
@echo -----------------------------------------------
|
@echo -----------------------------------------------
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: dist distcheck
|
.PHONY: dist distcheck
|
||||||
|
|
|
@ -20,6 +20,9 @@ ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
|
||||||
$(Q)sudo -u "$$SUDO_USER" $(MAKE) prepare_install
|
$(Q)sudo -u "$$SUDO_USER" $(MAKE) prepare_install
|
||||||
else
|
else
|
||||||
$(Q)$(MAKE) prepare_install
|
$(Q)$(MAKE) prepare_install
|
||||||
|
endif
|
||||||
|
ifeq ($(CFG_DISABLE_DOCS),)
|
||||||
|
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
|
||||||
endif
|
endif
|
||||||
$(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)"
|
$(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)"
|
||||||
# Remove tmp files because it's a decent amount of disk space
|
# Remove tmp files because it's a decent amount of disk space
|
||||||
|
@ -33,6 +36,9 @@ ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
|
||||||
$(Q)sudo -u "$$SUDO_USER" $(MAKE) prepare_uninstall
|
$(Q)sudo -u "$$SUDO_USER" $(MAKE) prepare_uninstall
|
||||||
else
|
else
|
||||||
$(Q)$(MAKE) prepare_uninstall
|
$(Q)$(MAKE) prepare_uninstall
|
||||||
|
endif
|
||||||
|
ifeq ($(CFG_DISABLE_DOCS),)
|
||||||
|
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
|
||||||
endif
|
endif
|
||||||
$(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)"
|
$(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)"
|
||||||
# Remove tmp files because it's a decent amount of disk space
|
# Remove tmp files because it's a decent amount of disk space
|
||||||
|
|
|
@ -289,6 +289,7 @@ tidy:
|
||||||
| grep '^$(S)src/doc' -v \
|
| grep '^$(S)src/doc' -v \
|
||||||
| grep '^$(S)src/compiler-rt' -v \
|
| grep '^$(S)src/compiler-rt' -v \
|
||||||
| grep '^$(S)src/libbacktrace' -v \
|
| grep '^$(S)src/libbacktrace' -v \
|
||||||
|
| grep '^$(S)src/rust-installer' -v \
|
||||||
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
|
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -114,11 +114,5 @@ def make_win_dist(rust_root, gcc_root, target_triple):
|
||||||
for src in target_libs:
|
for src in target_libs:
|
||||||
shutil.copy(src, target_lib_dir)
|
shutil.copy(src, target_lib_dir)
|
||||||
|
|
||||||
# Copy license files
|
|
||||||
lic_dir = os.path.join(rust_root, "bin", "third-party")
|
|
||||||
if os.path.exists(lic_dir):
|
|
||||||
shutil.rmtree(lic_dir) # copytree() won't overwrite existing files
|
|
||||||
shutil.copytree(os.path.join(os.path.dirname(__file__), "third-party"), lic_dir)
|
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
make_win_dist(sys.argv[1], sys.argv[2], sys.argv[3])
|
make_win_dist(sys.argv[1], sys.argv[2], sys.argv[3])
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit aed73472416064642911af790b25d57c9390b6c7
|
Subproject commit 3a37981744a5af2433fed551f742465c78c9af7f
|
Loading…
Reference in New Issue