From ff17b7c09976c5ae6a7d05b4abf4d0457db95968 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 17:34:01 -0700 Subject: [PATCH 01/13] mk: Remove leading './' from manifest entries --- mk/dist.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/dist.mk b/mk/dist.mk index 4990ae12f5e97..454ae4026a10f 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -199,7 +199,7 @@ 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-dir-$(1) - $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f) \ + $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \ > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/$$(CFG_RUSTLIBDIR)/manifest $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR) From e509cd6e2bb4157bdad682a4c76e47da9bedf2c5 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 17:54:26 -0700 Subject: [PATCH 02/13] Revert "Revert "mk: Run 'make install' through install.sh"" This reverts commit d62163188a21e5afc3d0f476eaf7856d91f715b2. Conflicts: mk/install.mk --- Makefile.in | 13 +++++----- mk/dist.mk | 2 +- mk/install.mk | 67 ++++++--------------------------------------------- 3 files changed, 15 insertions(+), 67 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 454ae4026a10f..91f64decb0c67 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 57f4db269542f..7bae272b47aa9 100644 --- a/mk/install.mk +++ b/mk/install.mk @@ -8,70 +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)" -$(eval $(call DEF_PREPARE,mkfile-install)) +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-mkfile-install - - -# 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 6f9b30c6c11b05fdb299bcab97b5002a813c0bac Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 18:18:57 -0700 Subject: [PATCH 03/13] configure: Make rustlibdir non-configurable Trying to reduce the complexity of installation --- configure | 9 ++++----- mk/dist.mk | 2 +- mk/main.mk | 3 +-- mk/prepare.mk | 4 ++-- mk/stage0.mk | 2 +- mk/tests.mk | 2 +- src/etc/install.sh | 1 - src/librustc/metadata/filesearch.rs | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 45b4405132f69..e875a9a092309 100755 --- a/configure +++ b/configure @@ -401,7 +401,8 @@ valopt infodir "${CFG_PREFIX}/share/info" "install additional info" valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH" # On windows we just store the libraries in the bin directory because -# there's no rpath +# there's no rpath. This is where the build system itself puts libraries; +# --libdir is used to configure the installation directory. # FIXME: Thise needs to parameterized over target triples. Do it in platform.mk CFG_LIBDIR_RELATIVE=lib if [ "$CFG_OSTYPE" = "pc-mingw32" ] @@ -410,7 +411,6 @@ then fi valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries" -valopt rustlibdir "rustlib" "subdirectory name for rustc's libraries" if [ $HELP -eq 1 ] then @@ -777,10 +777,10 @@ do make_dir $h/stage$i/test # target bin dir - make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/$CFG_RUSTLIBDIR/$t/bin + make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/bin # target lib dir - make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/$CFG_RUSTLIBDIR/$t/lib + make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/lib done done @@ -1039,7 +1039,6 @@ putvar CFG_HOST putvar CFG_TARGET putvar CFG_C_COMPILER putvar CFG_LIBDIR -putvar CFG_RUSTLIBDIR putvar CFG_LIBDIR_RELATIVE putvar CFG_DISABLE_MANAGE_SUBMODULES putvar CFG_ANDROID_CROSS_PATH diff --git a/mk/dist.mk b/mk/dist.mk index 91f64decb0c67..60549e299cce2 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -200,7 +200,7 @@ dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) dist-install-dir-$(1): PREPARE_CLEAN=true dist-install-dir-$(1): prepare-base-dir-$(1) $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \ - > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/$$(CFG_RUSTLIBDIR)/manifest + > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR) diff --git a/mk/main.mk b/mk/main.mk index ccbdf30a1ffe4..38943f1f7739f 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -281,7 +281,6 @@ export CFG_LLVM_ROOT export CFG_ENABLE_MINGW_CROSS export CFG_PREFIX export CFG_LIBDIR -export CFG_RUSTLIBDIR export CFG_LIBDIR_RELATIVE export CFG_DISABLE_INJECT_STD_VERSION @@ -302,7 +301,7 @@ HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) # Destinations of artifacts for target architectures -TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLIBDIR)/$(2) +TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib diff --git a/mk/prepare.mk b/mk/prepare.mk index bf626b2101e41..ae76ecc594ce4 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -121,8 +121,8 @@ endef # $(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)-$(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_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(2)/lib +prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(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)) \ diff --git a/mk/stage0.mk b/mk/stage0.mk index 5582e50b7c42f..080e733724d46 100644 --- a/mk/stage0.mk +++ b/mk/stage0.mk @@ -15,7 +15,7 @@ $(SNAPSHOT_RUSTC_POST_CLEANUP): \ # Note: the variable "SNAPSHOT_FILE" is generally not set, and so # we generally only pass one argument to this script. ifdef CFG_ENABLE_LOCAL_RUST - $(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) $(CFG_RUSTLIBDIR) + $(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) rustlib else $(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE) ifdef CFG_ENABLE_PAX_FLAGS diff --git a/mk/tests.mk b/mk/tests.mk index 22d686b1b0e24..b0ae685faa899 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -104,7 +104,7 @@ ifdef CFG_WINDOWSY_$(1) stage2/$$(CFG_LIBDIR_RELATIVE), \ $$(if $$(findstring stage3,$$(1)), \ stage3/$$(CFG_LIBDIR_RELATIVE), \ - )))))/$$(CFG_RUSTLIBDIR)/$$(CFG_BUILD)/lib + )))))/rustlib/$$(CFG_BUILD)/lib CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(3)),$$(1)) endif diff --git a/src/etc/install.sh b/src/etc/install.sh index 8dfc1903094e7..e6d20b932b39e 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -237,7 +237,6 @@ need_ok "failed to remove install probe" # 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 diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index fa794c883450a..31252ab4f82af 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -242,5 +242,5 @@ pub fn libdir() -> ~str { // The name of rustc's own place to organize libraries. // Used to be "rustc", now the default is "rustlib" pub fn rustlibdir() -> ~str { - (env!("CFG_RUSTLIBDIR")).to_owned() + ~"rustlib" } From f772e31d6484f090b9bc50f8e14f426c9c6dfaff Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 19:17:02 -0700 Subject: [PATCH 04/13] rustc: Stop relying on CFG_LIBDIR_RELATIVE This is not sufficient for finding the library directory for binary installs, but it does make the build more complex by requiring env vars be set to build rustc. --- src/librustc/metadata/filesearch.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 31252ab4f82af..df5aa1fe4149b 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -235,8 +235,14 @@ pub fn rust_path() -> Vec { // The name of the directory rustc expects libraries to be located. // On Unix should be "lib", on windows "bin" +#[cfg(unix)] pub fn libdir() -> ~str { - (env!("CFG_LIBDIR_RELATIVE")).to_owned() + ~"lib" +} + +#[cfg(windows)] +pub fn libdir() -> ~str { + ~"bin" } // The name of rustc's own place to organize libraries. From d252539990f5b4abee412d08edc6b36fd2a6219e Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 19:23:45 -0700 Subject: [PATCH 05/13] mk: Rename CFG_COMPILER to CFG_COMPILER_HOST_TRIPLE Much clearer --- mk/target.mk | 4 ++-- mk/tests.mk | 2 +- src/librustc/driver/driver.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mk/target.mk b/mk/target.mk index 03569cb8b67c8..11c57ac070f39 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -11,7 +11,7 @@ # This is the compile-time target-triple for the compiler. For the compiler at # runtime, this should be considered the host-triple. More explanation for why # this exists can be found on issue #2400 -export CFG_COMPILER +export CFG_COMPILER_HOST_TRIPLE # The standard libraries should be held up to a higher standard than any old # code, make sure that these common warnings are denied by default. These can @@ -68,7 +68,7 @@ $(foreach host,$(CFG_HOST), \ # $(4) is the crate name define RUST_TARGET_STAGE_N -$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER = $(2) +$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2) $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \ $$(CRATEFILE_$(4)) \ $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \ diff --git a/mk/tests.mk b/mk/tests.mk index b0ae685faa899..7fd6d148f3863 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -350,7 +350,7 @@ else TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4)) endif -$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2) +$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER_HOST_TRIPLE = $(2) $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \ $$(CRATEFILE_$(4)) \ $$(TESTDEP_$(1)_$(2)_$(3)_$(4)) diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index fb0de95948988..9ee0bb4a107cd 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -800,7 +800,7 @@ pub fn host_triple() -> ~str { // Instead of grabbing the host triple (for the current host), we grab (at // compile time) the target triple that this rustc is built with and // calling that (at runtime) the host triple. - (env!("CFG_COMPILER")).to_owned() + (env!("CFG_COMPILER_HOST_TRIPLE")).to_owned() } pub fn build_session_options(matches: &getopts::Matches) -> session::Options { From 00f7776daad5fc299d19346cdba21f22ab2fd79a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 21:33:44 -0700 Subject: [PATCH 06/13] mk: Make nightlyism a configure option --- configure | 1 + mk/main.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index e875a9a092309..b2b861a019aa6 100755 --- a/configure +++ b/configure @@ -383,6 +383,7 @@ opt local-rust 0 "use an installed rustc rather than downloading a snapshot" opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)" opt inject-std-version 1 "inject the current compiler version of libstd into programs" opt rpath 1 "build rpaths into rustc itself" +opt nightly 0 "build nightly packages" valopt prefix "/usr/local" "set installation prefix" valopt local-rust-root "/usr/local" "set prefix for local rust binary" valopt llvm-root "" "set LLVM root" diff --git a/mk/main.mk b/mk/main.mk index 38943f1f7739f..f59a553d783ba 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -16,7 +16,7 @@ CFG_RELEASE_NUM=0.10 CFG_RELEASE_LABEL=-pre -ifndef CFG_NIGHTLY +ifndef CFG_ENABLE_NIGHTLY # This is the normal version string CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL) CFG_PACKAGE_VERS=$(CFG_RELEASE) From 380fe976c83bd78ae1a797849ea1162a8c6d349b Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 21:34:01 -0700 Subject: [PATCH 07/13] mk: Fix deps for prepare host tools --- mk/prepare.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/prepare.mk b/mk/prepare.mk index ae76ecc594ce4..d850aba27cd33 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -86,6 +86,7 @@ PREPARE_TOOLS = $(filter-out compiletest, $(TOOLS)) define DEF_PREPARE_HOST_TOOL prepare-host-tool-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \ $$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \ + $$(HBIN$(2)_H_$(3))/$(1)$$(X_$(3)) \ prepare-host-dirs-$(4) $$(if $$(findstring $(2), $$(PREPARE_STAGE)),\ $$(if $$(findstring $(3), $$(PREPARE_HOST)),\ From ce1e48a52be07f39291848aa17b8666b7165e804 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 25 Mar 2014 21:25:43 -0700 Subject: [PATCH 08/13] install: Support --libdir and --mandir correctly This adds a hack to rustc to make it find the library directory regardless of whether it is named lib/lib64/lib32. --- mk/dist.mk | 3 +- mk/install.mk | 4 +- src/etc/install.sh | 72 +++++++++++++++++++++-------- src/librustc/back/rpath.rs | 17 ++++--- src/librustc/metadata/filesearch.rs | 40 ++++++++++++---- 5 files changed, 98 insertions(+), 38 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 60549e299cce2..10c1636a03a68 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -200,7 +200,8 @@ dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) dist-install-dir-$(1): PREPARE_CLEAN=true dist-install-dir-$(1): prepare-base-dir-$(1) $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \ - > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest + > tmp/manifest-$(1) # NB Use a tmp file so `find` doesn't *find the manifest* + $$(Q)cp tmp/manifest-$(1) $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR) diff --git a/mk/install.mk b/mk/install.mk index 7bae272b47aa9..6545441a405b7 100644 --- a/mk/install.mk +++ b/mk/install.mk @@ -10,10 +10,10 @@ install: dist-install-dir-$(CFG_BUILD) - $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" + $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)" uninstall: dist-install-dir-$(CFG_BUILD) - $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" --uninstall + $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)" ###################################################################### diff --git a/src/etc/install.sh b/src/etc/install.sh index e6d20b932b39e..3ae028d971301 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -213,6 +213,10 @@ VAL_OPTIONS="" flag uninstall "only uninstall from the installation prefix" valopt prefix "/usr/local" "set installation prefix" +# NB This isn't quite the same definition as in `configure`. +# just using 'lib' instead of CFG_LIBDIR_RELATIVE +valopt libdir "${CFG_PREFIX}/lib" "install libraries" +valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH" if [ $HELP -eq 1 ] then @@ -224,39 +228,40 @@ step_msg "validating $CFG_SELF args" validate_opt # Sanity check: can we can write to the destination? -umask 022 && mkdir -p "${CFG_PREFIX}/lib" +umask 022 && mkdir -p "${CFG_LIBDIR}" need_ok "directory creation failed" -touch "${CFG_PREFIX}/lib/rust-install-probe" 2> /dev/null +touch "${CFG_LIBDIR}/rust-install-probe" 2> /dev/null if [ $? -ne 0 ] then err "can't write to destination. try again with 'sudo'." fi -rm "${CFG_PREFIX}/lib/rust-install-probe" +rm "${CFG_LIBDIR}/rust-install-probe" need_ok "failed to remove install probe" +INSTALLED_MANIFEST="${CFG_LIBDIR}/rustlib/manifest" # First, uninstall from the installation prefix. # Errors are warnings - try to rm everything in the manifest even if some fail. -if [ -f "${CFG_PREFIX}/lib/rustlib/manifest" ] +if [ -f "${INSTALLED_MANIFEST}" ] then # Iterate through installed manifest and remove files while read p; do - msg "removing ${CFG_PREFIX}/$p" - if [ -f "${CFG_PREFIX}/$p" ] + # The installed manifest contains absolute paths + msg "removing $p" + if [ -f "$p" ] then - rm "${CFG_PREFIX}/$p" + rm "$p" if [ $? -ne 0 ] then - warn "failed to remove ${CFG_PREFIX}/$p" + warn "failed to remove $p" fi else - warn "supposedly installed file ${CFG_PREFIX}/$p does not exist!" + warn "supposedly installed file $p does not exist!" fi - done < "${CFG_PREFIX}/lib/rustlib/manifest" + done < "${INSTALLED_MANIFEST}" # Remove 'rustlib' directory - msg "removing ${CFG_PREFIX}/lib/rustlib" - rm -r "${CFG_PREFIX}/lib/rustlib" + rm -r "${CFG_LIBDIR}/rustlib" if [ $? -ne 0 ] then warn "failed to remove rustlib" @@ -264,7 +269,7 @@ then else if [ -n "${CFG_UNINSTALL}" ] then - err "unable to find installation manifest at ${CFG_PREFIX}/lib/rustlib" + err "unable to find installation manifest at ${CFG_LIBDIR}/rustlib" fi fi @@ -277,22 +282,53 @@ then exit 0 fi +# Create the installed manifest, which we will fill in with absolute file paths +mkdir -p "${CFG_LIBDIR}/rustlib" +touch "${INSTALLED_MANIFEST}" # Now install, iterate through the new manifest and copy files while read p; do - umask 022 && mkdir -p "${CFG_PREFIX}/$(dirname $p)" + # Decide the destination of the file + FILE_INSTALL_PATH="${CFG_PREFIX}/$p" + + if echo "$p" | grep "^lib/" > /dev/null + then + pp=`echo $p | sed 's/^lib\///'` + FILE_INSTALL_PATH="${CFG_LIBDIR}/$pp" + fi + + if echo "$p" | grep "^share/man/" > /dev/null + then + pp=`echo $p | sed 's/^share\/man\///'` + FILE_INSTALL_PATH="${CFG_MANDIR}/$pp" + fi + + # Make sure ther's a directory for it + umask 022 && mkdir -p "$(dirname ${FILE_INSTALL_PATH})" need_ok "directory creation failed" - msg "${CFG_PREFIX}/$p" - if echo "$p" | grep "/bin/" > /dev/null + # Make the path absolute so we can uninstall it later without + # starting from the installation cwd + FILE_INSTALL_PATH_DIRNAME="$(dirname ${FILE_INSTALL_PATH})" + FILE_INSTALL_PATH_BASENAME="$(basename ${FILE_INSTALL_PATH})" + FILE_INSTALL_ABS_PATH="$(cd ${FILE_INSTALL_PATH_DIRNAME} && pwd)" + FILE_INSTALL_PATH="${FILE_INSTALL_ABS_PATH}/${FILE_INSTALL_PATH_BASENAME}" + + # Install the file + msg "${FILE_INSTALL_PATH}" + if echo "$p" | grep "^bin/" > /dev/null then - install -m755 "${CFG_SRC_DIR}/$p" "${CFG_PREFIX}/$p" + install -m755 "${CFG_SRC_DIR}/$p" "${FILE_INSTALL_PATH}" else - install -m644 "${CFG_SRC_DIR}/$p" "${CFG_PREFIX}/$p" + install -m644 "${CFG_SRC_DIR}/$p" "${FILE_INSTALL_PATH}" fi need_ok "file creation failed" + # Update the manifest + echo "${FILE_INSTALL_PATH}" >> "${INSTALLED_MANIFEST}" + need_ok "failed to update manifest" + # The manifest lists all files to install done < "${CFG_SRC_DIR}/lib/rustlib/manifest" diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs index 08e96ec9215ed..d548dc6dfb78f 100644 --- a/src/librustc/back/rpath.rs +++ b/src/librustc/back/rpath.rs @@ -54,8 +54,9 @@ pub fn get_rpath_flags(sess: &Session, out_filename: &Path) -> Vec<~str> { } fn get_sysroot_absolute_rt_lib(sess: &Session) -> Path { - let r = filesearch::relative_target_lib_path(sess.opts.target_triple); - let mut p = sess.filesearch().sysroot.join(&r); + let sysroot = sess.filesearch().sysroot; + let r = filesearch::relative_target_lib_path(sysroot, sess.opts.target_triple); + let mut p = sysroot.join(&r); p.push(os::dll_filename("rustrt")); p } @@ -91,7 +92,7 @@ fn get_rpaths(os: abi::Os, let abs_rpaths = get_absolute_rpaths(libs); // And a final backup rpath to the global library location. - let fallback_rpaths = vec!(get_install_prefix_rpath(target_triple)); + let fallback_rpaths = vec!(get_install_prefix_rpath(sysroot, target_triple)); fn log_rpaths(desc: &str, rpaths: &[~str]) { debug!("{} rpaths:", desc); @@ -156,10 +157,10 @@ pub fn get_absolute_rpath(lib: &Path) -> ~str { p.as_str().expect("non-utf8 component in rpath").to_owned() } -pub fn get_install_prefix_rpath(target_triple: &str) -> ~str { +pub fn get_install_prefix_rpath(sysroot: &Path, target_triple: &str) -> ~str { let install_prefix = env!("CFG_PREFIX"); - let tlib = filesearch::relative_target_lib_path(target_triple); + let tlib = filesearch::relative_target_lib_path(sysroot, target_triple); let mut path = Path::new(install_prefix); path.push(&tlib); let path = os::make_absolute(&path); @@ -195,7 +196,8 @@ mod test { #[test] fn test_prefix_rpath() { - let res = get_install_prefix_rpath("triple"); + let sysroot = filesearch::get_or_default_sysroot(); + let res = get_install_prefix_rpath(sysroot, "triple"); let mut d = Path::new(env!("CFG_PREFIX")); d.push("lib"); d.push(filesearch::rustlibdir()); @@ -208,7 +210,8 @@ mod test { #[test] fn test_prefix_rpath_abs() { - let res = get_install_prefix_rpath("triple"); + let sysroot = filesearch::get_or_default_sysroot(); + let res = get_install_prefix_rpath(sysroot, "triple"); assert!(Path::new(res).is_absolute()); } diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index df5aa1fe4149b..5a92c48f40043 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -60,7 +60,8 @@ impl<'a> FileSearch<'a> { if !found { let rustpath = rust_path(); for path in rustpath.iter() { - let tlib_path = make_rustpkg_target_lib_path(path, self.target_triple); + let tlib_path = make_rustpkg_target_lib_path( + self.sysroot, path, self.target_triple); debug!("is {} in visited_dirs? {:?}", tlib_path.display(), visited_dirs.contains_equiv(&tlib_path.as_vec().to_owned())); @@ -136,8 +137,8 @@ impl<'a> FileSearch<'a> { } } -pub fn relative_target_lib_path(target_triple: &str) -> Path { - let mut p = Path::new(libdir()); +pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> Path { + let mut p = Path::new(find_libdir(sysroot)); assert!(p.is_relative()); p.push(rustlibdir()); p.push(target_triple); @@ -147,12 +148,13 @@ pub fn relative_target_lib_path(target_triple: &str) -> Path { fn make_target_lib_path(sysroot: &Path, target_triple: &str) -> Path { - sysroot.join(&relative_target_lib_path(target_triple)) + sysroot.join(&relative_target_lib_path(sysroot, target_triple)) } -fn make_rustpkg_target_lib_path(dir: &Path, - target_triple: &str) -> Path { - let mut p = dir.join(libdir()); +fn make_rustpkg_target_lib_path(sysroot: &Path, + dir: &Path, + target_triple: &str) -> Path { + let mut p = dir.join(find_libdir(sysroot)); p.push(target_triple); p } @@ -236,12 +238,30 @@ pub fn rust_path() -> Vec { // The name of the directory rustc expects libraries to be located. // On Unix should be "lib", on windows "bin" #[cfg(unix)] -pub fn libdir() -> ~str { - ~"lib" +fn find_libdir(sysroot: &Path) -> ~str { + // FIXME: This is a quick hack to make the rustc binary able to locate + // Rust libraries in Linux environments where libraries might be installed + // to lib64/lib32. This would be more foolproof by basing the sysroot off + // of the directory where librustc is located, rather than where the rustc + // binary is. + + if sysroot.join(primary_libdir_name()).exists() { + return primary_libdir_name(); + } else { + return secondary_libdir_name(); + } + + #[cfg(target_word_size = "64")] + fn primary_libdir_name() -> ~str { ~"lib64" } + + #[cfg(target_word_size = "32")] + fn primary_libdir_name() -> ~str { ~"lib32" } + + fn secondary_libdir_name() -> ~str { ~"lib" } } #[cfg(windows)] -pub fn libdir() -> ~str { +fn find_libdir(_sysroot: &Path) -> ~str { ~"bin" } From 92d0ec2ec7d71c5e42f6a6682b081b8ef6212913 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 26 Mar 2014 12:06:35 -0700 Subject: [PATCH 09/13] install: name the bundled manifest 'manifest.in'. Cleanup The installed manifest is a different file, so they should have different names. This should prevent various wierd conflicts in the future. --- mk/dist.mk | 6 ++++-- mk/install.mk | 2 ++ src/etc/install.sh | 10 ++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 10c1636a03a68..a2048f7fb8f3a 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -199,9 +199,11 @@ 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-dir-$(1) +# Write the install manifest, making sure the manifest contains itself + $$(Q)touch $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \ - > tmp/manifest-$(1) # NB Use a tmp file so `find` doesn't *find the manifest* - $$(Q)cp tmp/manifest-$(1) $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest + > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in +# Add remaining non-installed files $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR) diff --git a/mk/install.mk b/mk/install.mk index 6545441a405b7..e360afe291b7c 100644 --- a/mk/install.mk +++ b/mk/install.mk @@ -11,6 +11,8 @@ install: dist-install-dir-$(CFG_BUILD) $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)" +# Remove tmp files while we can because they may have been created under sudo + $(Q)rm -R tmp/dist/$(PKG_NAME)-$(CFG_BUILD/ uninstall: dist-install-dir-$(CFG_BUILD) $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)" diff --git a/src/etc/install.sh b/src/etc/install.sh index 3ae028d971301..8bcb04eec903d 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -229,15 +229,16 @@ validate_opt # Sanity check: can we can write to the destination? umask 022 && mkdir -p "${CFG_LIBDIR}" -need_ok "directory creation failed" +need_ok "can't write to destination. consider `sudo`." touch "${CFG_LIBDIR}/rust-install-probe" 2> /dev/null if [ $? -ne 0 ] then - err "can't write to destination. try again with 'sudo'." + err "can't write to destination. consider `sudo`." fi rm "${CFG_LIBDIR}/rust-install-probe" need_ok "failed to remove install probe" +# The file name of the manifest we're going to create during install INSTALLED_MANIFEST="${CFG_LIBDIR}/rustlib/manifest" # First, uninstall from the installation prefix. @@ -267,6 +268,7 @@ then warn "failed to remove rustlib" fi else + # There's no manifest. If we were asked to uninstall, then that's a problem. if [ -n "${CFG_UNINSTALL}" ] then err "unable to find installation manifest at ${CFG_LIBDIR}/rustlib" @@ -304,7 +306,7 @@ while read p; do FILE_INSTALL_PATH="${CFG_MANDIR}/$pp" fi - # Make sure ther's a directory for it + # Make sure there's a directory for it umask 022 && mkdir -p "$(dirname ${FILE_INSTALL_PATH})" need_ok "directory creation failed" @@ -330,7 +332,7 @@ while read p; do need_ok "failed to update manifest" # The manifest lists all files to install -done < "${CFG_SRC_DIR}/lib/rustlib/manifest" +done < "${CFG_SRC_DIR}/lib/rustlib/manifest.in" echo echo " Rust is ready to roll." From c060e2e5154f1a49ebcfa6f2d7b7a4e05f35ab14 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 26 Mar 2014 18:51:55 -0700 Subject: [PATCH 10/13] install: Don't allow installation over the install files --- mk/dist.mk | 5 ++--- src/etc/install.sh | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index a2048f7fb8f3a..92990767d084a 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -199,10 +199,9 @@ 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-dir-$(1) -# Write the install manifest, making sure the manifest contains itself - $$(Q)touch $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \ - > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in + > tmp/dist/manifest-$(1).in + $$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in # Add remaining non-installed files $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR) $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR) diff --git a/src/etc/install.sh b/src/etc/install.sh index 8bcb04eec903d..3a1ba91d01f23 100644 --- a/src/etc/install.sh +++ b/src/etc/install.sh @@ -227,17 +227,29 @@ fi step_msg "validating $CFG_SELF args" validate_opt + +# OK, let's get installing ... + # Sanity check: can we can write to the destination? umask 022 && mkdir -p "${CFG_LIBDIR}" -need_ok "can't write to destination. consider `sudo`." +need_ok "can't write to destination. consider 'sudo'." touch "${CFG_LIBDIR}/rust-install-probe" 2> /dev/null if [ $? -ne 0 ] then - err "can't write to destination. consider `sudo`." + err "can't write to destination. consider 'sudo'." fi rm "${CFG_LIBDIR}/rust-install-probe" need_ok "failed to remove install probe" +# Sanity check: don't install to the directory containing the installer. +# That would surely cause chaos. +INSTALLER_DIR="$(cd $(dirname $0) && pwd)" +PREFIX_DIR="$(cd ${CFG_PREFIX} && pwd)" +if [ "${INSTALLER_DIR}" = "${PREFIX_DIR}" ] +then + err "can't install to same directory as installer" +fi + # The file name of the manifest we're going to create during install INSTALLED_MANIFEST="${CFG_LIBDIR}/rustlib/manifest" From 545f0125272249170b594e9cd42567df51db94aa Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 26 Mar 2014 19:21:23 -0700 Subject: [PATCH 11/13] rustc: Fix detection of lib64 directory Instead of just looking for its presence we need to see if it actually contains rust stuffs. --- src/librustc/metadata/filesearch.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 5a92c48f40043..7aed0e5b7f409 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -245,7 +245,7 @@ fn find_libdir(sysroot: &Path) -> ~str { // of the directory where librustc is located, rather than where the rustc // binary is. - if sysroot.join(primary_libdir_name()).exists() { + if sysroot.join(primary_libdir_name()).join(rustlibdir()).exists() { return primary_libdir_name(); } else { return secondary_libdir_name(); From 6f7ef1e293e2f3a2dba35ff612ac7a4d4b3677d5 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 26 Mar 2014 20:53:01 -0700 Subject: [PATCH 12/13] rustc: Fix tests for sysroot changes --- src/librustc/back/rpath.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs index d548dc6dfb78f..c47f9893cd2ef 100644 --- a/src/librustc/back/rpath.rs +++ b/src/librustc/back/rpath.rs @@ -197,7 +197,7 @@ mod test { #[test] fn test_prefix_rpath() { let sysroot = filesearch::get_or_default_sysroot(); - let res = get_install_prefix_rpath(sysroot, "triple"); + let res = get_install_prefix_rpath(&sysroot, "triple"); let mut d = Path::new(env!("CFG_PREFIX")); d.push("lib"); d.push(filesearch::rustlibdir()); @@ -211,7 +211,7 @@ mod test { #[test] fn test_prefix_rpath_abs() { let sysroot = filesearch::get_or_default_sysroot(); - let res = get_install_prefix_rpath(sysroot, "triple"); + let res = get_install_prefix_rpath(&sysroot, "triple"); assert!(Path::new(res).is_absolute()); } From 0f4f786b6220968a7b29ad2e587f8d7ef70cebcb Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 26 Mar 2014 20:53:57 -0700 Subject: [PATCH 13/13] mk: Use 'find' invocation that works on mac --- mk/dist.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/dist.mk b/mk/dist.mk index 92990767d084a..cd6aedc6e8992 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -199,7 +199,7 @@ 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-dir-$(1) - $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \ + $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \ > tmp/dist/manifest-$(1).in $$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in # Add remaining non-installed files