about summary refs log tree commit diff
path: root/src/bootstrap/compile.rs
AgeCommit message (Collapse)AuthorLines
2018-09-29Rename sanitizer runtime libraries on OSXAlex Crichton-1/+1
Currently we ship sanitizer libraries as they're built, but these names unfortunately conflict with the names of the sanitizer libraries installed on the system. If a crate, for example, links in C code that wants to use the system sanitizer and the Rust code doesn't use sanitizers at all, then using `cargo` may accidentally pull in the Rust-installed sanitizer library due to a conflict in names. This change is intended to be entirely transparent for Rust users of sanitizers, it should only hopefully improve our story with other users! Closes #54134
2018-09-18rustbuild: drop color handlingMarc-Antoine Perennou-33/+1
Let cargo handle that for us Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-09-17Auto merge of #52036 - collin5:b50509-2, r=collin5bors-24/+4
Clean up dependency tracking in Rustbuild [2/2] Make `clear_if_dirty` calls in `Builder::cargo` with stamp dependencies for the given Mode. Continuation of #50904 Ref issue #50509 r? @Mark-Simulacrum
2018-09-17refactor Builder::cargo, clean deps for cmd!=testCollins Abitekaniza-1/+0
2018-09-12remove struct CleanToolsCollins Abitekaniza-16/+4
2018-09-12clear_if_dirty in Builder::cargo with passed modeCollins Abitekaniza-7/+0
2018-09-10Add rustc SHA to released DWARF debuginfoAlex Crichton-2/+2
This commit updates the debuginfo that is encoded in all of our released artifacts by default. Currently it has paths like `/checkout/src/...` but these are a little inconsistent and have changed over time. This commit instead attempts to actually define the file paths in our debuginfo to be consistent between releases. All debuginfo paths are now intended to be `/rustc/$sha` where `$sha` is the git sha of the released compiler. Sub-paths are all paths into the git repo at that `$sha`.
2018-08-20bootstrap: Allow for building LLVM with ThinLTO.Michael Woerister-3/+44
2018-08-06Building librustc_codegen_llvm in a separate directoryMark Rousskov-4/+5
This allows clearing it out and building it separately from the compiler. Since it's essentially a different and separate crate this makes sense to do, each cargo invocation should generally happen in its own directory.
2018-07-30Remove the unstable std_unicode crate, deprecated since 1.27Simon Sapin-1/+0
Its former contents are now in libcore.
2018-07-14Change keep-stage to only affect the passed stageMark Rousskov-42/+34
The best way to build a stage 2 rustc is now probably ./x.py build --stage 2 src/rustc # once ./x.py build --stage 2 --keep-stage 1 src/rustc
2018-07-13Do not attempt to recompile codegen backend(s) with --keep-stageMark Rousskov-0/+10
Previously we'd attempt to recompile them and that would fail since we've essentially not built the entire compiler yet, or we're faking that fact. This commit should make us ignore the codegen backend build as well. Unlike the other compile steps, there is no CodegenBackendLink step that we run here, because that is done later as a part of assembling the final compiler and as an explicit function call.
2018-07-10Deny bare trait objects in `src/bootstrap`.ljedrz-1/+1
2018-07-05Auto merge of #51936 - japaric:rust-lld, r=alexcrichtonbors-2/+5
rename rustc's lld to rust-lld to not shadow the system installed LLD when linking with LLD. Before: - `-C linker=lld -Z linker-flavor=ld.lld` uses rustc's LLD - It's not possible to use a system installed LLD that's named `lld` With this commit: - `-C linker=rust-lld -Z linker-flavor=ld.lld` uses rustc's LLD - `-C linker=lld -Z linker-flavor=ld.lld` uses the system installed LLD we don't offer guarantees about the availability of LLD in the rustc sysroot so we can rename the tool as long as we don't break the wasm32-unknown-unknown target which depends on it. r? @alexcrichton we discussed this before
2018-07-02Change --keep-stage to apply moreMark Rousskov-20/+43
Previously, the --keep-stage argument would only function for compilers that were depended on by future stages. For example, if trying to build a stage 1 compiler you could --keep-stage 0 to avoid re-building the stage 0 compiler. However, this is often not what users want in practice. The new implementation essentially skips builds all higher stages of the compiler, so an argument of 1 to keep-stage will skip rebuilds of the libraries, just linking them into the sysroot. This is unlikely to work well in cases where metadata or similar changes have been made, but is likely fine otherwise. This change is somewhat untested, but since it shouldn't have any effect except with --keep-stage, I don't see that as a large problem.
2018-07-02Make explicit that assemble is not run from CLIMark Rousskov-1/+1
2018-06-30Notice non-toplevel dll dependencies in rustbuildMark Simulacrum-3/+3
Previously Cargo would hardlink all the dependencies into the "root" as foo.dll and the `toplevel` array would get populated with these, but that's no longer the case. Instead, cargo will only do this for the final artifacts/final libraries. Rustbuild is updated to continue looping through the artifacts mentioned instead of early-returning. This should fix the bug. @alexcrichton found the cause of this and suggested this fix.
2018-06-29rename rustc's lld to rust-lldJorge Aparicio-2/+5
to not shadow the system installed LLD when linking with LLD. Before: - `-C linker=lld -Z linker-flavor=ld.lld` uses rustc's LLD - It's not possible to use a system installed LLD that's named `lld` With this commit: - `-C linker=rust-lld -Z linker-flavor=ld.lld` uses rustc's LLD - `-C linker=lld -Z linker-flavor=ld.lld` uses the system installed LLD
2018-06-03refactor, make requested changesCollins Abitekaniza-3/+3
2018-06-03refactor Mode enumCollins Abitekaniza-16/+16
2018-05-17Auto merge of #50629 - Mark-Simulacrum:stage-step, r=alexcrichtonbors-1/+1
Switch to bootstrapping from 1.27 It's possible the Float trait could be removed from core, but I couldn't tell whether it was intended to be removed or not. @SimonSapin may be able to comment more here; we can presumably also do that in a follow up PR as this one is already quite large.
2018-05-17Fix rustc binary metadata overwriting librustc metadataMark Simulacrum-1/+1
In #49289, rustc was changed to emit metadata for binaries, which made it so that the librustc.rmeta file created when compiling librustc was overwritten by the rustc-main compilation. This commit renames the rustc-main binary to avoid this problem. https://github.com/rust-lang/cargo/issues/5524 has also been filed to see if Cargo can learn to warn on this situation instead of leaving it for the user to debug.
2018-05-17Rename trans to codegen everywhere.Irina Popa-8/+8
2018-04-18Replace Build with Buildervarkor-1/+1
2018-04-18Abstract LLVM building from bootstrapvarkor-48/+61
This deduplicates the LLVM building functionality from compile.rs and check.rs.
2018-04-18Correct the timestamp for CodegenBackend checkvarkor-0/+2
2018-04-18Add rustc_trans to x.py checkvarkor-3/+3
2018-04-17Remove uses of Build across Builder stepsMark Simulacrum-152/+143
2018-04-09Stop emitting color codes on TERM=dumbMark Simulacrum-1/+3
These terminals generally don't support color. Fixes #49191
2018-04-05Rollup merge of #49563 - japaric:std-thumb, r=alexcrichtonkennytm-34/+44
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-04compile other no-std cratesJorge Aparicio-1/+4
2018-04-04Revert "create a nostd crate"Jorge Aparicio-4/+4
This reverts commit 14768f9b636ef345320ded41da5e9f3da7af3a81.
2018-04-04create a nostd crateJorge Aparicio-4/+4
the goal is to build, in a single Cargo invocation, several no-std crates that we want to put in the rust-std component of no-std targets. The nostd crate builds these crates: - core - compiler-builtin (with the "c" and "mem" features enabled) - alloc - std_unicode
2018-04-03Avoid printing output when in dry run modeMark Simulacrum-19/+19
2018-04-03Refactor to use a dry-run config instead of cfg(test)Mark Simulacrum-19/+30
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-03Stub out less codeMark Simulacrum-1/+0
2018-04-03Make test steps sortableMark Simulacrum-6/+6
Ensures that test cases will be somewhat easier to write.
2018-04-03Stub out various functions during testingMark Simulacrum-0/+4
2018-04-01add a dist-thumb builder to build rust-std for the THUMB targetsJorge Aparicio-34/+41
the rust-std component only contains the core and compiler-builtins (+c +mem) crates cc #49382
2018-04-01Remove filetime dep from build_helperMark Simulacrum-1/+1
2018-03-26rustbuild: Fail the build if we build Cargo twiceAlex Crichton-48/+73
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-25rustbuild: Disable docs on cross-compiled buildsAlex Crichton-6/+5
This commit disables building documentation on cross-compiled compilers, for example ARM/MIPS/PowerPC/etc. Currently I believe we're not getting much use out of these documentation artifacts and they often take 10-15 minutes total to build as it requires building rustdoc/rustbook and then also generating all the documentation, especially for the reference and the book itself. In an effort to cut down on the amount of work that we're doing on dist CI builders in light of recent timeouts this was some relatively low hanging fruit to cut which in theory won't have much impact on the ecosystem in the hopes that the documentation isn't used too heavily anyway. While initial analysis in #48827 showed only shaving 5 minutes off local builds the same 5 minute conclusion was drawn from #48826 which ended up having nearly a half-hour impact on the bots. In that sense I'm hoping that we can land this and test out what happens on CI to see how it affects timing. Note that all tier 1 platforms, Windows, Mac, and Linux, will continue to generate documentation.
2018-03-25Rollup merge of #49089 - alexcrichton:fix-timings, r=Mark-Simulacrumkennytm-13/+14
rustbuild: Tweak where timing information goes This commit tweaks where timing and step information is printed out as part of the build, ensuring that we do it as close to the location where work happens as possible. In rustbuild various functions may perform long blocking work as dependencies are assembled, so if we print out timing information early on we may accidentally time more than just the step we were intending to time!
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-1/+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-17rustbuild: Tweak where timing information goesAlex Crichton-13/+14
This commit tweaks where timing and step information is printed out as part of the build, ensuring that we do it as close to the location where work happens as possible. In rustbuild various functions may perform long blocking work as dependencies are assembled, so if we print out timing information early on we may accidentally time more than just the step we were intending to time!
2018-03-09rustbuild: Fix MSBuild location of `llvm-config.exe`Alex Crichton-3/+7
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-03rust: Import LLD for linking wasm objectsAlex Crichton-0/+26
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/+2
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/+2
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-01Rollup merge of #48405 - kennytm:autotoolstate-follow-up, r=Mark-SimulacrumManish Goregaokar-1/+2
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.