about summary refs log tree commit diff
path: root/src/bootstrap/builder.rs
AgeCommit message (Collapse)AuthorLines
2018-04-17Remove uses of Build across Builder stepsMark Simulacrum-21/+20
2018-04-17Only emit save-analysis data for `cargo build` tasksNick Cameron-1/+3
Previously, we were emittinng analysis data for all tasks, including `doc`. That meant we got two sets of save-analysis data, one from the normal build and one from the docs. That means indexing with the RLS took twice as long and made downloads larger and build times longer. cc https://github.com/rust-lang-nursery/rls/issues/826
2018-04-17Auto merge of #49542 - GuillaumeGomez:intra-link-resolution-error, ↵bors-1/+1
r=GuillaumeGomez Add warning if a resolution failed r? @QuietMisdreavus
2018-04-16Add rustdoc-ui test suiteGuillaume Gomez-1/+1
2018-04-13Avoid specific claims about debuginfo sizeJosh Stone-1/+1
2018-04-13rustbuild: allow building tools with debuginfoJosh Stone-4/+8
Debugging information for the extended tools is currently disabled for concerns about the size. This patch adds `--enable-debuginfo-tools` to let one opt into having that debuginfo. This is useful for debugging the tools in distro packages. We always strip debuginfo into separate packages anyway, so the extra size is not a concern in regular use.
2018-04-09Add rustc book to the build systemsteveklabnik-2/+2
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-0/+5
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-03Refactor to use a dry-run config instead of cfg(test)Mark Simulacrum-1/+9
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-0/+40
2018-04-03Stub out less codeMark Simulacrum-1/+3
2018-04-03Add tests to rustbuildMark Simulacrum-2/+477
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-03Stub out various functions during testingMark Simulacrum-1/+1
2018-04-03Permit constructing Builder without executingMark Simulacrum-9/+10
2018-03-30Only include space in RUSTFLAGS extra flags if not emptyPetr Hosek-1/+3
When the RUSTFLAGS_STAGE_{1,2} is not set, including a space means the string will always be non-empty and RUSTFLAGS will be always be reset which breaks other ways of setting these such as through config in CARGO_HOME.
2018-03-25Rollup merge of #49193 - davidtwco:issue-29893, r=alexcrichtonkennytm-5/+7
Host compiler documentation Fixes #29893. Rust Central Station PR: rust-lang/rust-central-station#40 r? @alexcrichton
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-0/+1
This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-22Auto merge of #49264 - kennytm:rollup, r=kennytmbors-2/+4
Rollup of 23 pull requests - Successful merges: #48374, #48596, #48759, #48939, #49029, #49069, #49093, #49109, #49117, #49140, #49158, #49188, #49189, #49209, #49211, #49216, #49225, #49231, #49234, #49242, #49244, #49105, #49038 - Failed merges:
2018-03-21Add support to rustbuild for a 'rustc docs' component tarballDavid Wood-5/+7
2018-03-20Run the `run-make` tests last, so more tests run on Windows when `make` is ↵John Kåre Alsaker-2/+4
unavailable
2018-03-20ci: Print out how long each step takes on CIAlex Crichton-2/+27
This commit updates CI configuration to inform rustbuild that it should print out how long each step takes on CI. This'll hopefully allow us to track the duration of steps over time and follow regressions a bit more closesly (as well as have closer analysis of differences between two builds). cc #48829
2018-03-17Rollup merge of #48943 - comex:verbose, r=kennytmkennytm-1/+1
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-16re-enable resting librustdocQuietMisdreavus-2/+2
2018-03-15Support extra-verbose builds:comex-1/+1
- 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-16Rollup merge of #48892 - alexcrichton:thinlto-again, r=Mark-Simulacrumkennytm-11/+0
rustbuild: Remove ThinLTO-related configuration This commit removes some ThinLTO/codegen unit cruft primarily only needed during the initial phase where we were adding ThinLTO support to rustc itself. The current bootstrap compiler knows about ThinLTO and has it enabled by default for multi-CGU builds which are also enabled by default. One CGU builds (aka disabling ThinLTO) can be achieved by configuring the number of codegen units to 1 for a particular builds. This also changes the defaults for our dist builders to go back to multiple CGUs. Unfortunately we're seriously bleeding for cycle time on the bots right now so we need to recover any time we can.
2018-03-11Auto merge of #48549 - alexcrichton:update-cargo, r=Mark-Simulacrumbors-1/+3
Update Cargo submodule Hopefully a routine update...
2018-03-11Update Cargo submoduleAlex Crichton-1/+3
Required moving all fulldeps tests depending on `rand` to different locations as now there's multiple `rand` crates that can't be implicitly linked against.
2018-03-09rustbuild: Remove ThinLTO-related configurationAlex Crichton-11/+0
This commit removes some ThinLTO/codegen unit cruft primarily only needed during the initial phase where we were adding ThinLTO support to rustc itself. The current bootstrap compiler knows about ThinLTO and has it enabled by default for multi-CGU builds which are also enabled by default. One CGU builds (aka disabling ThinLTO) can be achieved by configuring the number of codegen units to 1 for a particular builds. This also changes the defaults for our dist builders to go back to multiple CGUs. Unfortunately we're seriously bleeding for cycle time on the bots right now so we need to recover any time we can.
2018-03-08Refactor run_host_only to have the proper effect.Mark Simulacrum-2/+2
Previously it was set to true when we didn't run HOSTS steps.
2018-03-08Remove ONLY_BUILD.Mark Simulacrum-12/+1
All uses are replaced with not accessing run.target/run.host, and instead directly using run.builder.build.build.
2018-03-08Remove ONLY_BUILD_TARGETS.Mark Simulacrum-6/+1
All cases where it is used can be replaced by substituing run.host for run.builder.build.build; that is its only effect. As such, it is removable.
2018-03-04Auto merge of #48630 - alexcrichton:more-sccache, r=kennytmbors-5/+22
rustbuild: Pass `ccache` to build scripts This is a re-attempt at #48192 hopefully this time with 100% less randomly [blocking builds for 20 minutes][block]. To work around #48192 the sccache server is started in the `run.sh` script very early on in the compilation process. [block]: https://github.com/rust-lang/rust/issues/48192
2018-03-03rust: Import LLD for linking wasm objectsAlex Crichton-1/+1
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-04Rollup merge of #48664 - Keruspe:codegen, r=alexcrichtonkennytm-1/+1
make codegen-backends directory name configurable This allows to parallel-install several versions of rust system-wide Fixes #48263
2018-03-02make codegen-backends directory name configurableMarc-Antoine Perennou-1/+1
This allows to parallel-install several versions of rust system-wide Fixes #48263 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-03-01rustbuild: Pass `ccache` to build scriptsAlex Crichton-5/+22
This is a re-attempt at #48192 hopefully this time with 100% less randomly [blocking builds for 20 minutes][block]. To work around #48192 the sccache server is started in the `run.sh` script very early on in the compilation process. [block]: https://github.com/rust-lang/rust/issues/48192
2018-03-01Rollup merge of #48405 - kennytm:autotoolstate-follow-up, r=Mark-SimulacrumManish Goregaokar-2/+4
Auto-toolstate management follow-up. Tracking comment: https://github.com/rust-lang/rust/issues/45861#issuecomment-367302777 * Fixed rust-lang-nursery/rust-toolstate#1, a proper link to the PR will be included. * Fixed rust-lang-nursery/rust-toolstate#2, a comment will be posted to the PR if the toolstate changed * Toolstate regression will be rejected at the last week of the 6-week cycle (currently entirely date-based). * Implemented https://internals.rust-lang.org/t/the-current-submodule-setup-is-not-tenable/6593, moved doc tests of Nomicon, Reference, Rust-by-Example and The Book to the "tools" job and thus allowed to fail like other external tools.
2018-02-25Rollup merge of #48517 - penpalperson:master, r=Mark-Simulacrumkennytm-0/+3
Added error-format flag to x.py. Fixes #48475 r? @Mark-Simulacrum
2018-02-24Added error-format flag to x.py.penpalperson-0/+3
2018-02-23Split test::Docs into one Step for each book.kennytm-2/+4
The *.md at the root directory in src/doc are no longer tested, but this should be fine since all files there are deprecated.
2018-02-19rustbuild: make libdir_relative a methodJosh Stone-3/+4
2018-02-19rustbuild: Restore Config.libdir_relativeJosh Stone-2/+2
This re-introduces a `Config.libdir_relative` field, now derived from `libdir` and made relative to `prefix` if necessary. This fixes a regression from #46592 when `--libdir` is given an absolute path. `Builder::sysroot_libdir` should always use a relative path so its callers don't clobber system locations, and `librustc` also asserts that `CFG_LIBDIR_RELATIVE` is really relative.
2018-02-16Fix panic when `x.py` is called without any arguments.kennytm-2/+4
2018-02-15Consider paths passed to x.py to be root-relative.Mark Simulacrum-0/+4
We'd previously assumed that these paths would be relative to the src dir, and that for example our various CI scripts would, when calling x.py, use `../x.py build ../src/tools/...` but this isn't the case -- they use `../x.py` without using the relevant source-relative path. We eventually may want to make this (actually somewhat logical) change, but this is not that time.
2018-02-15Prevent silently ignoring unmatched pathsMark Simulacrum-1/+1
Primarily for CI purposes; this is intended to avoid cases where we update rustbuild and unintentionally make CI stop running some builds to the arguments being passed no longer applying for some reason.
2018-02-15Auto merge of #48105 - Mark-Simulacrum:exclude-paths, r=alexcrichtonbors-23/+99
Implement excluding a build-step via --exclude First step to fixing https://github.com/rust-lang/rust/issues/47911. This doesn't change any CI configuration, but implements what I believe necessary to make that feasible in rustbuild. In theory this should be sufficient to allow someone to open a PR against .travis.yml and appveyor.yml which splits the Windows 32-bit tests and maybe the OS X tests into multiple builders (depending on what our cost-concerns are) to reduce runtimes. r? @alexcrichton cc @kennytm
2018-02-15Revert "rustbuild: Pass `ccache` to build scripts"Alex Crichton-22/+5
This reverts commit 64a8730e171367e4979cd9c25f0e0fdc2c157446.
2018-02-13Fix default Steps without paths.Mark Simulacrum-5/+10
Some Steps are by-default run but don't have any paths associated with them. We need to have at least one PathSet per each Step, though, so we add an empty one on calls to `never()`.
2018-02-11Change Step to be invoked with a path when in default mode.Mark Simulacrum-40/+85
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-10Remove DontDistWithMiri struct and instead just directly check it in builderMark Simulacrum-2/+7