about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-04-02Translate the virtual `/rustc/$hash` prefix back to a real directory.Eduard-Mihai Burtescu-7/+7
2020-03-24ci: add github actions configurationPietro Albini-0/+1
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-1/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-09Auto merge of #68623 - Zoxc:lld, r=Mark-Simulacrumbors-2/+14
Add an option to use LLD to link the compiler on Windows platforms Based on https://github.com/rust-lang/rust/pull/68609. Using LLD is good way to improve compile times on Windows since `link.exe` is quite slow. The time for `x.py build --stage 1 src/libtest` goes from 0:12:00 to 0:08:29. Compile time for `rustc_driver` goes from 226.34s to 18.5s. `rustc_macros` goes from 28.69s to 7.7s. The size of `rustc_driver` is also reduced from 83.3 MB to 78.7 MB. r? @Mark-Simulacrum
2020-02-04Remove unused core_intrinsics feature gate from bootstrapbjorn3-1/+0
2020-02-03bootstrap: fix clippy warningsMatthias Krüger-3/+3
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-1/+1
2020-01-29Don't use a whitelist for use_lldJohn Kåre Alsaker-5/+1
2020-01-29Add an option to use LLD to link the compiler on Windows platformsJohn Kåre Alsaker-2/+18
2019-12-22Format the worldMark Rousskov-122/+129
2019-12-21Implement `./x.py fmt [--check]`.Adam Perry-0/+5
2019-12-13Auto merge of #67077 - Aaron1011:build-llvm-in-binary, r=alexcrichtonbors-0/+3
rustc: Link LLVM directly into rustc again (take two) This is a continuation of PR https://github.com/rust-lang/rust/pull/65703
2019-12-12Auto merge of #67172 - jethrogb:jb/bootstrap-linker, r=alexcrichtonbors-6/+2
Bootstrap: change logic for choosing linker and rpath This is a follow-up from #66957 and #67023. Apparently there was one more location with a hard-coded list of targets to influence linking. I've filed #67171 to track this madness. r? @alexcrichton
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-0/+3
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
2019-12-10Add toolstate checking into bootstrapMark Rousskov-27/+0
This is not yet actually used by CI, but implements the logic for checking that tools are properly building on beta/stable and during beta cutoff week. This attempts to mirror the checking functionality in src/ci/docker/x86_64-gnu-tools/checktools.sh, and called scripts. It does not attempt to run the relevant steps (that functionality was originally desired to be moved into bootstrap as well, but doing so proved more difficult than expected). This is intended as a way to centralize and make clearer the logic involved in toolstate checking. In particular, the previous logic was spread across numerous python and shell scripts in such a way that made interpretation quite difficult.
2019-12-09Bootstrap: change logic for choosing linker and rpathJethro Beekman-6/+2
2019-12-04SGX: Fix target linker used by bootstrapJethro Beekman-0/+1
2019-10-30ci: move toolstates.json to /tmp/toolstate/ and docker mount itPietro Albini-0/+4
Before this commit toolstates.json was stored in /tmp and it wasn't mounted outside the build container. That caused uploading the file in the upload-artifacts task to fail, as the file was missing on the host. Mounting /tmp/toolstates.json alone is not the best approach: if the file is missing when the container is started the Docker engine will create a *directory* named /tmp/toolstates.json. The Docker issue could be solved by pre-creating an empty file named /tmp/toolstates.json, but doing that could cause problems if bootstrap fails to generate the file and the toolstate scripts receive an empty JSON. The approach I took in this commit is to instead mount a /tmp/toolstate directory inside Docker, and create the toolstates.json file in it. That also required a small bootstrap change to ensure the directory is created if it's missing.
2019-10-25Merge branch 'master' into rusty-hermit, resolve conflictsStefan Lankes-0/+1
2019-10-24Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split, r=pietroalbinibors-0/+1
Split the rustc target libraries into separate rustc-dev component This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR. The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case.
2019-10-22Merge branch 'master' into rusty-hermitStefan Lankes-7/+0
2019-10-21Remove `src/llvm-emscripten` submoduleAlex Crichton-7/+0
With #65251 landed there's no need to build two LLVM backends and ship them with rustc, every target we have now uses the same LLVM backend! This removes the `src/llvm-emscripten` submodule and additionally removes all support from rustbuild for building the emscripten LLVM backend. Multiple codegen backend support is left in place for now, and this is intended to be an easy 10-15 minute win on CI times by avoiding having to build LLVM twice.
2019-10-20Merge branch 'master' into rusty-hermitStefan Lankes-1/+1
2019-10-17show up some extra info when t!() failsGuanqun Lu-1/+1
2019-10-15Package non-rust objectsJethro Beekman-0/+1
2019-10-06redesign of the interface to the unikernel HermitCoreStefan Lankes-1/+1
- the old interface between HermitCore and the Rust Standard Library based on a small C library (newlib) - remove this interface and call directly the unikernel - remove the dependency to the HermitCore linker - use rust-lld as linker
2019-09-23bootstrap: Remove usage of `RUSTC_TARGET_LINKER`Alex Crichton-0/+10
Cargo has a native enviroment variable for this.
2019-08-29Rollup merge of #63979 - alexcrichton:remove-wasm-syscall, r=dtolnayMazdak Farrokhzad-3/+0
std: Remove the `wasm_syscall` feature This commit removes the `wasm_syscall` feature from the wasm32-unknown-unknown build of the standard library. This feature was originally intended to allow an opt-in way to interact with the operating system in a posix-like way but it was never stabilized. Nowadays with the advent of the `wasm32-wasi` target that should entirely replace the intentions of the `wasm_syscall` feature.
2019-08-28std: Remove the `wasm_syscall` featureAlex Crichton-3/+0
This commit removes the `wasm_syscall` feature from the wasm32-unknown-unknown build of the standard library. This feature was originally intended to allow an opt-in way to interact with the operating system in a posix-like way but it was never stabilized. Nowadays with the advent of the `wasm32-wasi` target that should entirely replace the intentions of the `wasm_syscall` feature.
2019-08-27rustbuild: allow disabling deny(warnings) for bootstrapMarc-Antoine Perennou-3/+0
When deny-warnings is not specified or set to true, the behaviour is the same as before. When deny-warnings is set to false, warnings are now allowed Fixes #63911 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-08-23bootstrap: Merge the libtest build step with libstdAlex Crichton-6/+1
Since its inception rustbuild has always worked in three stages: one for libstd, one for libtest, and one for rustc. These three stages were architected around crates.io dependencies, where rustc wants to depend on crates.io crates but said crates don't explicitly depend on libstd, requiring a sysroot assembly step in the middle. This same logic was applied for libtest where libtest wants to depend on crates.io crates (`getopts`) but `getopts` didn't say that it depended on std, so it needed `std` built ahead of time. Lots of time has passed since the inception of rustbuild, however, and we've since gotten to the point where even `std` itself is depending on crates.io crates (albeit with some wonky configuration). This commit applies the same logic to the two dependencies that the `test` crate pulls in from crates.io, `getopts` and `unicode-width`. Over the many years since rustbuild's inception `unicode-width` was the only dependency picked up by the `test` crate, so the extra configuration necessary to get crates building in this crate graph is unlikely to be too much of a burden on developers. After this patch it means that there are now only two build phasese of rustbuild, one for libstd and one for rustc. The libtest/libproc_macro build phase is all lumped into one now with `std`. This was originally motivated by rust-lang/cargo#7216 where Cargo was having to deal with synthesizing dependency edges but this commit makes them explicit in this repository.
2019-08-08simplify a matchRalf Jung-3/+1
2019-08-01build_helper: rename (try_)run_silent -> (try_)runRalf Jung-3/+3
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-2/+2
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-2/+3
rustbuild Remove some random unnecessary lint `allow`s
2019-07-15ci: Remove Travis/AppVeyor configurationAlex Crichton-14/+1
Now that we've fully moved to Azure Pipelines and bors has been updated to only gate on Azure this commit removes the remaining Travis/AppVeyor support contained in this repository. Most of the deletions here are related to producing better output on Travis by folding certain sections. This isn't supported by Azure so there's no need to keep it around, and if Azure ever adds support we can always add it back!
2019-07-06Fixed up a few comments.Alexander Regueiro-8/+8
2019-06-13Delete unused fields on Crate structMark Rousskov-5/+0
2019-06-09Use Build::read_dir instead of fs::read_dir in Build::cp_rPetr Hosek-2/+1
Build::read_dir does better error handling when the directory doesn't exist; it actually prints the name of the directory rather than just printing the underlying error "No such file or directory" which on its own isn't very useful.
2019-05-09remove unneeded `extern crate`s from build toolsAndy Russell-12/+3
2019-04-26bootstrap: use correct version numbers for llvm-tools and lldbPietro Albini-2/+2
2019-04-17bump bootstrap; remove redundant imports.Mazdak Farrokhzad-2/+0
2019-04-03Support using LLVM's libunwind as the unwinder implementationPetr Hosek-0/+3
This avoids the dependency on host libraries such as libgcc_s which may be undesirable in some deployment environments where these aren't available.
2019-03-31Fix custom relative libdir.O01eg-0/+1
Uses relative libdir to place libraries on all stages. Adds verbose installation output.
2019-03-30Don't ignore git for LLVM infoJosh Stone-8/+12
2019-03-29Add a new wasm32-unknown-wasi targetAlex Crichton-0/+7
This commit adds a new wasm32-based target distributed through rustup, supported in the standard library, and implemented in the compiler. The `wasm32-unknown-wasi` target is intended to be a WebAssembly target which matches the [WASI proposal recently announced.][LINK]. In summary the WASI target is an effort to define a standard set of syscalls for WebAssembly modules, allowing WebAssembly modules to not only be portable across architectures but also be portable across environments implementing this standard set of system calls. The wasi target in libstd is still somewhat bare bones. This PR does not fill out the filesystem, networking, threads, etc. Instead it only provides the most basic of integration with the wasi syscalls, enabling features like: * `Instant::now` and `SystemTime::now` work * `env::args` is hooked up * `env::vars` will look up environment variables * `println!` will print to standard out * `process::{exit, abort}` should be hooked up appropriately None of these APIs can work natively on the `wasm32-unknown-unknown` target, but with the assumption of the WASI set of syscalls we're able to provide implementations of these syscalls that engines can implement. Currently the primary engine implementing wasi is [wasmtime], but more will surely emerge! In terms of future development of libstd, I think this is something we'll probably want to discuss. The purpose of the WASI target is to provide a standardized set of syscalls, but it's *also* to provide a standard C sysroot for compiling C/C++ programs. This means it's intended that functions like `read` and `write` are implemented for this target with a relatively standard definition and implementation. It's unclear, therefore, how we want to expose file descriptors and how we'll want to implement system primitives. For example should `std::fs::File` have a libc-based file descriptor underneath it? The raw wasi file descriptor? We'll see! Currently these details are all intentionally hidden and things we can change over time. A `WasiFd` sample struct was added to the standard library as part of this commit, but it's not currently used. It shows how all the wasi syscalls could be ergonomically bound in Rust, and they offer a possible implementation of primitives like `std::fs::File` if we bind wasi file descriptors exactly. Apart from the standard library, there's also the matter of how this target is integrated with respect to its C standard library. The reference sysroot, for example, provides managment of standard unix file descriptors and also standard APIs like `open` (as opposed to the relative `openat` inspiration for the wasi ssycalls). Currently the standard library relies on the C sysroot symbols for operations such as environment management, process exit, and `read`/`write` of stdio fds. We want these operations in Rust to be interoperable with C if they're used in the same process. Put another way, if Rust and C are linked into the same WebAssembly binary they should work together, but that requires that the same C standard library is used. We also, however, want the `wasm32-unknown-wasi` target to be usable-by-default with the Rust compiler without requiring a separate toolchain to get downloaded and configured. With that in mind, there's two modes of operation for the `wasm32-unknown-wasi` target: 1. By default the C standard library is statically provided inside of `liblibc.rlib` distributed as part of the sysroot. This means that you can `rustc foo.wasm --target wasm32-unknown-unknown` and you're good to go, a fully workable wasi binary pops out. This is incompatible with linking in C code, however, which may be compiled against a different sysroot than the Rust code was previously compiled against. In this mode the default of `rust-lld` is used to link binaries. 2. For linking with C code, the `-C target-feature=-crt-static` flag needs to be passed. This takes inspiration from the musl target for this flag, but the idea is that you're no longer using the provided static C runtime, but rather one will be provided externally. This flag is intended to also get coupled with an external `clang` compiler configured with its own sysroot. Therefore you'll typically use this flag with `-C linker=/path/to/clang-script-wrapper`. Using this mode the Rust code will continue to reference standard C symbols, but the definition will be pulled in by the linker configured. Alright so that's all the current state of this PR. I suspect we'll definitely want to discuss this before landing of course! This PR is coupled with libc changes as well which I'll be posting shortly. [LINK]: [wasmtime]:
2019-03-28Rollup merge of #59351 - phil-opp:llvm-ar, r=alexcrichtonMazdak Farrokhzad-0/+1
Include llvm-ar with llvm-tools component Adds the `llvm-ar` tool to the `llvm-tools` component. This is useful for [building and linking native code](https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-building-some-native-code) in cargo build scripts without needing to use the platform specific `ar`. According to #58663 it is also useful for WASM. `llvm-ar` is very small (~82KB), so it does not significantly increase the size of the `llvm-tools` component. Fixes #58663
2019-03-21Include llvm-ar with llvm-tools componentPhilipp Oppermann-0/+1
2019-03-20Add messages for different verbosity levels.O01eg-0/+12
Output copy actions
2019-03-14bootstrap: Default to a sensible llvm-suffix.Emilio Cobos Álvarez-0/+6
I used version-channel-sha, hopefully that should work. I checked that bootstrap builds, but I cannot check anything else since the llvm build process is started from cargo, and thus calls clang, and thus I hit the same bug I hope to fix with this change. Hopefully fixes #59034.