706be5ba1f
Builds on my [feature staging PR](https://github.com/rust-lang/rust/pull/21248) to clean up the tidy scripts a bit, and make them much faster (6s vs ~40s). Adds make rules 'tidy-basic', 'tidy-binaries', 'tidy-errors' and 'tidy-features'. This is the output of `make tidy` here: ``` cfg: version 1.0.0-dev (a8c878d41 2015-01-25 01:49:14 -0800) cfg: build triple x86_64-unknown-linux-gnu cfg: host triples x86_64-unknown-linux-gnu cfg: target triples x86_64-unknown-linux-gnu cfg: host for x86_64-unknown-linux-gnu is x86_64 cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu cfg: good valgrind for x86_64-unknown-linux-gnu is 1 cfg: using CC=gcc (CFG_CC) cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS) cfg: valgrind-rpass command set to "/usr/bin/valgrind" --error-exitcode=100 --soname-synonyms=somalloc=NONE --quiet --suppressions=/home/brian/dev/rust3/src/etc/x86.supp --tool=memcheck --leak-check=full cfg: no lualatex found, deferring to xelatex cfg: no xelatex found, deferring to pdflatex cfg: no pdflatex found, disabling LaTeX docs cfg: no pandoc found, omitting PDF and EPUB docs cfg: including test rules cfg: javac not available, skipping lexer test... check: formatting * linted .rs files: 4948 * linted .py files: 27 * linted .js files: 2 * linted .sh files: 5 * linted .pl files: 0 * linted .c files: 28 * linted .h files: 3 * other linted files: 0 * total lines of code: 481217 * total non-blank lines of code: 423682 check: binaries check: extended errors * 249 error codes * highest error code: E0315 check: feature sanity * advanced_slice_patterns lang unstable None * alloc lib unstable None * asm lang unstable None * associated_types lang stable 1.0.0 * box_syntax lang unstable None * collections lib unstable None * concat_idents lang unstable None * core lib unstable None * default_type_params lang stable 1.0.0 * globs lang stable 1.0.0 * hash lib unstable None * if_let lang stable 1.0.0 * import_shadowing lang unstable None * int_uint lang unstable None * intrinsics lang unstable None * io lib unstable None * issue_5723_bootstrap lang stable 1.0.0 * lang_items lang unstable None * link_args lang unstable None * link_llvm_intrinsics lang unstable None * linkage lang unstable None * log_syntax lang unstable None * macro_rules lang stable 1.0.0 * main lang unstable None * managed_boxes lang unstable None * non_ascii_idents lang unstable None * old_impl_check lang unstable None * old_orphan_check lang unstable None * on_unimplemented lang unstable None * opt_out_copy lang unstable None * optin_builtin_traits lang unstable None * os lib unstable None * path lib unstable None * phase lang unstable None * plugin lang unstable None * plugin_registrar lang unstable None * quad_precision_float lang unstable None * quote lang unstable None * rand lib unstable None * rust1 lib stable 1.0.0 * rustc_diagnostic_macros lang unstable None * rustc_private lib unstable None * rustdoc lib unstable None * simd lang unstable None * simd_ffi lang unstable None * slicing_syntax lang unstable None * staged_api lang unstable None * start lang unstable None * std_misc lib unstable None * struct_inherit lang unstable None * struct_variant lang stable 1.0.0 * test lib unstable None * test_accepted_feature lang stable 1.0.0 * test_removed_feature lang unstable None * thread_local lang unstable None * trace_macros lang unstable None * tuple_indexing lang stable 1.0.0 * unboxed_closures lang unstable None * unicode lib unstable None * unsafe_destructor lang unstable None * visible_private_types lang unstable None * while_let lang stable 1.0.0 ``` There's a lot of informational output now, which comes after things like 'NOTE's. |
||
---|---|---|
man | ||
mk | ||
src | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
.travis.yml | ||
AUTHORS.txt | ||
configure | ||
CONTRIBUTING.md | ||
COPYRIGHT | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
Makefile.in | ||
README.md | ||
RELEASES.md |
The Rust Programming Language
This is a compiler for Rust, including standard libraries, tools and documentation.
Quick Start
- Download a binary installer for your platform.
- Read The Rust Programming Language.
- Enjoy!
Note: Windows users can read the detailed using Rust on Windows notes on the wiki.
Building from Source
-
Make sure you have installed the dependencies:
g++
4.7 orclang++
3.xpython
2.6 or later (but not 3.x)- GNU
make
3.81 or later curl
git
-
Download and build Rust:
You can either download a tarball or build directly from the repo.
To build from the tarball do:
$ curl -O https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz $ tar -xzf rustc-nightly-src.tar.gz $ cd rustc-nightly
Or to build from the repo do:
$ git clone https://github.com/rust-lang/rust.git $ cd rust
Now that you have Rust's source code, you can configure and build it:
$ ./configure $ make && make install
Note: You may need to use
sudo make install
if you do not normally have permission to modify the destination directory. The install locations can be adjusted by passing a--prefix
argument toconfigure
. Various other options are also supported, pass--help
for more information on them.When complete,
make install
will place several programs into/usr/local/bin
:rustc
, the Rust compiler, andrustdoc
, the API-documentation tool. -
Enjoy!
Building on Windows
To easily build on windows we can use MSYS2:
- Grab the latest MSYS2 installer and go through the installer.
- Now from the MSYS2 terminal we want to install the mingw64 toolchain and the other tools we need.
# choose one based on platform
$ pacman -S mingw-w64-i686-toolchain
$ pacman -S mingw-w64-x86_64-toolchain
$ pacman -S base-devel
-
With that now start
mingw32_shell.bat
ormingw64_shell.bat
from where you installed MSYS2 (i.e.C:\msys
). Which one you choose depends on if you want 32 or 64 bit Rust. -
From there just navigate to where you have Rust's source code, configure and build it:
$ ./configure $ make && make install
Notes
Since the Rust compiler is written in Rust, it must be built by a precompiled "snapshot" version of itself (made in an earlier state of development). As such, source builds require a connection to the Internet, to fetch snapshots, and an OS that can execute the available snapshot binaries.
Snapshot binaries are currently built and tested on several platforms:
- Windows (7, 8, Server 2008 R2), x86 and x86-64 (64-bit support added in Rust 0.12.0)
- Linux (2.6.18 or later, various distributions), x86 and x86-64
- OSX 10.7 (Lion) or greater, x86 and x86-64
You may find that other platforms work, but these are our officially supported build environments that are most likely to work.
Rust currently needs about 1.5 GiB of RAM to build without swapping; if it hits swap, it will take a very long time to build.
There is a lot more documentation in the wiki.
Getting help and getting involved
The Rust community congregates in a few places:
- StackOverflow - Direct questions about using the language here.
- users.rust-lang.org - General discussion, broader questions.
- internals.rust-lang.org - For development of the Rust language itself.
- /r/rust - News and general discussion.
License
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.