Commit Graph

141 Commits

Author SHA1 Message Date
Josh Stone df0466d0bb Rebase to the llvm-project monorepo
The new git submodule src/llvm-project is a monorepo replacing src/llvm
and src/tools/{clang,lld,lldb}.  This also serves as a rebase for these
projects to the new 8.x branch from trunk.

The src/llvm-emscripten fork is unchanged for now.
2019-01-25 15:39:54 -08:00
lenoil98 c2863dd1b4
Update bootstrap.py
Add PowerPC64 support on FreeBSD
2019-01-17 13:20:00 -05:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Matthias Krüger 49eb1e5419 x.py: fixup 6130fc884b
./x.py used to automatically check out the right commit when a submodule was outdated and ./x.py build was run
and submodules handling was enabled in config.toml (submodules = true).

But it threw an error:
[...]
failed to run: git submodule -q sync --progress src/tools/clippy

The commit removes the --progress from git submodule call.

Fixes #57080
2018-12-24 20:23:00 +01:00
Clar Fon 6130fc884b Add --progress to git submodule commands 2018-12-17 17:19:22 -05:00
Eduard-Mihai Burtescu 7c166f54b2 Move Cargo.{toml,lock} to the repository root directory. 2018-11-22 12:10:04 +02:00
Dan Robertson c211238180
Fix TLS errors when downloading stage0 2018-11-12 02:35:44 +00:00
Alex Crichton 61e89446ef Remove all jemalloc-related content
This commit removes all jemalloc related submodules, configuration, etc,
from the bootstrap, from the standard library, and from the compiler.
This will be followed up with a change to use jemalloc specifically as
part of rustc on blessed platforms.
2018-11-02 06:52:56 -07:00
Marc-Antoine Perennou bc87c71d86 rustbuild: use configured linker to build boostrap
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-10-26 10:18:48 +02:00
Matthias Krüger 4972beaf65 fix typos in various places 2018-10-23 15:56:25 +02:00
Collins Abitekaniza f9375674df allow use of ./x.py help <cmd> ... 2018-10-01 04:06:58 +03:00
Tom Tromey 6e3a4f4ddd Add lldb to the build
This optionally adds lldb (and clang, which it needs) to the build.

Because rust uses LLVM 7, and because clang 7 is not yet released, a
recent git master version of clang is used.

The lldb that is used includes the Rust plugin.

lldb is only built when asked for, or when doing a nightly build on
macOS.  Only macOS is done for now due to difficulties with the Python
dependency.
2018-08-14 18:59:23 -06:00
kennytm 2994b27e40
Add timeout to use of `curl` in bootstrap.py. 2018-07-30 12:06:22 +08:00
NODA, Kai 97d0bc3f04
bootstrap: our best to achieve atomic rename on Win32
This is a tricky operation to implement on Win32; see
https://ci.appveyor.com/project/nodakai/python-win-behavior

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2018-07-10 22:50:20 +08:00
NODA, Kai bcb8a06ef7 bootstrap: write texts to a .tmp file first for atomicity
If you are using a hard-linked file as your config.toml, this change will affect the way other instances of the file is modified.
The original version would modify all other instances whereas the new version will leave others unchanged, reducing the ref count by one.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2018-07-10 22:50:00 +08:00
Nikolai Merinov ddc1d29442 bootstrap: tests should use rustc from config.toml
Tests should always use "rustc" and "cargo" from config.toml instead
of assuming that stage0 binaries was downloaded to build directory.
2018-07-02 21:28:58 +05:00
Oliver Schneider 824c5dfa61 Also run the bootstrap in bootstrap mode 2018-07-01 01:50:12 +02:00
Johannes Nixdorf bcab14af3e bootstrap.py: respect crt-static
Bootstrap requires serde_derive, which needs proc-macro crate types, so
it won't work with crt-static.
2018-05-31 12:01:50 +02:00
Alex Crichton acc874fbcd Revert "bootstrap.py: respect crt-static"
This reverts commit 5ecf29df05.
2018-05-17 10:37:22 -07:00
Johannes Nixdorf 5ecf29df05 bootstrap.py: respect crt-static
Bootstrap requires serde_derive, which needs proc-macro crate types, so
it won't work with crt-static.
2018-04-29 11:30:56 +02:00
Tatsuyuki Ishi 4c51d47269
bootstrap: Remove the fast path
This is rarely noticed, but when you have old submodules, not updating them will cause you run into https://github.com/rust-lang/cargo/issues/4678.
2018-04-06 16:23:53 +09:00
Mark Simulacrum 84b5b34021 Stop accessing current_dir in bootstrap
This ensures that the working directory of rustbuild has no effect on
it's run; since tests will run with a different cwd this is required for
consistent behavior.
2018-04-03 11:39:15 -06:00
Petr Hosek a24811e15a Handle fast-submodules option correctly
This option was introduced in 72cb109bec, but it uses two different
spellings (fast-submodule vs fast-submodules) and isn't handled by
Rust bootstrap which means that any attempt to set this flag fails.
2018-03-30 16:42:57 -07:00
kennytm c78426bfc8
Rollup merge of #49057 - Zoxc:fast-submodules, r=alexcrichton
Faster submodule updating

For the common case when there are no submodules which need updating, this takes 0.48 seconds instead of 47 seconds.

r? @alexcrichton
2018-03-17 17:20:46 +08:00
comex ec49234f44 Support extra-verbose builds:
- The bootstrap crate currently passes -v to Cargo if itself invoked
with -vv.  But Cargo supports -vv (to show build script output), so make
bootstrap pass that if itself invoked with -vvv.  (More specifically,
pass N '-v's to Cargo if invoked with N+1 of them.)

- bootstrap.py currently tries to pass on up to two '-v's to cargo when
building bootstrap, but incorrectly ('-v' is marked as 'store_true', so
argparse stores either False or True, ignoring multiple '-v's).  Fix
this, allow passing any number of '-v's, and make it consistent with
bootstrap's invocation of Cargo (i.e. subtract one from the number of
'-v's).

- Also improve bootstrap.py's config.toml 'parsing' to support arbitrary
verbosity levels, + allow command line to override it.
2018-03-15 17:17:10 -07:00
John Kåre Alsaker 72cb109bec Faster submodule updating 2018-03-15 21:12:25 +01:00
Alex Crichton d69b24805b rust: Import LLD for linking wasm objects
This commit imports the LLD project from LLVM to serve as the default linker for
the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently
removed along with "binaryen linker" support in rustc.

Moving to LLD brings with it a number of benefits for wasm code:

* LLD is itself an actual linker, so there's no need to compile all wasm code
  with LTO any more. As a result builds should be *much* speedier as LTO is no
  longer forcibly enabled for all builds of the wasm target.
* LLD is quickly becoming an "official solution" for linking wasm code together.
  This, I believe at least, is intended to be the main supported linker for
  native code and wasm moving forward. Picking up support early on should help
  ensure that we can help LLD identify bugs and otherwise prove that it works
  great for all our use cases!
* Improvements to the wasm toolchain are currently primarily focused around LLVM
  and LLD (from what I can tell at least), so it's in general much better to be
  on this bandwagon for bugfixes and new features.
* Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD
  will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which
  means a postprocessor is no longer needed to show off Rust's "small wasm
  binary size".

LLD is added in a pretty standard way to rustc right now. A new rustbuild target
was defined for building LLD, and this is executed when a compiler's sysroot is
being assembled. LLD is compiled against the LLVM that we've got in tree, which
means we're currently on the `release_60` branch, but this may get upgraded in
the near future!

LLD is placed into rustc's sysroot in a `bin` directory. This is similar to
where `gcc.exe` can be found on Windows. This directory is automatically added
to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd`
linker which implements the interface that `wasm-ld`, LLD's frontend, expects.

Like Emscripten the LLD target is currently only enabled for Tier 1 platforms,
notably OSX/Windows/Linux, and will need to be installed manually for compiling
to wasm on other platforms. LLD is by default turned off in rustbuild, and
requires a `config.toml` option to be enabled to turn it on.

Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD
has a native option for controlling this.

[gc]: https://reviews.llvm.org/D42511
2018-03-03 20:21:35 -08:00
kennytm fb411d86c6
Rollup merge of #48637 - segevfiner:restore-rust-mingw-download, r=alexcrichton
Restore the download of rust-mingw

The build might otherwise break due to mixing MinGW object files from rust-std and the local MinGW which might be newer/older than the version used to build rust-std.

Fixes #48272

r? @alexcrichton
2018-03-03 18:45:47 +08:00
kennytm 14b6262fde
Rollup merge of #48569 - Phlosioneer:x-py-help-optimization, r=petrochenkov
Improve --help performance for x.py

Since compiling the bootstrap command doesn't require any submodules,
we can skip updating submodules when a --help command is passed in.
On my machine, this saves 1 minute if the submodules are already
downloaded, and 10 minutes if run on a clean repo.

This commit also adds a message before compiling/downloading anything
when a --help command is passed in, to tell the user WHY --help
takes so long to complete. It also points the user to the bootstrap
README.md for faster help.

Finally, this fixes one warning message that still referenced using
make instead of x.py, even though x.py is now the standard way of
building rust.

Closes #37305
2018-03-03 18:45:45 +08:00
Phlosioneer 2269ff521f Remove print_what_bootstrap_means
It was an existing solution to tell the user why a --help command
takes a long time to process. However, it would only print if the
stage0 rust compiler needed to be downloaded, it came after
update_submodules (which took a long time), and it was immediately
followed by download messages and loading bars, meaning users could
easily gloss over the message.

This commit also moves the help message out of main(), and instead
puts it at the top of bootstrap(). main() is intended to be minimal,
only handling error messages.
2018-03-02 03:29:35 -05:00
Segev Finer 5332d9a8e8 Document why we download rust-mingw 2018-03-01 18:33:14 +02:00
Segev Finer 39d0b054ce Restore the download of rust-mingw
The build might otherwise break due to mixing MinGW object files from
rust-std and the local MinGW which might be newer/older than the version
used to build rust-std.

Fixes #48272
2018-03-01 15:20:07 +02:00
Phlosioneer ffb6291cd0 Improve --help performance for x.py
Since compiling the bootstrap command doesn't require any submodules,
we can skip updating submodules when a --help command is passed in.
On my machine, this saves 1 minute if the submodules are already
downloaded, and 10 minutes if run on a clean repo.

This commit also adds a message before compiling/downloading anything
when a --help command is passed in, to tell the user WHY --help
takes so long to complete. It also points the user to the bootstrap
README.md for faster help.

Finally, this fixes one warning message that still referenced using
make instead of x.py, even though x.py is now the standard way of
building rust.
2018-02-26 20:45:52 -05:00
John Paul Adrian Glaubitz a895d438c2 bootstrap: Add missing cputype matching for sparc 2018-02-23 11:18:29 +01:00
Alex Crichton c6daea7c9a rustc: Split Emscripten to a separate codegen backend
This commit introduces a separately compiled backend for Emscripten, avoiding
compiling the `JSBackend` target in the main LLVM codegen backend. This builds
on the foundation provided by #47671 to create a new codegen backend dedicated
solely to Emscripten, removing the `JSBackend` of the main codegen backend in
the process.

A new field was added to each target for this commit which specifies the backend
to use for translation, the default being `llvm` which is the main backend that
we use. The Emscripten targets specify an `emscripten` backend instead of the
main `llvm` one.

There's a whole bunch of consequences of this change, but I'll try to enumerate
them here:

* A *second* LLVM submodule was added in this commit. The main LLVM submodule
  will soon start to drift from the Emscripten submodule, but currently they're
  both at the same revision.
* Logic was added to rustbuild to *not* build the Emscripten backend by default.
  This is gated behind a `--enable-emscripten` flag to the configure script. By
  default users should neither check out the emscripten submodule nor compile
  it.
* The `init_repo.sh` script was updated to fetch the Emscripten submodule from
  GitHub the same way we do the main LLVM submodule (a tarball fetch).
* The Emscripten backend, turned off by default, is still turned on for a number
  of targets on CI. We'll only be shipping an Emscripten backend with Tier 1
  platforms, though. All cross-compiled platforms will not be receiving an
  Emscripten backend yet.

This commit means that when you download the `rustc` package in Rustup for Tier
1 platforms you'll be receiving two trans backends, one for Emscripten and one
that's the general LLVM backend. If you never compile for Emscripten you'll
never use the Emscripten backend, so we may update this one day to only download
the Emscripten backend when you add the Emscripten target. For now though it's
just an extra 10MB gzip'd.

Closes #46819
2018-01-28 18:32:45 -08:00
Mark Simulacrum 6aeb1cfb64 Add ./x.py check src/{libstd,libtest,rustc}.
This currently only supports a limited subset of the full compilation,
but is likely 90% of what people will want and is possible without
building a full compiler (i.e., running LLVM). In theory, this means
that contributors who don't want to build LLVM now have an easy way to
compile locally, though running tests won't work.
2018-01-23 19:39:20 -07:00
Alex Crichton 80d6ed2d8b Update Cargo and its dependencies
This'll probably have a bunch of build errors, so let's try and head those off
and find them sooner rather than later!
2018-01-17 23:14:23 -08:00
John Paul Adrian Glaubitz d7dec7c8d7 bootstrap: Add missing cputype matching for sparc64 2017-10-31 19:26:41 +01:00
topecongiro 0dde8cdd40 Allow passing a path with tilde 2017-10-19 06:22:32 +09:00
Tatsuyuki Ishi cbe41168e0 bootstrap: Avoid fetching jemalloc if it's disabled
Fix #45300
2017-10-17 15:01:49 +09:00
johnthagen bd8497884c Merge branch 'master' into future_imports 2017-10-16 17:56:12 -04:00
johnthagen 23a5fb811e Merge branch 'master' into pep8-bootstrap 2017-10-11 07:33:46 -04:00
johnthagen 49a73d0901 Add __future__ imports to increase compatibility with Python 3. Derive Option from object to make it a new-style class for Python 3 compatibility. 2017-10-09 08:16:18 -07:00
johnthagen a263a78b28 Fix PEP8 style issues in bootstrap code 2017-10-08 20:08:11 -04:00
johnthagen d9e6703834 Use identity operator `is` when comparing to None 2017-10-08 19:46:58 -04:00
Marcus Buffett 5463aa06b8 Catch IOError
If config.toml doesn't exist, then an IOError will be raised
on the `with open(...)` line. Prior to e788fa7, this was
caught because the `except` clause didn't specify what
exceptions it caught, so both IOError and OSError were
caught
2017-09-21 12:15:10 -07:00
Tamir Duberstein e788fa7b6c
bootstrap: plumb verbosity into submodule ops
Fix some lints while I'm here.
2017-09-17 13:15:06 -04:00
kennytm 4d06185688
Remove invalid doctest from bootstrap.py.
Make sure that if the test is failed, the CI will stop the build.
2017-09-02 22:11:25 +08:00
Alex Crichton a9b0a7ba93 rustbuild: Rewrite the configure script in Python
This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
2017-08-27 18:53:30 -07:00
Milton Mazzarri f516765b94 bootstrap: Major refactoring
This commit includes the following:

* Fix syntax errors in Python 3
* Include more docstrings in classes, methods, and functions
* Include unit tests using `unittest`
* Merge implementation of `{rustc,cargo}_out_of_date`
* Merge implementation of `RustBuild.{cargo,rustc}`
* Remove unnecessary source code
* Move all the attributes defined outside of `__init__`
* Remove remaining `%s` from print function
* Remove `WindowsError` reference on non-windows systems
* Rename some variables to be more explicit avoid their meaning
* Run bootstrap tests in the CI process
* Remove non-pythonic getters
* Remove duplicate code in `download_stage0` method
* Reduce the number of branches in `build_bootstrap` method
* Re-raise exception when we cannot execute uname in non-windows systems
* Avoid long lines
2017-07-25 06:37:10 -05:00