From e30ab71e086746c6db7d49f5b0be5fc8cceda514 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 20 Mar 2014 16:44:49 -0700 Subject: [PATCH 01/23] mk: Stop building OS X .pkg as part of 'make dist' This doesn't work quite right yet (we need to build packages for all hosts) and I'm not ready to turn on new dist artifacts yet, but I want to start doing dry runs for 0.10, so I'm turning this off for now. --- mk/dist.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/dist.mk b/mk/dist.mk index 7ac3582f821cf..5f527a695f977 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -106,7 +106,7 @@ distcheck: dist else -dist: $(PKG_TAR) $(PKG_OSX) +dist: $(PKG_TAR) distcheck: $(PKG_TAR) $(Q)rm -Rf dist From df141e624da6d4c2976a4cecd9cb6779e23fedda Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 10:48:13 -0700 Subject: [PATCH 02/23] mk: Reorder definitions in dist.mk Just to be more logical, put big headers between different installers --- mk/dist.mk | 129 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 77 insertions(+), 52 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 5f527a695f977..82502c5c795f9 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -48,31 +48,10 @@ UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES)) LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT cat $^ > $@ -ifdef CFG_ISCC -%.iss: $(S)src/etc/pkg/%.iss - cp $< $@ - -%.ico: $(S)src/etc/pkg/%.ico - cp $< $@ - -$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \ - $(PKG_FILES) $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ - dist-prepare-win - $(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin - @$(call E, ISCC: $@) - $(Q)"$(CFG_ISCC)" $< -dist-prepare-win: PREPARE_HOST=$(CFG_BUILD) -dist-prepare-win: PREPARE_TARGETS=$(CFG_BUILD) -dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win -dist-prepare-win: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) -dist-prepare-win: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) -dist-prepare-win: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) -dist-prepare-win: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) -dist-prepare-win: PREPARE_CLEAN=true -dist-prepare-win: prepare-base - -endif +###################################################################### +# Source tarball +###################################################################### $(PKG_TAR): $(PKG_FILES) @$(call E, making dist dir) @@ -92,42 +71,42 @@ $(PKG_TAR): $(PKG_FILES) $(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_DIR) $(Q)rm -Rf tmp/dist/$(PKG_DIR) -.PHONY: dist distcheck -ifdef CFG_WINDOWSY_$(CFG_BUILD) - -dist: $(PKG_EXE) +###################################################################### +# Windows .exe installer +###################################################################### -distcheck: dist - @echo - @echo ----------------------------------------------- - @echo $(PKG_EXE) ready for distribution - @echo ----------------------------------------------- +ifdef CFG_ISCC +%.iss: $(S)src/etc/pkg/%.iss + cp $< $@ -else +%.ico: $(S)src/etc/pkg/%.ico + cp $< $@ -dist: $(PKG_TAR) +$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \ + $(PKG_FILES) $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ + dist-prepare-win + $(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin + @$(call E, ISCC: $@) + $(Q)"$(CFG_ISCC)" $< -distcheck: $(PKG_TAR) - $(Q)rm -Rf dist - $(Q)mkdir -p dist - @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_DIR)) - $(Q)cd dist && tar -xzf ../$(PKG_TAR) - @$(call E, configuring in dist/$(PKG_DIR)-build) - $(Q)mkdir -p dist/$(PKG_DIR)-build - $(Q)cd dist/$(PKG_DIR)-build && ../$(PKG_DIR)/configure - @$(call E, making 'check' in dist/$(PKG_DIR)-build) - $(Q)+make -C dist/$(PKG_DIR)-build check - @$(call E, making 'clean' in dist/$(PKG_DIR)-build) - $(Q)+make -C dist/$(PKG_DIR)-build clean - $(Q)rm -Rf dist - @echo - @echo ----------------------------------------------- - @echo $(PKG_TAR) ready for distribution - @echo ----------------------------------------------- +dist-prepare-win: PREPARE_HOST=$(CFG_BUILD) +dist-prepare-win: PREPARE_TARGETS=$(CFG_BUILD) +dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win +dist-prepare-win: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) +dist-prepare-win: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) +dist-prepare-win: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) +dist-prepare-win: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) +dist-prepare-win: PREPARE_CLEAN=true +dist-prepare-win: prepare-base endif + +###################################################################### +# OS X .pkg installer +###################################################################### + ifeq ($(CFG_OSTYPE), apple-darwin) dist-prepare-osx: PREPARE_HOST=$(CFG_BUILD) @@ -155,6 +134,11 @@ distcheck-osx: $(PKG_OSX) endif + +###################################################################### +# Unix binary installer tarballs +###################################################################### + dist-install-dir: $(foreach host,$(CFG_HOST),dist-install-dir-$(host)) dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_DIR)-$(host).tar.gz) @@ -185,3 +169,44 @@ endef $(foreach host,$(CFG_HOST),\ $(eval $(call DEF_INSTALLER,$(host)))) + + +###################################################################### +# Primary targets (dist, distcheck) +###################################################################### + +ifdef CFG_WINDOWSY_$(CFG_BUILD) + +dist: $(PKG_EXE) + +distcheck: dist + @echo + @echo ----------------------------------------------- + @echo $(PKG_EXE) ready for distribution + @echo ----------------------------------------------- + +else + +dist: $(PKG_TAR) + +distcheck: $(PKG_TAR) + $(Q)rm -Rf dist + $(Q)mkdir -p dist + @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_DIR)) + $(Q)cd dist && tar -xzf ../$(PKG_TAR) + @$(call E, configuring in dist/$(PKG_DIR)-build) + $(Q)mkdir -p dist/$(PKG_DIR)-build + $(Q)cd dist/$(PKG_DIR)-build && ../$(PKG_DIR)/configure + @$(call E, making 'check' in dist/$(PKG_DIR)-build) + $(Q)+make -C dist/$(PKG_DIR)-build check + @$(call E, making 'clean' in dist/$(PKG_DIR)-build) + $(Q)+make -C dist/$(PKG_DIR)-build clean + $(Q)rm -Rf dist + @echo + @echo ----------------------------------------------- + @echo $(PKG_TAR) ready for distribution + @echo ----------------------------------------------- + +endif + +.PHONY: dist distcheck From 4176cf47dfe8f43dd8cfe402146291757c034ea3 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 11:40:31 -0700 Subject: [PATCH 03/23] mk: Cleanup --- mk/dist.mk | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 82502c5c795f9..a7c8cd5b33fd1 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -1,17 +1,30 @@ +# Copyright 2014 The Rust Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution and at +# http://rust-lang.org/COPYRIGHT. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + ###################################################################### # Distribution ###################################################################### +# Primary targets: +# +# * dist - make all distribution artifacts +# * distcheck - sanity check dist artifacts +# * dist-tar-src - source tarballs +# * dist-win - Windows exe installers +# * dist-osx - OS X .pkg installers +# * dist-tar-bins - Ad-hoc Unix binary installers + PKG_NAME := rust PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE) PKG_TAR = dist/$(PKG_DIR).tar.gz -ifdef CFG_ISCC -PKG_ISS = $(wildcard $(S)src/etc/pkg/*.iss) -PKG_ICO = $(S)src/etc/pkg/rust-logo.ico -PKG_EXE = dist/$(PKG_DIR)-install.exe -endif - ifeq ($(CFG_OSTYPE), apple-darwin) PKG_OSX = dist/$(PKG_DIR).pkg endif @@ -71,12 +84,16 @@ $(PKG_TAR): $(PKG_FILES) $(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_DIR) $(Q)rm -Rf tmp/dist/$(PKG_DIR) +dist-tar-src: $(PKG_TAR) ###################################################################### # Windows .exe installer ###################################################################### ifdef CFG_ISCC + +PKG_EXE = dist/$(PKG_DIR)-install.exe + %.iss: $(S)src/etc/pkg/%.iss cp $< $@ @@ -102,6 +119,8 @@ dist-prepare-win: prepare-base endif +dist-win: $(PKG_EXE) + ###################################################################### # OS X .pkg installer @@ -126,12 +145,6 @@ $(PKG_OSX): Distribution.xml LICENSE.txt dist-prepare-osx dist-osx: $(PKG_OSX) -distcheck-osx: $(PKG_OSX) - @echo - @echo ----------------------------------------------- - @echo $(PKG_OSX) ready for distribution - @echo ----------------------------------------------- - endif @@ -139,7 +152,7 @@ endif # Unix binary installer tarballs ###################################################################### -dist-install-dir: $(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_DIR)-$(host).tar.gz) @@ -177,17 +190,17 @@ $(foreach host,$(CFG_HOST),\ ifdef CFG_WINDOWSY_$(CFG_BUILD) -dist: $(PKG_EXE) +dist: dist-win distcheck: dist @echo @echo ----------------------------------------------- - @echo $(PKG_EXE) ready for distribution + @echo Rust ready for distribution (see ./dist) @echo ----------------------------------------------- else -dist: $(PKG_TAR) +dist: dist-tar-src distcheck: $(PKG_TAR) $(Q)rm -Rf dist @@ -204,7 +217,7 @@ distcheck: $(PKG_TAR) $(Q)rm -Rf dist @echo @echo ----------------------------------------------- - @echo $(PKG_TAR) ready for distribution + @echo Rust ready for distribution (see ./dist) @echo ----------------------------------------------- endif From 669a0554da0c8c9837fba613369d32cc3b945ab0 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 15:31:52 -0700 Subject: [PATCH 04/23] mk: Make OS X .pkg for all arches --- mk/dist.mk | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index a7c8cd5b33fd1..37bd0ea292f68 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -25,10 +25,6 @@ PKG_NAME := rust PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE) PKG_TAR = dist/$(PKG_DIR).tar.gz -ifeq ($(CFG_OSTYPE), apple-darwin) -PKG_OSX = dist/$(PKG_DIR).pkg -endif - PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt PKG_FILES := \ @@ -128,22 +124,27 @@ dist-win: $(PKG_EXE) ifeq ($(CFG_OSTYPE), apple-darwin) -dist-prepare-osx: PREPARE_HOST=$(CFG_BUILD) -dist-prepare-osx: PREPARE_TARGETS=$(CFG_BUILD) -dist-prepare-osx: PREPARE_DEST_DIR=tmp/dist/pkgroot -dist-prepare-osx: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) -dist-prepare-osx: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) -dist-prepare-osx: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) -dist-prepare-osx: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) -dist-prepare-osx: prepare-base - -$(PKG_OSX): Distribution.xml LICENSE.txt dist-prepare-osx - @$(call E, making OS X pkg) - $(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot rust.pkg - $(Q)productbuild --distribution Distribution.xml --resources . $(PKG_OSX) +define DEF_OSX_PKG +dist-prepare-osx-$(1): PREPARE_HOST=$(1) +dist-prepare-osx-$(1): PREPARE_TARGETS=$(1) +dist-prepare-osx-$(1): PREPARE_DEST_DIR=tmp/dist/pkgroot-$(1) +dist-prepare-osx-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) +dist-prepare-osx-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) +dist-prepare-osx-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) +dist-prepare-osx-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) +dist-prepare-osx-$(1): prepare-base + +dist/$(PKG_DIR)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1) + @$$(call E, making OS X pkg) + $(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot-$(1) rust.pkg + $(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml --resources . dist/$(PKG_DIR)-$(1).pkg $(Q)rm -rf tmp rust.pkg -dist-osx: $(PKG_OSX) +endef + +$(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host)))) + +dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_DIR)-$(host).pkg) endif From 44842db533134fcaca1f95fc8de4f6659a28778b Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 12:50:29 -0700 Subject: [PATCH 05/23] mk: Cleanup version handling and add support for nightly dists --- mk/dist.mk | 48 ++++++++++++++++++++++---------------------- mk/main.mk | 25 +++++++++++++++++++---- src/etc/pkg/rust.iss | 3 ++- 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 37bd0ea292f68..60662c2a3d5b3 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -21,9 +21,7 @@ # * dist-osx - OS X .pkg installers # * dist-tar-bins - Ad-hoc Unix binary installers -PKG_NAME := rust -PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE) -PKG_TAR = dist/$(PKG_DIR).tar.gz +PKG_NAME = $(CFG_PACKAGE_NAME) PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt @@ -62,10 +60,12 @@ LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT # Source tarball ###################################################################### +PKG_TAR = dist/$(PKG_NAME).tar.gz + $(PKG_TAR): $(PKG_FILES) @$(call E, making dist dir) - $(Q)rm -Rf tmp/dist/$(PKG_DIR) - $(Q)mkdir -p tmp/dist/$(PKG_DIR) + $(Q)rm -Rf tmp/dist/$(PKG_NAME) + $(Q)mkdir -p tmp/dist/$(PKG_NAME) $(Q)tar \ -C $(S) \ --exclude-vcs \ @@ -76,9 +76,9 @@ $(PKG_TAR): $(PKG_FILES) --exclude=*/llvm/test/*/*/*.ll \ --exclude=*/llvm/test/*/*/*.td \ --exclude=*/llvm/test/*/*/*.s \ - -c $(UNROOTED_PKG_FILES) | tar -x -C tmp/dist/$(PKG_DIR) - $(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_DIR) - $(Q)rm -Rf tmp/dist/$(PKG_DIR) + -c $(UNROOTED_PKG_FILES) | tar -x -C tmp/dist/$(PKG_NAME) + $(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_NAME) + $(Q)rm -Rf tmp/dist/$(PKG_NAME) dist-tar-src: $(PKG_TAR) @@ -88,7 +88,7 @@ dist-tar-src: $(PKG_TAR) ifdef CFG_ISCC -PKG_EXE = dist/$(PKG_DIR)-install.exe +PKG_EXE = dist/$(PKG_NAME)-install.exe %.iss: $(S)src/etc/pkg/%.iss cp $< $@ @@ -134,17 +134,17 @@ dist-prepare-osx-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) dist-prepare-osx-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) dist-prepare-osx-$(1): prepare-base -dist/$(PKG_DIR)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1) +dist/$(PKG_NAME)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1) @$$(call E, making OS X pkg) $(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot-$(1) rust.pkg - $(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml --resources . dist/$(PKG_DIR)-$(1).pkg + $(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml --resources . dist/$(PKG_NAME)-$(1).pkg $(Q)rm -rf tmp rust.pkg endef $(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host)))) -dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_DIR)-$(host).pkg) +dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).pkg) endif @@ -155,12 +155,12 @@ endif dist-install-dirs: $(foreach host,$(CFG_HOST),dist-install-dir-$(host)) -dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_DIR)-$(host).tar.gz) +dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).tar.gz) define DEF_INSTALLER dist-install-dir-$(1): PREPARE_HOST=$(1) dist-install-dir-$(1): PREPARE_TARGETS=$(1) -dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_DIR)-$(1) +dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1) dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) @@ -175,9 +175,9 @@ dist-install-dir-$(1): prepare-base $$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR) -dist/$$(PKG_DIR)-$(1).tar.gz: dist-install-dir-$(1) +dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1) @$(call E, build: $$@) - $$(Q)tar -czf dist/$$(PKG_DIR)-$(1).tar.gz -C tmp/dist $$(PKG_DIR)-$(1) + $$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1) endef @@ -206,15 +206,15 @@ dist: dist-tar-src distcheck: $(PKG_TAR) $(Q)rm -Rf dist $(Q)mkdir -p dist - @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_DIR)) + @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_NAME)) $(Q)cd dist && tar -xzf ../$(PKG_TAR) - @$(call E, configuring in dist/$(PKG_DIR)-build) - $(Q)mkdir -p dist/$(PKG_DIR)-build - $(Q)cd dist/$(PKG_DIR)-build && ../$(PKG_DIR)/configure - @$(call E, making 'check' in dist/$(PKG_DIR)-build) - $(Q)+make -C dist/$(PKG_DIR)-build check - @$(call E, making 'clean' in dist/$(PKG_DIR)-build) - $(Q)+make -C dist/$(PKG_DIR)-build clean + @$(call E, configuring in dist/$(PKG_NAME)-build) + $(Q)mkdir -p dist/$(PKG_NAME)-build + $(Q)cd dist/$(PKG_NAME)-build && ../$(PKG_NAME)/configure + @$(call E, making 'check' in dist/$(PKG_NAME)-build) + $(Q)+make -C dist/$(PKG_NAME)-build check + @$(call E, making 'clean' in dist/$(PKG_NAME)-build) + $(Q)+make -C dist/$(PKG_NAME)-build clean $(Q)rm -Rf dist @echo @echo ----------------------------------------------- diff --git a/mk/main.mk b/mk/main.mk index 5f5f596b1b797..1cae05cc74a54 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -13,9 +13,25 @@ ###################################################################### # The version number -CFG_RELEASE = 0.10-pre +CFG_RELEASE_NUM=0.10 +CFG_RELEASE_LABEL=-pre -# The version string plus commit information +ifndef CFG_NIGHTLY +# This is the normal version string +CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL) +CFG_PACKAGE_VERS=$(CFG_RELEASE) +else +# Modify the version label for nightly builds +CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL)-nightly +# When building nightly distributables just reuse the same "rust-nightly" name +# so when we upload we'll always override the previous nighly. This doesn't actually +# impact the version reported by rustc - it's just for file naming. +CFG_PACKAGE_VERS=nightly +endif +# The name of the package to use for creating tarballs, installers etc. +CFG_PACKAGE_NAME=rust-$(CFG_PACKAGE_VERS) + +# The version string plus commit information - this is what rustc reports CFG_VERSION = $(CFG_RELEASE) CFG_GIT_DIR := $(CFG_SRC_DIR).git # since $(CFG_GIT) may contain spaces (especially on Windows), @@ -32,9 +48,9 @@ ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),) endif endif -# windows exe's need numeric versions - don't use anything but +# Windows exe's need numeric versions - don't use anything but # numbers and dots here -CFG_VERSION_WIN = $(subst -pre,,$(CFG_RELEASE)) +CFG_VERSION_WIN = $(CFG_RELEASE_NUM) ###################################################################### @@ -259,6 +275,7 @@ export CFG_BUILD_DIR export CFG_VERSION export CFG_VERSION_WIN export CFG_RELEASE +export CFG_PACKAGE_NAME export CFG_BUILD export CFG_LLVM_ROOT export CFG_ENABLE_MINGW_CROSS diff --git a/src/etc/pkg/rust.iss b/src/etc/pkg/rust.iss index 559ed0e860f42..4be90666e3daa 100644 --- a/src/etc/pkg/rust.iss +++ b/src/etc/pkg/rust.iss @@ -1,5 +1,6 @@ #define CFG_VERSION_WIN GetEnv("CFG_VERSION_WIN") #define CFG_RELEASE GetEnv("CFG_RELEASE") +#define CFG_PACKAGE_NAME GetEnv("CFG_PACKAGE_NAME") [Setup] @@ -19,7 +20,7 @@ DisableStartupPrompt=true OutputDir=.\ SourceDir=.\ -OutputBaseFilename=rust-{#CFG_RELEASE}-install +OutputBaseFilename={#CFG_PACKAGE_NAME}-install DefaultDirName={pf32}\Rust Compression=lzma2/ultra From 92d8181bde75af0349eb7ea5a71a37ca24c0ce53 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 13:01:21 -0700 Subject: [PATCH 06/23] mk: Put win installer in correct dir --- src/etc/pkg/rust.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etc/pkg/rust.iss b/src/etc/pkg/rust.iss index 4be90666e3daa..66bb71527fed3 100644 --- a/src/etc/pkg/rust.iss +++ b/src/etc/pkg/rust.iss @@ -18,7 +18,7 @@ DisableProgramGroupPage=true DisableReadyPage=true DisableStartupPrompt=true -OutputDir=.\ +OutputDir=.\dist\ SourceDir=.\ OutputBaseFilename={#CFG_PACKAGE_NAME}-install DefaultDirName={pf32}\Rust From 116ebe5af827e5df7cd64f308b62c8aa94ee7bd5 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 13:37:09 -0700 Subject: [PATCH 07/23] mk: Add docs to dist prep For integrating doc upload into the dist-snap process --- mk/dist.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mk/dist.mk b/mk/dist.mk index 60662c2a3d5b3..1954e325a5af4 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -20,6 +20,7 @@ # * dist-win - Windows exe installers # * dist-osx - OS X .pkg installers # * dist-tar-bins - Ad-hoc Unix binary installers +# * dist-docs - Stage docs for upload PKG_NAME = $(CFG_PACKAGE_NAME) @@ -185,6 +186,17 @@ $(foreach host,$(CFG_HOST),\ $(eval $(call DEF_INSTALLER,$(host)))) +###################################################################### +# Docs +###################################################################### + +# Just copy the docs to a folder under dist with the appropriate name +# for uploading to S3 +dist-docs: docs compiler-docs + $(Q) mkdir -p dist/doc/ + $(Q) cp -r doc dist/doc/$(CFG_PACKAGE_VERS) + + ###################################################################### # Primary targets (dist, distcheck) ###################################################################### From ae0e47a6ebd5d9f371ebef4b10658ffbd4817cbb Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 14:02:08 -0700 Subject: [PATCH 08/23] mk: Add FIXME about making windows installer support all hosts --- mk/dist.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mk/dist.mk b/mk/dist.mk index 1954e325a5af4..30a83f6e0a6cb 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -87,6 +87,8 @@ dist-tar-src: $(PKG_TAR) # Windows .exe installer ###################################################################### +# FIXME Needs to support all hosts, but making rust.iss compatible looks like a chore + ifdef CFG_ISCC PKG_EXE = dist/$(PKG_NAME)-install.exe From dd7a60e0c3090488041788256f211e2d02636b73 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 15:15:45 -0700 Subject: [PATCH 09/23] mk: Fix distcheck Also, add more distcheck tests --- mk/dist.mk | 60 ++++++++++++++++++++++++++++++---------------- mk/main.mk | 5 ++-- src/etc/install.sh | 1 + 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 30a83f6e0a6cb..60855ab58a30e 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -25,7 +25,6 @@ PKG_NAME = $(CFG_PACKAGE_NAME) PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt - PKG_FILES := \ $(S)COPYRIGHT \ $(S)LICENSE-APACHE \ @@ -48,8 +47,8 @@ PKG_FILES := \ snapshots.txt \ test) \ $(PKG_GITMODULES) \ - $(filter-out Makefile config.stamp config.mk, \ - $(MKFILE_DEPS)) + $(filter-out config.stamp, \ + $(MKFILES_FOR_TARBALL)) UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES)) @@ -83,6 +82,23 @@ $(PKG_TAR): $(PKG_FILES) dist-tar-src: $(PKG_TAR) +distcheck-tar-src: $(PKG_TAR) + $(Q)rm -Rf tmp/distcheck/$(PKG_NAME) + $(Q)rm -Rf tmp/distcheck/srccheck + $(Q)mkdir -p tmp/distcheck + @$(call E, unpacking $(PKG_TAR) in tmp/distcheck/$(PKG_NAME)) + $(Q)cd tmp/distcheck && tar -xzf ../../$(PKG_TAR) + @$(call E, configuring in tmp/distcheck/srccheck) + $(Q)mkdir -p tmp/distcheck/srccheck + $(Q)cd tmp/distcheck/srccheck && ../$(PKG_NAME)/configure + @$(call E, making 'check' in tmp/distcheck/srccheck) + $(Q)+make -C tmp/distcheck/srccheck check + @$(call E, making 'clean' in tmp/distcheck/srccheck) + $(Q)+make -C tmp/distcheck/srccheck clean + $(Q)rm -Rf tmp/distcheck/$(PKG_NAME) + $(Q)rm -Rf tmp/distcheck/srccheck + + ###################################################################### # Windows .exe installer ###################################################################### @@ -100,7 +116,7 @@ PKG_EXE = dist/$(PKG_NAME)-install.exe cp $< $@ $(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \ - $(PKG_FILES) $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ + $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ dist-prepare-win $(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin @$(call E, ISCC: $@) @@ -156,10 +172,6 @@ endif # Unix binary installer tarballs ###################################################################### -dist-install-dirs: $(foreach host,$(CFG_HOST),dist-install-dir-$(host)) - -dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).tar.gz) - define DEF_INSTALLER dist-install-dir-$(1): PREPARE_HOST=$(1) dist-install-dir-$(1): PREPARE_TARGETS=$(1) @@ -187,6 +199,22 @@ endef $(foreach host,$(CFG_HOST),\ $(eval $(call DEF_INSTALLER,$(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) + +# Just try to run the compiler for the build host +distcheck-tar-bins: dist-tar-bins + @$(call E, checking binary tarball) + $(Q)rm -Rf tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD) + $(Q)rm -Rf tmp/distcheck/tarbininstall + $(Q)mkdir -p tmp/distcheck + $(Q)cd tmp/distcheck && tar -xzf ../../dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz + $(Q)mkdir -p tmp/distcheck/tarbininstall + $(Q)sh tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix=tmp/distcheck/tarbininstall + $(Q)tmp/distcheck/tarbininstall/bin/rustc --version + $(Q)rm -Rf tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD) + $(Q)rm -Rf tmp/distcheck/tarbininstall ###################################################################### # Docs @@ -208,6 +236,7 @@ ifdef CFG_WINDOWSY_$(CFG_BUILD) dist: dist-win distcheck: dist + $(Q)rm -Rf tmp/distcheck @echo @echo ----------------------------------------------- @echo Rust ready for distribution (see ./dist) @@ -217,19 +246,8 @@ else dist: dist-tar-src -distcheck: $(PKG_TAR) - $(Q)rm -Rf dist - $(Q)mkdir -p dist - @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_NAME)) - $(Q)cd dist && tar -xzf ../$(PKG_TAR) - @$(call E, configuring in dist/$(PKG_NAME)-build) - $(Q)mkdir -p dist/$(PKG_NAME)-build - $(Q)cd dist/$(PKG_NAME)-build && ../$(PKG_NAME)/configure - @$(call E, making 'check' in dist/$(PKG_NAME)-build) - $(Q)+make -C dist/$(PKG_NAME)-build check - @$(call E, making 'clean' in dist/$(PKG_NAME)-build) - $(Q)+make -C dist/$(PKG_NAME)-build clean - $(Q)rm -Rf dist +distcheck: dist distcheck-tar-src + $(Q)rm -Rf tmp/distcheck @echo @echo ----------------------------------------------- @echo Rust ready for distribution (see ./dist) diff --git a/mk/main.mk b/mk/main.mk index 1cae05cc74a54..7ccc6e74a1d13 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -61,10 +61,11 @@ CFG_VERSION_WIN = $(CFG_RELEASE_NUM) # and include all of the .d files in one fell swoop. ALL_OBJ_FILES := +MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*) +MKFILES_FOR_TARBALL:=$(MKFILE_DEPS) +$(info $(MKFILES_FOR_TARBALL)) ifneq ($(NO_MKFILE_DEPS),) MKFILE_DEPS := -else -MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*) endif NON_BUILD_HOST = $(filter-out $(CFG_BUILD),$(CFG_HOST)) NON_BUILD_TARGET = $(filter-out $(CFG_BUILD),$(CFG_TARGET)) diff --git a/src/etc/install.sh b/src/etc/install.sh index 9e718a61d8895..19e61251dc20b 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -224,6 +224,7 @@ step_msg "validating $CFG_SELF args" validate_opt # Sanity check: can we can write to the destination? +mkdir -p "${CFG_PREFIX}/lib" touch "${CFG_PREFIX}/lib/rust-install-probe" 2> /dev/null if [ $? -ne 0 ] then From b8138e0cf274a0575240ea02e5349505eafacae6 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 15:21:45 -0700 Subject: [PATCH 10/23] mk: Wire up everything to dist and distcheck Fix some misc bugs --- mk/dist.mk | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 60855ab58a30e..79c0f271b2e42 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -165,8 +165,15 @@ $(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host)))) dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).pkg) +else + +dist-osx: + endif +# FIXME should do something +distcheck-osx: + ###################################################################### # Unix binary installer tarballs @@ -223,6 +230,7 @@ distcheck-tar-bins: dist-tar-bins # Just copy the docs to a folder under dist with the appropriate name # for uploading to S3 dist-docs: docs compiler-docs + $(Q) rm -Rf dist/doc $(Q) mkdir -p dist/doc/ $(Q) cp -r doc dist/doc/$(CFG_PACKAGE_VERS) @@ -239,18 +247,18 @@ distcheck: dist $(Q)rm -Rf tmp/distcheck @echo @echo ----------------------------------------------- - @echo Rust ready for distribution (see ./dist) + @echo "Rust ready for distribution (see ./dist)" @echo ----------------------------------------------- else -dist: dist-tar-src +dist: dist-tar-src dist-osx dist-tar-bins dist-docs -distcheck: dist distcheck-tar-src +distcheck: dist distcheck-tar-src distcheck-osx distcheck-tar-bins $(Q)rm -Rf tmp/distcheck @echo @echo ----------------------------------------------- - @echo Rust ready for distribution (see ./dist) + @echo "Rust ready for distribution (see ./dist)" @echo ----------------------------------------------- endif From 805d0e53fd174eb2ba1f14b69db797a386d98f13 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 15:47:19 -0700 Subject: [PATCH 11/23] mk: Fix location of man pages in prepare.mk --- mk/prepare.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/prepare.mk b/mk/prepare.mk index bfc5c8785d00b..36c2721023f27 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -40,7 +40,7 @@ prepare-base: PREPARE_SOURCE_LIB_DIR=$(PREPARE_SOURCE_DIR)/$(CFG_LIBDIR_RELATIVE prepare-base: PREPARE_SOURCE_MAN_DIR=$(S)/man prepare-base: PREPARE_DEST_BIN_DIR=$(PREPARE_DEST_DIR)/bin prepare-base: PREPARE_DEST_LIB_DIR=$(PREPARE_DEST_DIR)/$(CFG_LIBDIR_RELATIVE) -prepare-base: PREPARE_DEST_MAN_DIR=$(PREPARE_DEST_DIR)/man/man1 +prepare-base: PREPARE_DEST_MAN_DIR=$(PREPARE_DEST_DIR)/share/man/man1 prepare-base: prepare-host prepare-targets prepare-everything: prepare-host prepare-targets From 8694c287628a2bcb1af2ba30bf778bfdd9ad0091 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 17:25:02 -0700 Subject: [PATCH 12/23] mk: Run 'make install' through install.sh --- Makefile.in | 13 ++++++----- mk/dist.mk | 2 +- mk/install.mk | 65 ++++++--------------------------------------------- 3 files changed, 15 insertions(+), 65 deletions(-) diff --git a/Makefile.in b/Makefile.in index 04ff606d0b939..660aeae621713 100644 --- a/Makefile.in +++ b/Makefile.in @@ -232,19 +232,20 @@ ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \ include $(CFG_SRC_DIR)mk/prepare.mk endif -# (Unix) Installation from the build directory -ifneq ($(findstring install,$(MAKECMDGOALS)),) - CFG_INFO := $(info cfg: including install rules) - include $(CFG_SRC_DIR)mk/install.mk -endif - # Source and binary distribution artifacts ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \ + $(findstring install,$(MAKECMDGOALS)) \ $(findstring clean,$(MAKECMDGOALS))),) CFG_INFO := $(info cfg: including dist rules) include $(CFG_SRC_DIR)mk/dist.mk endif +# (Unix) Installation from the build directory +ifneq ($(findstring install,$(MAKECMDGOALS)),) + CFG_INFO := $(info cfg: including install rules) + include $(CFG_SRC_DIR)mk/install.mk +endif + # Cleaning ifneq ($(findstring clean,$(MAKECMDGOALS)),) CFG_INFO := $(info cfg: including clean rules) diff --git a/mk/dist.mk b/mk/dist.mk index 79c0f271b2e42..f50ba91bf2bdb 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -22,7 +22,7 @@ # * dist-tar-bins - Ad-hoc Unix binary installers # * dist-docs - Stage docs for upload -PKG_NAME = $(CFG_PACKAGE_NAME) +PKG_NAME := $(CFG_PACKAGE_NAME) PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt PKG_FILES := \ diff --git a/mk/install.mk b/mk/install.mk index 6e56767a9d7e3..7bae272b47aa9 100644 --- a/mk/install.mk +++ b/mk/install.mk @@ -8,68 +8,17 @@ # option. This file may not be copied, modified, or distributed # except according to those terms. -# FIXME: Docs are currently not installed from the stageN dirs. -# For consistency it might be desirable for stageN to be an exact -# mirror of the installation directory structure. -# The stage we install from -ISTAGE = $(PREPARE_STAGE) +install: dist-install-dir-$(CFG_BUILD) + $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" -install: PREPARE_HOST=$(CFG_BUILD) -install: PREPARE_TARGETS=$(CFG_TARGET) -install: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) -install: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) -install: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) -install: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) -install: PREPARE_SOURCE_DIR=$(PREPARE_HOST)/stage$(PREPARE_STAGE) -install: PREPARE_SOURCE_BIN_DIR=$(PREPARE_SOURCE_DIR)/bin -install: PREPARE_SOURCE_LIB_DIR=$(PREPARE_SOURCE_DIR)/$(CFG_LIBDIR_RELATIVE) -install: PREPARE_SOURCE_MAN_DIR=$(S)/man -install: PREPARE_DEST_BIN_DIR=$(DESTDIR)$(CFG_PREFIX)/bin -install: PREPARE_DEST_LIB_DIR=$(DESTDIR)$(CFG_LIBDIR) -install: PREPARE_DEST_MAN_DIR=$(DESTDIR)$(CFG_MANDIR)/man1 -install: prepare-everything +uninstall: dist-install-dir-$(CFG_BUILD) + $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" --uninstall -# Uninstall code - -PREFIX_ROOT = $(CFG_PREFIX) -PREFIX_BIN = $(PREFIX_ROOT)/bin -PREFIX_LIB = $(CFG_LIBDIR) - -INSTALL_TOOLS := $(PREPARE_TOOLS) - -# Shorthand for build/stageN/bin -HB = $(HBIN$(ISTAGE)_H_$(CFG_BUILD)) -HB2 = $(HBIN2_H_$(CFG_BUILD)) -# Shorthand for build/stageN/lib -HL = $(HLIB$(ISTAGE)_H_$(CFG_BUILD)) -# Shorthand for the prefix bin directory -PHB = $(PREFIX_BIN) -# Shorthand for the prefix bin directory -PHL = $(PREFIX_LIB) - -HOST_LIB_FROM_HL_GLOB = \ - $(patsubst $(HL)/%,$(PHL)/%,$(wildcard $(HL)/$(1))) - -uninstall: $(foreach tool,$(INSTALL_TOOLS),uninstall-tool-$(tool)) - $(Q)rm -Rf $(PHL)/$(CFG_RUSTLIBDIR) - -define UNINSTALL_TOOL -uninstall-tool-$(1): $$(foreach dep,$$(TOOL_DEPS_$(1)),uninstall-lib-$$(dep)) - $$(Q)rm -f $$(PHB)/$(1)$$(X_$$(CFG_BUILD)) - $$(Q)rm -f $$(CFG_MANDIR)/man1/$(1).1 -endef - -$(foreach tool,$(INSTALL_TOOLS),$(eval $(call UNINSTALL_TOOL,$(tool)))) - -define UNINSTALL_LIB -uninstall-lib-$(1): $$(foreach dep,$$(RUST_DEPS_$(1)),uninstall-lib-$$(dep)) - $$(Q)rm -f $$(call HOST_LIB_FROM_HL_GLOB,$$(call CFG_LIB_GLOB_$$(CFG_BUILD),$(1))) -endef - -$(foreach lib,$(CRATES),$(eval $(call UNINSTALL_LIB,$(lib)))) - +###################################################################### +# Android remote installation +###################################################################### # Android runtime setup # FIXME: This probably belongs somewhere else From cc5fae720a4dbc02891ce55c87754d499d66ddfc Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 17:31:18 -0700 Subject: [PATCH 13/23] install: Error on uninstall if manifest can't be found --- src/etc/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/etc/install.sh b/src/etc/install.sh index 19e61251dc20b..5b41e25e25774 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -237,6 +237,7 @@ need_ok "failed to remove install probe" "${CFG_SRC_DIR}/bin/rustc" --version > /dev/null need_ok "can't run these binaries on this platform" + # First, uninstall from the installation prefix # FIXME: Hardcoded 'rustlib' ignores CFG_RUSTLIBDIR if [ -f "${CFG_PREFIX}/lib/rustlib/manifest" ] @@ -251,6 +252,12 @@ then msg "uninstall ${CFG_PREFIX}/lib/rustlib" rm -r "${CFG_PREFIX}/lib/rustlib" need_ok "failed to remove rustlib" +else + if [ -n "${CFG_UNINSTALL}" ] + then + err "unable to find manifest at ${CFG_PREFIX}/lib/rustlib" + exit 0 + fi fi # If we're only uninstalling then exit From c2e5e62135ea97b7e4926038f52116fd591e6215 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 18:55:31 -0700 Subject: [PATCH 14/23] mk: Fix some dist deps for parallel builds --- mk/dist.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index f50ba91bf2bdb..92e4f9bc24159 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -82,7 +82,7 @@ $(PKG_TAR): $(PKG_FILES) dist-tar-src: $(PKG_TAR) -distcheck-tar-src: $(PKG_TAR) +distcheck-tar-src: dist-tar-src $(Q)rm -Rf tmp/distcheck/$(PKG_NAME) $(Q)rm -Rf tmp/distcheck/srccheck $(Q)mkdir -p tmp/distcheck @@ -136,6 +136,7 @@ endif dist-win: $(PKG_EXE) +distcheck-win: dist-win ###################################################################### # OS X .pkg installer @@ -172,7 +173,7 @@ dist-osx: endif # FIXME should do something -distcheck-osx: +distcheck-osx: dist-osx ###################################################################### @@ -243,7 +244,7 @@ ifdef CFG_WINDOWSY_$(CFG_BUILD) dist: dist-win -distcheck: dist +distcheck: distcheck-win $(Q)rm -Rf tmp/distcheck @echo @echo ----------------------------------------------- @@ -254,7 +255,7 @@ else dist: dist-tar-src dist-osx dist-tar-bins dist-docs -distcheck: dist distcheck-tar-src distcheck-osx distcheck-tar-bins +distcheck: distcheck-tar-src distcheck-osx distcheck-tar-bins $(Q)rm -Rf tmp/distcheck @echo @echo ----------------------------------------------- From 169f08dd59f287a65da5188ff453f38f4215250c Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 19:20:44 -0700 Subject: [PATCH 15/23] mk: Cleanup dist.mk yet more --- mk/dist.mk | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 92e4f9bc24159..801a843a917a4 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -24,6 +24,17 @@ PKG_NAME := $(CFG_PACKAGE_NAME) +# License suitable for displaying in a popup +LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT + cat $^ > $@ + + +###################################################################### +# Source tarball +###################################################################### + +PKG_TAR = dist/$(PKG_NAME).tar.gz + PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt PKG_FILES := \ $(S)COPYRIGHT \ @@ -52,16 +63,6 @@ PKG_FILES := \ UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES)) -LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT - cat $^ > $@ - - -###################################################################### -# Source tarball -###################################################################### - -PKG_TAR = dist/$(PKG_NAME).tar.gz - $(PKG_TAR): $(PKG_FILES) @$(call E, making dist dir) $(Q)rm -Rf tmp/dist/$(PKG_NAME) From eed808b53242071290c333c634efd7d42a5be2d7 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 21 Mar 2014 20:12:51 -0700 Subject: [PATCH 16/23] install: Improve error handling --- src/etc/install.sh | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/etc/install.sh b/src/etc/install.sh index 5b41e25e25774..63bb71558ab28 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -224,13 +224,14 @@ step_msg "validating $CFG_SELF args" validate_opt # Sanity check: can we can write to the destination? -mkdir -p "${CFG_PREFIX}/lib" +umask 022 && mkdir -p "${CFG_PREFIX}/lib" +need_ok "directory creation failed" touch "${CFG_PREFIX}/lib/rust-install-probe" 2> /dev/null if [ $? -ne 0 ] then err "can't write to destination. try again with 'sudo'." fi -rm -r "${CFG_PREFIX}/lib/rust-install-probe" +rm "${CFG_PREFIX}/lib/rust-install-probe" need_ok "failed to remove install probe" # Sanity check: can we run these binaries? @@ -238,35 +239,51 @@ need_ok "failed to remove install probe" need_ok "can't run these binaries on this platform" -# First, uninstall from the installation prefix +# First, uninstall from the installation prefix. +# Errors are warnings - try to rm everything in the manifest even if some fail. # FIXME: Hardcoded 'rustlib' ignores CFG_RUSTLIBDIR if [ -f "${CFG_PREFIX}/lib/rustlib/manifest" ] then + # Iterate through installed manifest and remove files while read p; do - msg "uninstall ${CFG_PREFIX}/$p" - rm "${CFG_PREFIX}/$p" - need_ok "failed to remove file" + msg "removing ${CFG_PREFIX}/$p" + if [ -f "${CFG_PREFIX}/$p" ] + then + rm "${CFG_PREFIX}/$p" + if [ $? -ne 0 ] + then + warn "failed to remove ${CFG_PREFIX}/$p" + fi + else + warn "supposedly installed file ${CFG_PREFIX}/$p does not exist!" + fi done < "${CFG_PREFIX}/lib/rustlib/manifest" # Remove 'rustlib' directory - msg "uninstall ${CFG_PREFIX}/lib/rustlib" + msg "removing ${CFG_PREFIX}/lib/rustlib" rm -r "${CFG_PREFIX}/lib/rustlib" - need_ok "failed to remove rustlib" + if [ $? -ne 0 ] + then + warn "failed to remove rustlib" + fi else if [ -n "${CFG_UNINSTALL}" ] then - err "unable to find manifest at ${CFG_PREFIX}/lib/rustlib" - exit 0 + err "unable to find installation manifest at ${CFG_PREFIX}/lib/rustlib" fi fi # If we're only uninstalling then exit if [ -n "${CFG_UNINSTALL}" ] then + echo + echo " Rust is uninstalled. Have a nice day." + echo exit 0 fi -# Iterate through the new manifest and install files + +# Now install, iterate through the new manifest and copy files while read p; do umask 022 && mkdir -p "${CFG_PREFIX}/$(dirname $p)" From fe5bd8857da5caebbb80aafddc4147dcb04018cc Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 22 Mar 2014 01:44:10 -0700 Subject: [PATCH 17/23] install: Don't try to run binaries on install I think there are likely to be scenarios where this script is run to move files to the correct place during cross-compiles. --- src/etc/install.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/etc/install.sh b/src/etc/install.sh index 63bb71558ab28..8dfc1903094e7 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -234,10 +234,6 @@ fi rm "${CFG_PREFIX}/lib/rust-install-probe" need_ok "failed to remove install probe" -# Sanity check: can we run these binaries? -"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null -need_ok "can't run these binaries on this platform" - # First, uninstall from the installation prefix. # Errors are warnings - try to rm everything in the manifest even if some fail. From ba98689f0977b96efb57b827bc788ad79651e3b4 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 23 Mar 2014 18:24:51 -0700 Subject: [PATCH 18/23] mk: Remove some debug logging --- mk/main.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/mk/main.mk b/mk/main.mk index 7ccc6e74a1d13..ccbdf30a1ffe4 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -63,7 +63,6 @@ ALL_OBJ_FILES := MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*) MKFILES_FOR_TARBALL:=$(MKFILE_DEPS) -$(info $(MKFILES_FOR_TARBALL)) ifneq ($(NO_MKFILE_DEPS),) MKFILE_DEPS := endif From a2e8e30b11d43036960d9f9103fd4faaf683046b Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 23 Mar 2014 18:26:35 -0700 Subject: [PATCH 19/23] mk: Don't rm 'dist' during clean, just its contents This is not for temporaries now --- mk/clean.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mk/clean.mk b/mk/clean.mk index 34fd4d06fe5e6..725f80ac8b52c 100644 --- a/mk/clean.mk +++ b/mk/clean.mk @@ -43,7 +43,8 @@ clean-misc: $(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF) $(Q)rm -Rf $(GENERATED) $(Q)rm -Rf tmp/* - $(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz $(PKG_NAME)-*.exe dist + $(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz $(PKG_NAME)-*.exe + $(Q)rm -Rf dist/* $(Q)rm -Rf doc define CLEAN_GENERIC From 70a10758de83a3ccc677d53127fe66eb7d06b10c Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 24 Mar 2014 10:42:50 -0700 Subject: [PATCH 20/23] mk: Fix a minor UI bug --- mk/prepare.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/prepare.mk b/mk/prepare.mk index 36c2721023f27..ebadbb9db883a 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -192,6 +192,6 @@ $(foreach host,$(CFG_HOST),\ prepare-maybe-clean: $(if $(findstring true,$(PREPARE_CLEAN)),\ - @$(call E, cleaning destination $@),) + @$(call E, cleaning destination $(PREPARE_DEST_DIR)),) $(if $(findstring true,$(PREPARE_CLEAN)),\ $(Q)rm -rf $(PREPARE_DEST_DIR),) From c796f89dbc3e61845d1e44d117acc471f583c417 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 24 Mar 2014 12:03:47 -0700 Subject: [PATCH 21/23] mk: Fix prepare.mk The way it was formulated you could only 'prepare' one directory per build. --- mk/dist.mk | 14 ++++-- mk/prepare.mk | 124 +++++++++++++++++++++++++------------------------- 2 files changed, 74 insertions(+), 64 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 801a843a917a4..9dd54e3ebe2e0 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -123,6 +123,8 @@ $(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \ @$(call E, ISCC: $@) $(Q)"$(CFG_ISCC)" $< +$(eval $(call DEF_PREPARE,win)) + dist-prepare-win: PREPARE_HOST=$(CFG_BUILD) dist-prepare-win: PREPARE_TARGETS=$(CFG_BUILD) dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win @@ -131,7 +133,7 @@ dist-prepare-win: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) dist-prepare-win: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) dist-prepare-win: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) dist-prepare-win: PREPARE_CLEAN=true -dist-prepare-win: prepare-base +dist-prepare-win: prepare-base-win endif @@ -146,6 +148,9 @@ distcheck-win: dist-win ifeq ($(CFG_OSTYPE), apple-darwin) define DEF_OSX_PKG + +$$(eval $$(call DEF_PREPARE,osx-$(1))) + dist-prepare-osx-$(1): PREPARE_HOST=$(1) dist-prepare-osx-$(1): PREPARE_TARGETS=$(1) dist-prepare-osx-$(1): PREPARE_DEST_DIR=tmp/dist/pkgroot-$(1) @@ -153,7 +158,7 @@ dist-prepare-osx-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) dist-prepare-osx-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) dist-prepare-osx-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) dist-prepare-osx-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) -dist-prepare-osx-$(1): prepare-base +dist-prepare-osx-$(1): prepare-base-osx-$(1) dist/$(PKG_NAME)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1) @$$(call E, making OS X pkg) @@ -182,6 +187,9 @@ distcheck-osx: dist-osx ###################################################################### define DEF_INSTALLER + +$$(eval $$(call DEF_PREPARE,dir-$(1))) + dist-install-dir-$(1): PREPARE_HOST=$(1) dist-install-dir-$(1): PREPARE_TARGETS=$(1) dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1) @@ -190,7 +198,7 @@ dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) dist-install-dir-$(1): PREPARE_CLEAN=true -dist-install-dir-$(1): prepare-base +dist-install-dir-$(1): prepare-base-dir-$(1) $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f) \ > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/$$(CFG_RUSTLIBDIR)/manifest $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR) diff --git a/mk/prepare.mk b/mk/prepare.mk index ebadbb9db883a..a4197fdb04508 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -28,23 +28,6 @@ else PREPARE_STAGE=2 endif -prepare: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) -prepare: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) -prepare: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) -prepare: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) -prepare: prepare-base - -prepare-base: PREPARE_SOURCE_DIR=$(PREPARE_HOST)/stage$(PREPARE_STAGE) -prepare-base: PREPARE_SOURCE_BIN_DIR=$(PREPARE_SOURCE_DIR)/bin -prepare-base: PREPARE_SOURCE_LIB_DIR=$(PREPARE_SOURCE_DIR)/$(CFG_LIBDIR_RELATIVE) -prepare-base: PREPARE_SOURCE_MAN_DIR=$(S)/man -prepare-base: PREPARE_DEST_BIN_DIR=$(PREPARE_DEST_DIR)/bin -prepare-base: PREPARE_DEST_LIB_DIR=$(PREPARE_DEST_DIR)/$(CFG_LIBDIR_RELATIVE) -prepare-base: PREPARE_DEST_MAN_DIR=$(PREPARE_DEST_DIR)/share/man/man1 -prepare-base: prepare-host prepare-targets - -prepare-everything: prepare-host prepare-targets - DEFAULT_PREPARE_DIR_CMD = umask 022 && mkdir -p DEFAULT_PREPARE_BIN_CMD = install -m755 DEFAULT_PREPARE_LIB_CMD = install -m644 @@ -93,29 +76,17 @@ define PREPARE_MAN $(Q)$(PREPARE_MAN_CMD) $(PREPARE_SOURCE_MAN_DIR)/$(1) $(PREPARE_DEST_MAN_DIR)/$(1) endef - PREPARE_TOOLS = $(filter-out compiletest, $(TOOLS)) -prepare-host: prepare-host-tools - -prepare-host-tools: \ - $(foreach tool, $(PREPARE_TOOLS),\ - $(foreach host,$(CFG_HOST),\ - prepare-host-tool-$(tool)-$(PREPARE_STAGE)-$(host))) - -prepare-host-dirs: prepare-maybe-clean - $(call PREPARE_DIR,$(PREPARE_DEST_BIN_DIR)) - $(call PREPARE_DIR,$(PREPARE_DEST_LIB_DIR)) - $(call PREPARE_DIR,$(PREPARE_DEST_MAN_DIR)) # $(1) is tool # $(2) is stage # $(3) is host +# $(4) tag define DEF_PREPARE_HOST_TOOL -prepare-host-tool-$(1)-$(2)-$(3): prepare-maybe-clean \ - $$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)) \ - $$(HBIN$(2)_H_$(3))/$(1)$$(X_$(3)) \ - prepare-host-dirs +prepare-host-tool-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \ + $$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \ + prepare-host-dirs-$(4) $$(if $$(findstring $(2), $$(PREPARE_STAGE)),\ $$(if $$(findstring $(3), $$(PREPARE_HOST)),\ $$(call PREPARE_BIN,$(1)$$(X_$$(PREPARE_HOST))),),) @@ -124,45 +95,35 @@ prepare-host-tool-$(1)-$(2)-$(3): prepare-maybe-clean \ $$(call PREPARE_MAN,$(1).1),),) endef -$(foreach tool,$(PREPARE_TOOLS),\ - $(foreach host,$(CFG_HOST),\ - $(eval $(call DEF_PREPARE_HOST_TOOL,$(tool),$(PREPARE_STAGE),$(host))))) - # For host libraries only install dylibs, not rlibs since the host libs are only # used to support rustc and rustc uses dynamic linking # # $(1) is tool # $(2) is stage # $(3) is host +# $(4) tag define DEF_PREPARE_HOST_LIB -prepare-host-lib-$(1)-$(2)-$(3): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR) -prepare-host-lib-$(1)-$(2)-$(3): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR) -prepare-host-lib-$(1)-$(2)-$(3): prepare-maybe-clean \ - $$(foreach dep,$$(RUST_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3))\ +prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR) +prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR) +prepare-host-lib-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \ + $$(foreach dep,$$(RUST_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4))\ $$(HLIB$(2)_H_$(3))/stamp.$(1) \ - prepare-host-dirs + prepare-host-dirs-$(4) $$(if $$(findstring $(2), $$(PREPARE_STAGE)),\ $$(if $$(findstring $(3), $$(PREPARE_HOST)),\ $$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$$(PREPARE_HOST),$(1))),),) endef -$(foreach lib,$(CRATES),\ - $(foreach host,$(CFG_HOST),\ - $(eval $(call DEF_PREPARE_HOST_LIB,$(lib),$(PREPARE_STAGE),$(host))))) - -prepare-targets:\ - $(foreach host,$(CFG_HOST),\ - $(foreach target,$(CFG_TARGET),\ - prepare-target-$(target)-host-$(host)-$(PREPARE_STAGE))) # $(1) is stage # $(2) is target # $(3) is host +# $(4) tag define DEF_PREPARE_TARGET_N # Rebind PREPARE_*_LIB_DIR to point to rustlib, then install the libs for the targets -prepare-target-$(2)-host-$(3)-$(1): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib -prepare-target-$(2)-host-$(3)-$(1): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib -prepare-target-$(2)-host-$(3)-$(1): prepare-maybe-clean \ +prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib +prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib +prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \ $$(foreach crate,$$(TARGET_CRATES), \ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \ $$(if $$(findstring $(2),$$(CFG_HOST)), \ @@ -186,12 +147,53 @@ prepare-target-$(2)-host-$(3)-$(1): prepare-maybe-clean \ $$(call PREPARE_LIB,libcompiler-rt.a),),),) endef -$(foreach host,$(CFG_HOST),\ - $(foreach target,$(CFG_TARGET), \ - $(eval $(call DEF_PREPARE_TARGET_N,$(PREPARE_STAGE),$(target),$(host))))) +define DEF_PREPARE + +prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) +prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin +prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) +prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man +prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin +prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) +prepare-base-$(1): PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1 +prepare-base-$(1): prepare-host-$(1) prepare-targets-$(1) + +prepare-host-$(1): prepare-host-tools-$(1) + +prepare-host-tools-$(1): \ + $$(foreach tool, $$(PREPARE_TOOLS),\ + $$(foreach host,$$(CFG_HOST),\ + prepare-host-tool-$$(tool)-$$(PREPARE_STAGE)-$$(host)-$(1))) + +prepare-host-dirs-$(1): prepare-maybe-clean-$(1) + $$(call PREPARE_DIR,$$(PREPARE_DEST_BIN_DIR)) + $$(call PREPARE_DIR,$$(PREPARE_DEST_LIB_DIR)) + $$(call PREPARE_DIR,$$(PREPARE_DEST_MAN_DIR)) + +$$(foreach tool,$$(PREPARE_TOOLS),\ + $$(foreach host,$$(CFG_HOST),\ + $$(eval $$(call DEF_PREPARE_HOST_TOOL,$$(tool),$$(PREPARE_STAGE),$$(host),$(1))))) + +$$(foreach lib,$$(CRATES),\ + $$(foreach host,$$(CFG_HOST),\ + $$(eval $$(call DEF_PREPARE_HOST_LIB,$$(lib),$$(PREPARE_STAGE),$$(host),$(1))))) + +prepare-targets-$(1):\ + $$(foreach host,$$(CFG_HOST),\ + $$(foreach target,$$(CFG_TARGET),\ + prepare-target-$$(target)-host-$$(host)-$$(PREPARE_STAGE)-$(1))) + +$$(foreach host,$$(CFG_HOST),\ + $$(foreach target,$$(CFG_TARGET), \ + $$(eval $$(call DEF_PREPARE_TARGET_N,$$(PREPARE_STAGE),$$(target),$$(host),$(1))))) + +prepare-maybe-clean-$(1): + $$(if $$(findstring true,$$(PREPARE_CLEAN)),\ + @$$(call E, cleaning destination $$(PREPARE_DEST_DIR)),) + $$(if $$(findstring true,$$(PREPARE_CLEAN)),\ + $$(Q)rm -rf $$(PREPARE_DEST_DIR),) + + +endef + -prepare-maybe-clean: - $(if $(findstring true,$(PREPARE_CLEAN)),\ - @$(call E, cleaning destination $(PREPARE_DEST_DIR)),) - $(if $(findstring true,$(PREPARE_CLEAN)),\ - $(Q)rm -rf $(PREPARE_DEST_DIR),) From d62163188a21e5afc3d0f476eaf7856d91f715b2 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 24 Mar 2014 12:04:27 -0700 Subject: [PATCH 22/23] Revert "mk: Run 'make install' through install.sh" This reverts commit e93709a911637194835268420e67d768ee19b5df. --- Makefile.in | 13 +++++------ mk/dist.mk | 2 +- mk/install.mk | 65 +++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 65 insertions(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index 660aeae621713..04ff606d0b939 100644 --- a/Makefile.in +++ b/Makefile.in @@ -232,20 +232,19 @@ ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \ include $(CFG_SRC_DIR)mk/prepare.mk endif +# (Unix) Installation from the build directory +ifneq ($(findstring install,$(MAKECMDGOALS)),) + CFG_INFO := $(info cfg: including install rules) + include $(CFG_SRC_DIR)mk/install.mk +endif + # Source and binary distribution artifacts ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \ - $(findstring install,$(MAKECMDGOALS)) \ $(findstring clean,$(MAKECMDGOALS))),) CFG_INFO := $(info cfg: including dist rules) include $(CFG_SRC_DIR)mk/dist.mk endif -# (Unix) Installation from the build directory -ifneq ($(findstring install,$(MAKECMDGOALS)),) - CFG_INFO := $(info cfg: including install rules) - include $(CFG_SRC_DIR)mk/install.mk -endif - # Cleaning ifneq ($(findstring clean,$(MAKECMDGOALS)),) CFG_INFO := $(info cfg: including clean rules) diff --git a/mk/dist.mk b/mk/dist.mk index 9dd54e3ebe2e0..80bd048b8b42d 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -22,7 +22,7 @@ # * dist-tar-bins - Ad-hoc Unix binary installers # * dist-docs - Stage docs for upload -PKG_NAME := $(CFG_PACKAGE_NAME) +PKG_NAME = $(CFG_PACKAGE_NAME) # License suitable for displaying in a popup LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT diff --git a/mk/install.mk b/mk/install.mk index 7bae272b47aa9..6e56767a9d7e3 100644 --- a/mk/install.mk +++ b/mk/install.mk @@ -8,17 +8,68 @@ # option. This file may not be copied, modified, or distributed # except according to those terms. +# FIXME: Docs are currently not installed from the stageN dirs. +# For consistency it might be desirable for stageN to be an exact +# mirror of the installation directory structure. -install: dist-install-dir-$(CFG_BUILD) - $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" +# The stage we install from +ISTAGE = $(PREPARE_STAGE) -uninstall: dist-install-dir-$(CFG_BUILD) - $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" --uninstall +install: PREPARE_HOST=$(CFG_BUILD) +install: PREPARE_TARGETS=$(CFG_TARGET) +install: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) +install: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) +install: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) +install: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) +install: PREPARE_SOURCE_DIR=$(PREPARE_HOST)/stage$(PREPARE_STAGE) +install: PREPARE_SOURCE_BIN_DIR=$(PREPARE_SOURCE_DIR)/bin +install: PREPARE_SOURCE_LIB_DIR=$(PREPARE_SOURCE_DIR)/$(CFG_LIBDIR_RELATIVE) +install: PREPARE_SOURCE_MAN_DIR=$(S)/man +install: PREPARE_DEST_BIN_DIR=$(DESTDIR)$(CFG_PREFIX)/bin +install: PREPARE_DEST_LIB_DIR=$(DESTDIR)$(CFG_LIBDIR) +install: PREPARE_DEST_MAN_DIR=$(DESTDIR)$(CFG_MANDIR)/man1 +install: prepare-everything -###################################################################### -# Android remote installation -###################################################################### +# Uninstall code + +PREFIX_ROOT = $(CFG_PREFIX) +PREFIX_BIN = $(PREFIX_ROOT)/bin +PREFIX_LIB = $(CFG_LIBDIR) + +INSTALL_TOOLS := $(PREPARE_TOOLS) + +# Shorthand for build/stageN/bin +HB = $(HBIN$(ISTAGE)_H_$(CFG_BUILD)) +HB2 = $(HBIN2_H_$(CFG_BUILD)) +# Shorthand for build/stageN/lib +HL = $(HLIB$(ISTAGE)_H_$(CFG_BUILD)) +# Shorthand for the prefix bin directory +PHB = $(PREFIX_BIN) +# Shorthand for the prefix bin directory +PHL = $(PREFIX_LIB) + +HOST_LIB_FROM_HL_GLOB = \ + $(patsubst $(HL)/%,$(PHL)/%,$(wildcard $(HL)/$(1))) + +uninstall: $(foreach tool,$(INSTALL_TOOLS),uninstall-tool-$(tool)) + $(Q)rm -Rf $(PHL)/$(CFG_RUSTLIBDIR) + +define UNINSTALL_TOOL +uninstall-tool-$(1): $$(foreach dep,$$(TOOL_DEPS_$(1)),uninstall-lib-$$(dep)) + $$(Q)rm -f $$(PHB)/$(1)$$(X_$$(CFG_BUILD)) + $$(Q)rm -f $$(CFG_MANDIR)/man1/$(1).1 +endef + +$(foreach tool,$(INSTALL_TOOLS),$(eval $(call UNINSTALL_TOOL,$(tool)))) + +define UNINSTALL_LIB +uninstall-lib-$(1): $$(foreach dep,$$(RUST_DEPS_$(1)),uninstall-lib-$$(dep)) + $$(Q)rm -f $$(call HOST_LIB_FROM_HL_GLOB,$$(call CFG_LIB_GLOB_$$(CFG_BUILD),$(1))) +endef + +$(foreach lib,$(CRATES),$(eval $(call UNINSTALL_LIB,$(lib)))) + # Android runtime setup # FIXME: This probably belongs somewhere else From 39b48fb8836b130fa6bec09b4864b5a8eee0cd42 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 24 Mar 2014 13:13:12 -0700 Subject: [PATCH 23/23] mk: Make distcheck depend on dist-docs --- mk/dist.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mk/dist.mk b/mk/dist.mk index 80bd048b8b42d..4990ae12f5e97 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -244,6 +244,7 @@ dist-docs: docs compiler-docs $(Q) mkdir -p dist/doc/ $(Q) cp -r doc dist/doc/$(CFG_PACKAGE_VERS) +distcheck-docs: dist-docs ###################################################################### # Primary targets (dist, distcheck) @@ -264,7 +265,7 @@ else dist: dist-tar-src dist-osx dist-tar-bins dist-docs -distcheck: distcheck-tar-src distcheck-osx distcheck-tar-bins +distcheck: distcheck-tar-src distcheck-osx distcheck-tar-bins distcheck-docs $(Q)rm -Rf tmp/distcheck @echo @echo -----------------------------------------------