about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-06-04fix tidyJorge Aparicio-1/+1
2018-06-03use rustc version as llvm-tools versionJorge Aparicio-15/+18
2018-06-03make a llvm-tools rustup componentJorge Aparicio-0/+18
2018-06-03document what each tools doesJorge Aparicio-1/+5
2018-06-03also ship llvm-profdataJorge Aparicio-1/+3
2018-06-03ship LLVM tools with the toolchainJorge Aparicio-0/+2
2018-06-03impl is_tool on Mode enumCollins Abitekaniza-0/+9
make is_tool inherent prop of mode fix errors from rebase resolve issues from review
2018-06-03refactor, make requested changesCollins Abitekaniza-5/+4
2018-06-03refactor Mode enumCollins Abitekaniza-10/+17
2018-05-22Fix FileCheck findingJohn Kåre Alsaker-5/+13
2018-05-06s/DocTestsOption/DocTests/gkennytm-2/+2
2018-05-06Added test case.kennytm-1/+1
2018-05-06Added `./x.py test --no-doc` option.kennytm-1/+11
This enables `./x.py test --stage 0 src/libstd --no-doc` and ensures the stage2-rustc and rustdoc need to be built.
2018-04-07Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakisbors-3/+2
Bump the bootstrap compiler to 1.26.0 beta Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-3/+2
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-05Rollup merge of #49563 - japaric:std-thumb, r=alexcrichtonkennytm-0/+6
add a dist builder to build rust-std components for the THUMB targets the rust-std component only contains the core and compiler-builtins (+c +mem) crates cc #49382 - I'm not entirely sure if this PR alone will produce rust-std components installable by rustup or if something else needs to be changed - I could have done the THUMB builds in an existing builder / image; I wasn't sure if that was a good idea so I added a new image - I could build other crates like alloc into the rust-std component but, AFAICT, that would require calling Cargo a second time (one for alloc and one for compiler-builtins), or have alloc depend on compiler-builtins (#49503 will perform that change) *and* have alloc resurface the "c" and "mem" Cargo features. r? @alexcrichton
2018-04-03Stop checking that the graph produced by a dry run is equivalentMark Simulacrum-12/+4
This is too likely to cause spurious bounces on CI; what we run may be dependent on what ran successfully before hand (e.g. RLS features with Clippy), which makes this not tenable. There's no good way to ignore specifically these problematic steps so we'll just ignore everything for the time being. We still test that a dry run worked though so largely this is the same from a ensure-that-tests-work perspective. Eventually we'll want to undo this commit, though, to make our tests more accurate.
2018-04-03Fix a few accidental expectationsMark Simulacrum-0/+5
2018-04-03Avoid printing output when in dry run modeMark Simulacrum-1/+6
2018-04-03Refactor to use a dry-run config instead of cfg(test)Mark Simulacrum-8/+193
This ensures that each build will support the testing design of "dry running" builds. It's also checked that a dry run build is equivalent step-wise to a "wet" run build; the graphs we generate when running are directly compared node/node and edge/edge, both for order and contents.
2018-04-03Implement generating graphs of the build stepsMark Simulacrum-4/+5
2018-04-03Stub out less codeMark Simulacrum-15/+13
2018-04-03Add tests to rustbuildMark Simulacrum-0/+4
In order to run tests, previous commits have cfg'd out various parts of rustbuild. Generally speaking, these are filesystem-related operations and process-spawning related parts. Then, rustbuild is run "as normal" and the various steps that where run are retrieved from the cache and checked against the expected results. Note that this means that the current implementation primarily tests "what" we build, but doesn't actually test that what we build *will* build. In other words, it doesn't do any form of dependency verification for any crate. This is possible to implement, but is considered future work. This implementation strives to cfg out as little code as possible; it also does not currently test anywhere near all of rustbuild. The current tests are also not checked for "correctness," rather, they simply represent what we do as of this commit, which may be wrong. Test cases are drawn from the old implementation of rustbuild, though the expected results may vary.
2018-04-03Make test steps sortableMark Simulacrum-1/+1
Ensures that test cases will be somewhat easier to write.
2018-04-03Stub out various functions during testingMark Simulacrum-10/+19
2018-04-03Permit constructing Build without executingMark Simulacrum-19/+21
2018-04-03Permit constructing Builder without executingMark Simulacrum-1/+7
2018-04-03Stop accessing current_dir in bootstrapMark Simulacrum-2/+1
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-01add a dist-thumb builder to build rust-std for the THUMB targetsJorge Aparicio-0/+6
the rust-std component only contains the core and compiler-builtins (+c +mem) crates cc #49382
2018-03-26rustbuild: Fail the build if we build Cargo twiceAlex Crichton-0/+5
This commit updates the `ToolBuild` step to stream Cargo's JSON messages, parse them, and record all libraries built. If we build anything twice (aka Cargo) it'll most likely happen due to dependencies being recompiled which is caught by this check.
2018-03-21Add support to rustbuild for a 'rustc docs' component tarballDavid Wood-0/+5
2018-03-17Rollup merge of #48943 - comex:verbose, r=kennytmkennytm-4/+0
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-16Automatically enable the `clippy` feature of `rls` if clippy buildsOliver Schneider-0/+1
2018-03-15Support extra-verbose builds:comex-4/+0
- 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-11Auto merge of #48599 - Mark-Simulacrum:rustbuild-updates-step-1, r=alexcrichtonbors-1/+1
Remove ONLY_BUILD and ONLY_BUILD_TARGETS Primarily removes `ONLY_BUILD` and `ONLY_BUILD_TARGETS`. These aren't actually needed in the new system since we can simply not take the relevant `host` and `target` fields if we don't want to run with them in `Step::make_run`. This PR also includes a few other commits which generally clean up the state of rustbuild, but are not related to the `Step` changes.
2018-03-09rustbuild: Fix MSBuild location of `llvm-config.exe`Alex Crichton-14/+0
For LLD integration the path to `llvm-config` needed to change to inside the build directory itself (for whatever reason) but the build directory is different on MSBuild than it is on `ninja` for MSVC builds, so the path to `llvm-config.exe` was actually wrong and not working! This commit removes the `Build::llvm_config` function in favor of the source of truth, the `Llvm` build step itself. The build step was then updated to find the right build directory for MSBuild as well as `ninja` for where `llvm-config.exe` is located. Closes #48749
2018-03-08Deny warningsMark Simulacrum-1/+1
2018-03-03rust: Import LLD for linking wasm objectsAlex Crichton-1/+7
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-02-17Add command to launch only doc testsGuillaume Gomez-0/+2
2018-02-11Change Step to be invoked with a path when in default mode.Mark Simulacrum-15/+22
Previously, a Step would be able to tell on its own when it was invoked "by-default" (that is, `./x.py test` was called instead of `./x.py test some/path`). This commit replaces that functionality, invoking each Step with each of the paths it has specified as "should be invoked by." For example, if a step calls `path("src/tools/cargo")` and `path("src/doc/cargo")` then it's make_run will be called twice, with "src/tools/cargo" and "src/doc/cargo." This makes it so that default handling logic is in builder, instead of spread across various Steps. However, this meant that some Step specifications needed to be updated, since for example `rustdoc` can be built by `./x.py build src/librustdoc` or `./x.py build src/tools/rustdoc`. A `PathSet` abstraction is added that handles this: now, each Step can not only list `path(...)` but also `paths(&[a, b, ...])` which will make it so that we don't invoke it with each of the individual paths, instead invoking it with the first path in the list (though this shouldn't be depended on). Future work likely consists of implementing a better/easier way for a given Step to work with "any" crate in-tree, especially those that want to run tests, build, or check crates in the std, test, or rustc crate trees. Currently this is rather painful to do as most of the logic is duplicated across should_run and make_run. It seems likely this can be abstracted away into builder somehow.
2018-02-10fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}Matthias Krüger-1/+1
2018-02-05Use time crate in bootstrap dist instead of dateOnur Aslan-0/+1
2018-01-30Add wasm_syscall feature to build systemDiggory Blake-0/+3
2018-01-28rustc: Split Emscripten to a separate codegen backendAlex Crichton-0/+4
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-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-3/+0
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-26Merge branch 'beta-prerelease' of https://github.com/cuviper/rust into rollupAlex Crichton-1/+5
2018-01-25Call non-git beta builds simply x.y.z-betaJosh Stone-1/+5
We can't use git commands to compute a prerelease version when we're building from a source tarball, or if git is otherwise unavailable. We'll just call such builds `x.y.z-beta`, without a prerelease.
2018-01-23Add ./x.py check src/{libstd,libtest,rustc}.Mark Simulacrum-6/+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-19Automaticaly calculate beta prerelease numbersAlex Crichton-2/+51
This is a forward-port of: * 9426dda83d7a928d6ced377345e14b84b0f11c21 * cbfb9858951da7aee22d82178405306fca9decb1 from the beta branch which is used to automatically calculate the beta number based on the number of merges to the beta branch so far.
2018-01-04rustc: Don't use relative paths for extended errorsAlex Crichton-0/+5
These no longer work now that Cargo changes the cwd of rustc while it's running. Instead use an absolute path that's set by rustbuild.