about summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
AgeCommit message (Collapse)AuthorLines
2019-01-25Rebase to the llvm-project monorepoJosh Stone-10/+2
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-17Update bootstrap.pylenoil98-0/+3
Add PowerPC64 support on FreeBSD
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-24x.py: fixup 6130fc884bc1dff9bb835894a7bb2042c110b011Matthias Krüger-1/+1
./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-17Add --progress to git submodule commandsClar Fon-2/+2
2018-11-22Move Cargo.{toml,lock} to the repository root directory.Eduard-Mihai Burtescu-1/+1
2018-11-12Fix TLS errors when downloading stage0Dan Robertson-2/+2
2018-11-02Remove all jemalloc-related contentAlex Crichton-5/+0
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-10-26rustbuild: use configured linker to build boostrapMarc-Antoine Perennou-0/+3
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-10-23fix typos in various placesMatthias Krüger-1/+1
2018-10-01allow use of ./x.py help <cmd> ...Collins Abitekaniza-0/+5
2018-08-14Add lldb to the buildTom Tromey-0/+4
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-07-30Add timeout to use of `curl` in bootstrap.py.kennytm-1/+4
2018-07-10bootstrap: our best to achieve atomic rename on Win32NODA, Kai-1/+6
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-10bootstrap: write texts to a .tmp file first for atomicityNODA, Kai-3/+11
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-02bootstrap: tests should use rustc from config.tomlNikolai Merinov-0/+2
Tests should always use "rustc" and "cargo" from config.toml instead of assuming that stage0 binaries was downloaded to build directory.
2018-07-01Also run the bootstrap in bootstrap modeOliver Schneider-0/+1
2018-05-31bootstrap.py: respect crt-staticJohannes Nixdorf-3/+30
Bootstrap requires serde_derive, which needs proc-macro crate types, so it won't work with crt-static.
2018-05-17Revert "bootstrap.py: respect crt-static"Alex Crichton-30/+3
This reverts commit 5ecf29df052c7eca10fccc96f4179d338fe0014e.
2018-04-29bootstrap.py: respect crt-staticJohannes Nixdorf-3/+30
Bootstrap requires serde_derive, which needs proc-macro crate types, so it won't work with crt-static.
2018-04-06bootstrap: Remove the fast pathTatsuyuki Ishi-4/+1
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-03Stop accessing current_dir in bootstrapMark Simulacrum-1/+4
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-03-30Handle fast-submodules option correctlyPetr Hosek-1/+1
This option was introduced in 72cb109bec8, 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-17Rollup merge of #49057 - Zoxc:fast-submodules, r=alexcrichtonkennytm-12/+50
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-15Support extra-verbose builds:comex-8/+5
- 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-15Faster submodule updatingJohn Kåre Alsaker-12/+50
2018-03-03rust: Import LLD for linking wasm objectsAlex Crichton-0/+4
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-03Rollup merge of #48637 - segevfiner:restore-rust-mingw-download, r=alexcrichtonkennytm-0/+8
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-03Rollup merge of #48569 - Phlosioneer:x-py-help-optimization, r=petrochenkovkennytm-25/+15
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-02Remove print_what_bootstrap_meansPhlosioneer-27/+8
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-01Document why we download rust-mingwSegev Finer-0/+3
2018-03-01Restore the download of rust-mingwSegev Finer-0/+5
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-02-26Improve --help performance for x.pyPhlosioneer-4/+13
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-23bootstrap: Add missing cputype matching for sparcJohn Paul Adrian Glaubitz-1/+1
2018-01-28rustc: Split Emscripten to a separate codegen backendAlex Crichton-7/+16
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-23Add ./x.py check src/{libstd,libtest,rustc}.Mark Simulacrum-0/+1
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-17Update Cargo and its dependenciesAlex Crichton-5/+0
This'll probably have a bunch of build errors, so let's try and head those off and find them sooner rather than later!
2017-10-31bootstrap: Add missing cputype matching for sparc64John Paul Adrian Glaubitz-1/+1
2017-10-19Allow passing a path with tildetopecongiro-1/+1
2017-10-17bootstrap: Avoid fetching jemalloc if it's disabledTatsuyuki Ishi-1/+2
Fix #45300
2017-10-16Merge branch 'master' into future_importsjohnthagen-1/+2
2017-10-11Merge branch 'master' into pep8-bootstrapjohnthagen-1/+1
2017-10-09Add __future__ imports to increase compatibility with Python 3. Derive ↵johnthagen-1/+1
Option from object to make it a new-style class for Python 3 compatibility.
2017-10-08Fix PEP8 style issues in bootstrap codejohnthagen-0/+1
2017-10-08Use identity operator `is` when comparing to Nonejohnthagen-1/+1
2017-09-21Catch IOErrorMarcus Buffett-1/+1
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-17bootstrap: plumb verbosity into submodule opsTamir Duberstein-3/+2
Fix some lints while I'm here.
2017-09-02Remove invalid doctest from bootstrap.py.kennytm-4/+0
Make sure that if the test is failed, the CI will stop the build.
2017-08-27rustbuild: Rewrite the configure script in PythonAlex Crichton-187/+149
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-07-25bootstrap: Major refactoringMilton Mazzarri-201/+305
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