about summary refs log tree commit diff
path: root/src/bootstrap/config.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27Change debuginfo to default to 1 if `debug = true` is setJoshua Nelson-1/+1
From [a conversation in discord](https://discordapp.com/channels/442252698964721669/443151243398086667/719200989269327882): > Linking seems to consume all available RAM, leading to the OS to swap memory to disk and slowing down everything in the process Compiling itself doesn't seem to take up as much RAM, and I'm only looking to check whether a minimal testcase can be compiled by rustc, where the runtime performance isn't much of an issue > do you have debug = true or debuginfo-level = 2 in config.toml? > if so I think that results in over 2GB of debuginfo nowadays and is likely the culprit > which might mean we're giving out bad advice :( Anecdotally, this sped up my stage 1 build from 15 to 10 minutes. This still adds line numbers, it only removes variable and type information. - Improve wording for debuginfo description Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-10/+74
`rustc` allows passing in predefined target triples as well as JSON target specification files. This change allows bootstrap to have the first inkling about those differences. This allows building a cross-compiler for an out-of-tree architecture (even though that compiler won't work for other reasons). Even if no one ever uses this functionality, I think the newtype around the `Interned<String>` improves the readability of the code.
2020-06-18bootstrap: Configurable musl libdirTomasz Miąsko-0/+3
Make it possible to customize the location of musl libdir using musl-libdir in config.toml, e.g., to use lib64 instead of lib.
2020-05-15Rollup merge of #72146 - Mark-Simulacrum:separate-std-asserts, r=alexcrichtonDylan DPC-0/+6
Provide separate option for std debug asserts On local one-off benchmarking of libcore metadata-only, debug asserts in std are a significant hit (15s to 20s). Provide an option for compiler developers to disable them. A build with a nightly compiler is around 10s, for reference.
2020-05-12Provide separate option for std debug assertsMark Rousskov-0/+6
2020-05-10remove lldb package from bootstrap, config and build-manifestRalf Jung-3/+0
it's not been built since a long time ago
2020-05-08x.py: allow configuring the build directoryJoshua Nelson-0/+2
This allows configuring the directory for build artifacts, instead of having it always be ./build. This means you can set it to a constant location, letting you reuse the same cache while working in several different directories. The configuration lives in config.toml under build.build-dir. By default, it keeps the existing default of ./build, but it can be configured to any relative or absolute path. Additionally, it allows making outputs relative to the root of the git repository using $ROOT.
2020-04-02bootstrap: add `--json-output` for rust-analyzerNiko Matsakis-0/+2
2020-02-28Fix no_std detection for target triplesAndre Richter-1/+1
The current check for wether a target is no_std or not is matching for the string "-none-" in a target triple. This doesn't work for triples that end in "-none", like "aarch64-unknown-none". Fix this by matching for "-none" instead. I checked for all the current target triples containing "none", and this should not generate any false positives. This fixes an issue encountered in https://github.com/rust-lang/rust/pull/68334
2020-02-24bootstrap: Further centralize target defaulting logic.John Ericson-3/+13
Background: targets can be specied with or without config files; unneccessarily differences in the logic between those cases has caused a) the bug I tried to fix in the previous commit, b) the bug I introduced in the previous commit. The solution is to make the code paths the same as much as possible. 1. Targets are now not created from the `default` method. (I would both remove the impl if this was a public library, but just wrap it for convience becaues it's not.) Instead, there is a `from_triple` method which does the defaulting. 2. Besides the sanity checking, use the new method in the code reading config files. Now `no_std` is overriden iff set explicitly just like the other fields which are optional in the TOML AST type. 3. In sanity checking, just populate the map for all targets no matter what. That way do don't duplicate logic trying to be clever and remember which targets have "non standard" overrides. Sanity checking is back to just sanity checking, and out of the game of trying to default too.
2020-02-22Allow getting `no_std` from the config fileJohn Ericson-0/+3
Currently, it is only set correctly in the sanity checking implicit default fallback code. Having a config file at all will for force `no_std = false`.
2020-02-11Rollup merge of #68824 - ajpaverd:cfguard-rustbuild, r=Mark-SimulacrumDylan DPC-0/+3
Enable Control Flow Guard in rustbuild Now that Rust supports Control Flow Guard (#68180), add a config.toml option to build the standard library with CFG enabled. r? @nagisa
2020-02-10Enable Control Flow Guard in rustbuildAndrew Paverd-0/+3
2020-02-09Auto merge of #68623 - Zoxc:lld, r=Mark-Simulacrumbors-0/+3
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-03bootstrap: fix clippy warningsMatthias Krüger-4/+3
2020-01-29Add an option to use LLD to link the compiler on Windows platformsJohn Kåre Alsaker-0/+3
2020-01-10Prefer llvm-skip-rebuild flag value over config.tomlMatthew Healy-2/+6
2020-01-03Rollup merge of #67636 - semarie:bootstrap-rustfmt, r=Mark-SimulacrumYuki Okushi-0/+1
allow rustfmt key in [build] section Permit using `rustfmt` in `config.toml`. It will allow to not download `rustfmt` binary, which is not possible for at least some tiers-3 platforms. Fixes: #67624 r? @Mark-Simulacrum
2020-01-02bootstrap: Allow for setting the ThinLTO import limit used for compiler the ↵Michael Woerister-0/+3
compiler.
2019-12-27allow rustfmt key in [build] sectionSebastien Marie-0/+1
2019-12-26Parse llvm_skip_rebuild into ConfigMatthew Healy-0/+6
2019-12-22Format the worldMark Rousskov-37/+32
2019-12-21Implement `./x.py fmt [--check]`.Adam Perry-2/+9
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-5/+0
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-11-12Fallback to the unmodified path in bindir_relativeJosh Stone-6/+9
2019-11-11Use a relative bindir for rustdoc to find rustcJosh Stone-0/+11
In bootstrap, we set `RUSTC_INSTALL_BINDIR` to `config.bindir`, so rustdoc can find rustc relative to the toolchain sysroot. However, if a distro script like Fedora's `%configure` sets an absolute path, then rustdoc's `sysroot.join(bin_path)` ignores that sysroot altogether. That would be OK once the toolchain is actually installed, but it breaks the in-tree doc tests during the build, since `/usr/bin/rustc` is still the old version. So now we try to make `RUSTC_INSTALL_BINDIR` relative to the sysroot prefix in the first place.
2019-10-25Rollup merge of #65408 - guanqun:remove-rust-optimize, r=Mark-SimulacrumMazdak Farrokhzad-15/+15
reorder config.toml.example options and add one missing option r? @Mark-Simulacrum
2019-10-24reorder TomlTarget struct's fields based on the order in config.toml.exampleGuanqun Lu-2/+2
2019-10-24reorder Rust struct's fields based on the order in config.toml.exampleGuanqun Lu-5/+5
2019-10-24reorder Install struct's fields based on the order in config.toml.exampleGuanqun Lu-1/+1
2019-10-24reorder Build struct's fields based on the order in config.toml.exampleGuanqun Lu-4/+4
2019-10-24reorder Llvm struct's fields based on the order in config.toml.exampleGuanqun Lu-3/+3
2019-10-21Remove `src/llvm-emscripten` submoduleAlex Crichton-1/+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-09-10Locate rustc binary similarly to codegen backend loadingMark Rousskov-2/+3
This ensures that the failure cases for finding the codegen backend and for finding the rustc binary are essentially the same, and since we almost always will load the codegen backend, this is essentially meaning that the rustc change is not a regression.
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-08remove test-miri flag from bootstrapRalf Jung-4/+0
2019-08-02rustbuild: RISC-V is no longer an experimental LLVM targetSam Elliott-3/+2
This commit moves RISC-V from the experimental LLVM targets to the regular LLVM targets. RISC-V was made non-experimental in https://reviews.llvm.org/rL366399 I have also sorted the list of LLVM targets, and changed the code around setting llvm_exp_targets (and its default) to match the code setting llvm_targets (and its default), ensuring future changes to the defaults, as LLVM targets become stable, affect as few places as possible.
2019-07-05Lint on invalid values passed to x.py --warningsMark Rousskov-2/+2
This also introduces support for `--warnings allow` and fixes --warnings being overridden by the configuration file, config.toml.
2019-06-07Clarify when we run steps with ONLY_HOSTSMark Rousskov-2/+4
2019-06-03Treat 0 as special value for codegen-units-stdMark Rousskov-9/+10
Fixes #57669
2019-05-24rustbuild: Untie `debuginfo-level-tests` from `debuginfo-level`Vadim Petrochenkov-1/+1
2019-05-24rustbuild: Simplify debuginfo configurationVadim Petrochenkov-28/+29
2019-05-09remove unneeded `extern crate`s from build toolsAndy Russell-0/+2
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-29Add a new wasm32-unknown-wasi targetAlex Crichton-0/+3
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-16[bootstrap] Remove llvm.enabled configbjorn3-4/+5
2019-02-27Whitelist containers that allow older toolchainsAlex Crichton-0/+3
We'll use this as a temporary measure to get an LLVM update landed, but we'll have to go through and update images later to make sure they've got the right toolchains.
2019-01-31Auto merge of #57514 - michaelwoerister:xlto-tests, r=alexcrichtonbors-0/+3
compiletest: Support opt-in Clang-based run-make tests and use them for testing xLTO. Some cross-language run-make tests need a Clang compiler that matches the LLVM version of `rustc`. Since such a compiler usually isn't available these tests (marked with the `needs-matching-clang` directive) are ignored by default. For some CI jobs we do need these tests to run unconditionally though. In order to support this a `--force-clang-based-tests` flag is added to compiletest. If this flag is specified, `compiletest` will fail if it can't detect an appropriate version of Clang. @rust-lang/infra The PR doesn't yet enable the tests yet. Do you have any recommendation for which jobs to enable them? cc #57438 r? @alexcrichton
2019-01-30bootstrap: Expose LLVM_USE_LINKER cmake option to config.toml.Michael Woerister-0/+3
2019-01-28Use multiple threads by default. Limits tests to one thread. Do some renaming.John Kåre Alsaker-3/+3