Skip to content

Installing-rust proposed changes #24400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 106 additions & 50 deletions src/doc/trpl/installing-rust.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,133 @@
% Installing Rust

The first step to using Rust is to install it! There are a number of ways to
install Rust, but the easiest is to use the `rustup` script. If you're on Linux
or a Mac, all you need to do is this (note that you don't need to type in the
`$`s, they just indicate the start of each command):
install Rust, but first we ought to go over the officially supported architecture's.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not have the apostrophe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally sold on putting this first, but I'm also not against it exactly. Hm.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Steve! I put it this way because I think the first question one might ask when looking through product documentation is "Will Rust work for me?" I think setting the scope of things currently supported is a good place to start the conversation, if I was trying to sell Rust I would start by saying how it already works with what folks have and why it not only augments but streamlines their current production environment. It's only in this order for that sort of anecdotal reason.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that's reasonable.


```bash
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh
```
* Windows (7, 8, Server 2008 R2)***
* Linux (2.6.18 or later, various distributions), x86 and x86-64
* OSX 10.7 (Lion) or greater, x86 and x86-64

If you're concerned about the [potential insecurity][insecurity] of using `curl
| sudo sh`, please keep reading and see our disclaimer below. And feel free to
use a two-step version of the installation and examine our installation script:
We extensively test Rust on these platforms, there are plans to support Android
in the future, that documentation will be public as it becomes available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to mention Android, we should elaborate on other stuff too, like the BSDs, and iOS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steveklabnik perhaps just "there are plans to support additional platforms in the future", since that leaves the door open for whatever we decide to support, (plus is shorter as well)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not specifying seems better. Maybe a mention that there are other platforms with community support is a good way to put it too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, my suggestion would be something along the lines of "We extensively test Rust on these platforms and have plans to officially support additional ones in the future, however there is community support for running Rust on...(BSDs etc.)...already"


```bash
$ curl -f -L https://static.rust-lang.org/rustup.sh -O
$ sudo sh rustup.sh
```
***Rust considers Windows to be a first-class platform upon release, but if we're
truly honest, the Windows experience isn't as integrated as the Linux/OS X experience is.
Each and every commit is tested against Windows just like any other platform, if anything
does not work it is a bug. Please let us know if you encounter one we'll squash it for you.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bolding is the wrong call here, and it also isn't closed, which bolsd everything else.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know *** would bold, it's only supposed to be a "read me" after the above paragraph, it should be one of those little crosses.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh yeah markdown doesn't really have built in footnotes :(


[insecurity]: http://curlpipesh.tumblr.com
Rust also installs a copy of the documentation locally, so you can
read it offline. On UNIX systems, `/usr/local/share/doc/rust` is the location.
On Windows, it's in a `share/doc` directory, inside wherever you installed Rust
to.(Default C:\Program Files\Rust beta 1.0\ )

If you're on Windows, please download either the [32-bit installer][win32] or
the [64-bit installer][win64] and run it.

[win32]: https://static.rust-lang.org/dist/rust-1.0.0-beta-i686-pc-windows-gnu.msi
[win64]: https://static.rust-lang.org/dist/rust-1.0.0-beta-x86_64-pc-windows-gnu.msi

If you would like to build from source, please check out the
documentation on [building Rust from Source][from source], there is always [the official
binary downloads][install page] as well.

[from source]: https://github.com/rust-lang/rust#building-from-source
[install page]: http://www.rust-lang.org/install.html

If you're on Linux or Mac rust has a tool called ['multirust'](https://github.com/brson/multirust/README.md) for managing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does @brson want multirust to be in this big of a spotlight yet?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not my place to say but I really think it's quite a lot better than the other command used to install. If it's stable but not feature complete my vote(do I get a vote?) is to include it. I think multirust is an amazing tool, since there is not apt-get rust it really is the forerunner for version and package management, at least on linux. IMHO it's very good. I will fill the ./multirust_advsetup.md if @brson is alright with it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love multirust too, but if it's not production ready yet, I want to give it time to bake first, you know?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This close to release far be it from me to tell you what to do :) I leave it up to the powers that be to decide the fate of this diff, it's hardly 1.0 critical.

Rust, Cargo, and multiple custom toolchains; mappable to any working directory. Multirust is still a work in progress
and is not a part of Rust:master.(Yet)

Rust is signed with a [PGPKey](../trpl/pgp.key)!

To install 'multirust' from Github first move to your project directory.

````bash
$ cd /home/$usr/rust/
```
Next we'll want to get the sourcecode from Github.

```bash
$ git clone --recursive https://github.com/brson/multirust
```

We will then move to the new multirust directory.

```bash
$ cd ./rust/multirust
```

Now we will initialize the submodule

```bash
$ git submodule update --init
```

And finally we will install 'multirust' which will handle the installation of Rust and Cargo!
(This step will require your root password)

```bash
./build.sh && sudo ./install.sh
```
See [multirust](../doc/trpl/multirust_advsetup.md) advanced setup for toolchain configuration options and everything you ever wanted to know and more about multirust.

Otherwise if you are working on your own machine and trust the development team.

Install multirust via

```bash
$ sudo curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh
```
Or Rust proper (minus multirust)

```bash
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh
```

## Uninstalling

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 run the uninstall
script:
If you decide you don't want Rust anymore, we'll make sure to keep your seat warm until you get back.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! :D


If you used the Windows installer, just re-run the `.msi` and it will give you an uninstall option.

If you maintain your Rust installation via multirust uninstall is simple.

```bash
$ sudo ./install.sh --uninstall
```
Note: If you added additional install options as described on the [multirust](../doc/trpl/multirust_advsetup.md)
page you will want to see that same page for the additional uninstallation options.

If you did not use multirust the command is

```bash
$ sudo /usr/local/lib/rustlib/uninstall.sh
```

If you used the Windows installer, just re-run the `.msi` and it will give you
an uninstall option.
##Installation test and Upgrade!

Some people, and somewhat rightfully so, get very upset when we tell you to
`curl | sudo sh`. Basically, when you do this, you are trusting that the good
people who maintain Rust aren't going to hack your computer and do bad things.
That's a good instinct! If you're one of those people, please check out the
documentation on [building Rust from Source][from source], or [the official
binary downloads][install page]. And we promise that this method will not be
the way to install Rust forever: it's just the easiest way to keep people
updated while Rust is in its alpha state.
Upgrading to the latest nightly is easy!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We put nightly instructions in the unstable section of the guide, so this shoulnd't be here


[from source]: https://github.com/rust-lang/rust#building-from-source
[install page]: http://www.rust-lang.org/install.html
For multirust:

Oh, we should also mention the officially supported platforms:
```bash
$ multirust upgrade nightly
```
Note: We recommend the beta unless you absolutely need features in the nightly.

* Windows (7, 8, Server 2008 R2)
* Linux (2.6.18 or later, various distributions), x86 and x86-64
* OSX 10.7 (Lion) or greater, x86 and x86-64
For source/direct installation upgrades

We extensively test Rust on these platforms, and a few others, too, like
Android. But these are the ones most likely to work, as they have the most
testing.
```bash
#Hopefully deprecated by launch
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh
```
If you didn't install multirust and want to get the current nightly.
(Please just get multirust instead of doing this, it will make it way simpler to debug when you can cross compile with different versions of nightlies.)

Finally, a comment about Windows. Rust considers Windows to be a first-class
platform upon release, but if we're honest, the Windows experience isn't as
integrated as the Linux/OS X experience is. We're working on it! If anything
does not work, it is a bug. Please let us know if that happens. Each and every
commit is tested against Windows just like any other platform.
```bash
$ curl -sf -L https://static.rustlang.org/rustup.sh | sudo sh -s -- --channel=nightly
```

If you've got Rust installed, you can open up a shell, and type this:
To test if installation was successful use:

```bash
$ rustc --version
Expand All @@ -79,20 +139,16 @@ You should see the version number, commit hash, commit date and build date:
rustc 1.0.0-beta (9854143cb 2015-04-02) (built 2015-04-02)
```

If you did, Rust has been installed successfully! Congrats!

This installer also installs a copy of the documentation locally, so you can
read it offline. On UNIX systems, `/usr/local/share/doc/rust` is the location.
On Windows, it's in a `share/doc` directory, inside wherever you installed Rust
to.
If you did, Rust has been installed successfully! Yay!

If not, there are a number of places where you can get help. The easiest is
[the #rust IRC channel on irc.mozilla.org][irc], which you can access through
[Mibbit][mibbit]. Click that link, and you'll be chatting with other Rustaceans
(a silly nickname we call ourselves), and we can help you out. Other great
resources include [the user’s forum][users], and [Stack Overflow][stack
overflow].
resources include [the user’s forum][users], [Stack Overflow][stackoverflow],
and [Reddit][reddit]. Project specific IRC channels can be found in the reddit sidebar.

[reddit]: http://www.reddit.com/r/rust
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically left Reddit out.

[irc]: irc://irc.mozilla.org/#rust
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
[users]: http://users.rust-lang.org/
Expand Down
1 change: 1 addition & 0 deletions src/doc/trpl/multirust_advancedsetup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Placeholder file
85 changes: 85 additions & 0 deletions src/doc/trpl/pgp.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
-----BEGIN PG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