Skip to content

Commit

Permalink
Rollup merge of rust-lang#22256 - brson:installer-next, r=alexcrichton
Browse files Browse the repository at this point in the history
 Highlights:

* Adds an 'uninstall.sh' script to `/usr/local/lib/rustlib/uninstall.sh`, the path to which is printed during installation.
* Components can be deselected during install, like `install.sh --without=rust-docs`.
* Components can be listed with `install.sh --list-components`.
* Vastly reduces spew during install (but supporting a `--verbose` option).

Typicall install run looks like:

```
brian@brianX1:~/dev/multirust⟫ sudo ./install.sh
[sudo] password for brian:
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'cargo'
install: installing component 'rust-docs'

    Rust is ready to roll.
```

Needs to be merged right before corresponding PRs to cargo and rust-packaging.

Fixes rust-lang#21117
Fixes rust-lang#20283
  • Loading branch information
Manishearth committed Feb 15, 2015
2 parents 16b24f1 + 9df38bf commit 97503e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ documentation.

## Quick Start

1. Download a [binary installer][installer] for your platform.
2. Read [The Rust Programming Language][trpl].
3. Enjoy!
Read ["Installing Rust"][install] from [The Book][trpl].

> ***Note:*** Windows users can read the detailed
> [using Rust on Windows][win-wiki] notes on the wiki.
[installer]: http://www.rust-lang.org/install.html
[install]: http://doc.rust-lang.org/book/installing-rust.html
[trpl]: http://doc.rust-lang.org/book/index.html
[win-wiki]: https://github.com/rust-lang/rust/wiki/Using-Rust-on-Windows

## Building from Source

Expand Down Expand Up @@ -52,8 +46,6 @@ documentation.
When complete, `make install` will place several programs into
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
API-documentation tool.
3. Read [The Rust Programming Language][trpl].
4. Enjoy!

### Building on Windows

Expand Down Expand Up @@ -81,7 +73,6 @@ $ pacman -S base-devel

[repo]: https://github.com/rust-lang/rust
[tarball]: https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
[trpl]: http://doc.rust-lang.org/book/index.html

## Notes

Expand Down
21 changes: 11 additions & 10 deletions mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ distcheck-tar-src: dist-tar-src
# Unix binary installer tarballs
######################################################################

NON_INSTALLED_PREFIXES=COPYRIGHT,LICENSE-APACHE,LICENSE-MIT,README.md,version

define DEF_INSTALLER

$$(eval $$(call DEF_PREPARE,dir-$(1)))
Expand All @@ -124,19 +122,23 @@ 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) docs compiler-docs
$$(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)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
$$(Q)mkdir -p $$(PREPARE_DEST_DIR)/share/doc/rust
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)/share/doc/rust
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)/share/doc/rust
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)/share/doc/rust
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)/share/doc/rust

prepare-overlay-$(1):
$$(Q)rm -Rf tmp/dist/$$(PKG_NAME)-$(1)-overlay
$$(Q)mkdir -p tmp/dist/$$(PKG_NAME)-$(1)-overlay
$$(Q)cp $$(S)COPYRIGHT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
$$(Q)cp $$(S)LICENSE-APACHE tmp/dist/$$(PKG_NAME)-$(1)-overlay/
$$(Q)cp $$(S)LICENSE-MIT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
$$(Q)cp $$(S)README.md tmp/dist/$$(PKG_NAME)-$(1)-overlay/
# This tiny morsel of metadata is used by rust-packaging
$$(Q)echo "$(CFG_VERSION)" > $$(PREPARE_DEST_DIR)/version
$$(Q)echo "$(CFG_VERSION)" > tmp/dist/$$(PKG_NAME)-$(1)-overlay/version

dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1) prepare-overlay-$(1)
@$(call E, build: $$@)
# Copy essential gcc components into installer
ifdef CFG_WINDOWSY_$(1)
Expand All @@ -146,13 +148,12 @@ ifdef CFG_WINDOWSY_$(1)
endif
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
--product-name=Rust \
--verify-bin=rustc \
--rel-manifest-dir=rustlib \
--success-message=Rust-is-ready-to-roll. \
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
--work-dir=tmp/dist \
--output-dir=dist \
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
--non-installed-overlay=tmp/dist/$$(PKG_NAME)-$(1)-overlay \
--package-name=$$(PKG_NAME)-$(1) \
--component-name=rustc \
--legacy-manifest-dirs=rustlib,cargo
Expand Down
6 changes: 3 additions & 3 deletions src/doc/trpl/installing-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ installer](https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.
and run it.

If you decide you don't want Rust anymore, we'll be a bit sad, but that's okay.
Not every programming language is great for everyone. Just pass an argument to
the script:
Not every programming language is great for everyone. Just run the uninstall
script:

```bash
$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh -s -- --uninstall
$ sudo /usr/local/lib/rustlib/uninstall.sh
```

If you used the Windows installer, just re-run the `.exe` and it will give you
Expand Down
2 changes: 1 addition & 1 deletion src/rust-installer

0 comments on commit 97503e1

Please sign in to comment.