This commit switches the default build system for Rust from the makefiles to
rustbuild. The rustbuild build system has been in development for almost a year
now and has become quite mature over time. This commit is an implementation of
the proposal on [internals] which slates deletion of the makefiles on
2016-01-02.
[internals]: https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368
This commit also updates various documentation in `README.md`,
`CONTRIBUTING.md`, `src/bootstrap/README.md`, and throughout the source code of
rustbuild itself.
Closes#37858
This commit is a rewrite of the user-facing interface to the rustbuild build
system. The intention here is to make it much easier to compile/test the project
without having to remember weird rule names and such. An overall view of the new
interface is:
# build everything
./x.py build
# document everyting
./x.py doc
# test everything
./x.py test
# test libstd
./x.py test src/libstd
# build libcore stage0
./x.py build src/libcore --stage 0
# run stage1 run-pass tests
./x.py test src/test/run-pass --stage 1
The `src/bootstrap/bootstrap.py` script is now aliased as a top-level `x.py`
script. This `x` was chosen to be both short and easily tab-completable (no
collisions in that namespace!). The build system now accepts a "subcommand" of
what to do next, the main ones being build/doc/test.
Each subcommand then receives an optional list of arguments. These arguments are
paths in the source repo of what to work with. That is, if you want to test a
directory, you just pass that directory as an argument.
The purpose of this rewrite is to do away with all of the arcane renames like
"rpass" is the "run-pass" suite, "cfail" is the "compile-fail" suite, etc. By
simply working with directories and files it's much more intuitive of how to run
a test (just pass it as an argument).
The rustbuild step/dependency management was also rewritten along the way to
make this easy to work with and define, but that's largely just a refactoring of
what was there before.
The *intention* is that this support is extended for arbitrary files (e.g.
`src/test/run-pass/my-test-case.rs`), but that isn't quite implemented just yet.
Instead directories work for now but we can follow up with stricter path
filtering logic to plumb through all the arguments.
The invocation of vcvars is only needed for versions of Visual Studio that
rustbuild or cmake doesn't understand, but if older versions are installed then
there's no need to call vcvars.
Closes#34576
The ./configure command in README.md's Building Documentation section was
missing the $ prefix. Add the prefix to be consistent with other commands in the
document.
The LLVM build system is somewhat picky about which Python is used to build it
as it's known to be incompatible with the default `python2` package that ships
with MinGW. This was previously detected for MSVC builds but the logic was left
out for MinGW by accident (now that we've switched to cmake builds for LLVM
everywhere).
This corrects the `./configure` check and also updates the `README.md`
accordingly. Additionally, a number of instructions were updated to work with
the most recent copy of MSYS2.
Closes#34489
http://mingw-w64.org/doku.php/download/mingw-builds now provides GCC 5.x as a default version, but avoiding 5.x is exactly the reason why Mingw-builds is recommended instead of MSYS2's own mingw toolchain. One of the 4.9.x versions has to manually chosen during installation.
In other words, enforce what was documented in #30626 (and also stop blaming it on LLVM, we have at least one Python script of our own).
Also, there is no Python later than 2.7 and there never will be.
Running `/usr/bin/time -v make` to build rust (using local llvm) shows the maximum memory usage at 715 megabytes on 32-bit x86 (on arm linux it's even less @ 580M).
Reworded according to @brson's input.
This PR adds a note to the end of the Windows build instructions to reflect the issues detailed in #28260, as well as a work around using older versions of gcc. I've avoided going into detail as I did not wish to bloat the README, and so that the changes are easy to yank once the issue is resolved.
Remove leading newlines; replace lines containing only whitespace with empty lines; replace multiple trailing newlines with a single newline; remove trailing whitespace in lines
Encountered an issue going through the guide for installing the `mingw` toolchain on Windows with msys2, after some googling I found the [solution](https://github.com/Alexpux/MSYS2-packages/issues/163#issuecomment-73555971) and thought it would be good to update the README so people don't get frustrated. :)
- Various grammatical changes.
- Use triple-backtick syntax and sh highlighting for code blocks.
- Fix indentation of code block in step 2 of "Building on Windows".
- Use title case for "Getting Help" subheading.
This redux of CONTRIBUTING.md adds in more information, including
subsuming both compliment-bugreport.md and Note-development-policy
in the wiki.
I only glanced at the broad TOC of Note-development-policy, and did
not use the text as the basis for the re-write. This will then address
the last outstanding part of #5831.
There's only one build-critical path in which perl is used, and it was to do a text replacement trivially achievable with sed(1).
I ported the indenter script because it [appears to be used][indenter], but removed check links because it appears to be entirely out of date.
[indenter]: https://github.com/rust-lang/rust/blob/master/src/librustc/util/common.rs#L60-70
This pulls all of our long-form documentation into a single document,
nicknamed "the book" and formally titled "The Rust Programming
Language."
A few things motivated this change:
* People knew of The Guide, but not the individual Guides. This merges
them together, helping discoverability.
* You can get all of Rust's longform documentation in one place, which
is nice.
* We now have rustbook in-tree, which can generate this kind of
documentation. While its style is basic, the general idea is much
better: a table of contents on the left-hand side.
* Rather than a almost 10,000-line guide.md, there are now smaller files
per section.
The Windows-specific instruction under 'Quick Start' linked the wiki article on getting started developing Rust itself, but the quick start is just about obtaining a working Rust installation. The actual wiki page with Windows-specific instructions was difficult to find.
The most important thing to note on Windows is that you need mingw-builds, and it is totally not obvious. The only place where I have seen it mentioned is the wiki page, which was difficult to find before.
The Windows-specific instruction under 'Quick Start' linked the wiki article on getting started developing Rust itself, but the quick start is just about obtaining a working Rust installation. The actual wiki page with Windows-specific instructions was difficult to find.
The Guide isn't 100% perfect, but it's basically complete. It's
certainly better than the tutorial is. Time to start pointing more
people its way.
I also just made it consistent to call all things 'guides' rather than
tutorials.
Fixes#9874. This is the big one.
And two bugs that just go away.
Fixes#14503.
Fixes#15009.
Update the instructions to reflect that we have binary installers for all
supported platforms, and move the building from source directions into a
dedicated "Building from Source" directory.