Skip to content

Commit 97503e1

Browse files
committed
Rollup merge of rust-lang#22256 - brson:installer-next, r=alexcrichton
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
2 parents 16b24f1 + 9df38bf commit 97503e1

File tree

4 files changed

+17
-25
lines changed

4 files changed

+17
-25
lines changed

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,10 @@ documentation.
55

66
## Quick Start
77

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

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

1913
## Building from Source
2014

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

5850
### Building on Windows
5951

@@ -81,7 +73,6 @@ $ pacman -S base-devel
8173

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

8677
## Notes
8778

mk/dist.mk

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ distcheck-tar-src: dist-tar-src
109109
# Unix binary installer tarballs
110110
######################################################################
111111

112-
NON_INSTALLED_PREFIXES=COPYRIGHT,LICENSE-APACHE,LICENSE-MIT,README.md,version
113-
114112
define DEF_INSTALLER
115113

116114
$$(eval $$(call DEF_PREPARE,dir-$(1)))
@@ -124,19 +122,23 @@ dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
124122
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
125123
dist-install-dir-$(1): PREPARE_CLEAN=true
126124
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
127-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
128-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
129-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
130-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
131125
$$(Q)mkdir -p $$(PREPARE_DEST_DIR)/share/doc/rust
132126
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)/share/doc/rust
133127
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)/share/doc/rust
134128
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)/share/doc/rust
135129
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)/share/doc/rust
130+
131+
prepare-overlay-$(1):
132+
$$(Q)rm -Rf tmp/dist/$$(PKG_NAME)-$(1)-overlay
133+
$$(Q)mkdir -p tmp/dist/$$(PKG_NAME)-$(1)-overlay
134+
$$(Q)cp $$(S)COPYRIGHT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
135+
$$(Q)cp $$(S)LICENSE-APACHE tmp/dist/$$(PKG_NAME)-$(1)-overlay/
136+
$$(Q)cp $$(S)LICENSE-MIT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
137+
$$(Q)cp $$(S)README.md tmp/dist/$$(PKG_NAME)-$(1)-overlay/
136138
# This tiny morsel of metadata is used by rust-packaging
137-
$$(Q)echo "$(CFG_VERSION)" > $$(PREPARE_DEST_DIR)/version
139+
$$(Q)echo "$(CFG_VERSION)" > tmp/dist/$$(PKG_NAME)-$(1)-overlay/version
138140

139-
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
141+
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1) prepare-overlay-$(1)
140142
@$(call E, build: $$@)
141143
# Copy essential gcc components into installer
142144
ifdef CFG_WINDOWSY_$(1)
@@ -146,13 +148,12 @@ ifdef CFG_WINDOWSY_$(1)
146148
endif
147149
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
148150
--product-name=Rust \
149-
--verify-bin=rustc \
150151
--rel-manifest-dir=rustlib \
151152
--success-message=Rust-is-ready-to-roll. \
152153
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
153154
--work-dir=tmp/dist \
154155
--output-dir=dist \
155-
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
156+
--non-installed-overlay=tmp/dist/$$(PKG_NAME)-$(1)-overlay \
156157
--package-name=$$(PKG_NAME)-$(1) \
157158
--component-name=rustc \
158159
--legacy-manifest-dirs=rustlib,cargo

src/doc/trpl/installing-rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ installer](https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.
2424
and run it.
2525

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

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

3434
If you used the Windows installer, just re-run the `.exe` and it will give you

0 commit comments

Comments
 (0)