about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
AgeCommit message (Collapse)AuthorLines
2021-05-22Move llvm submodule updates to rustbuildJoshua Nelson-0/+10
This enables better caching, since LLVM is only updated when needed, not whenever x.py is run. Before, bootstrap.py had to use heuristics to guess if LLVM would be needed, and updated the module more often than necessary as a result. This syncs the LLVM submodule only just before building the compiler, so people working on the standard library never have to worry about it. Example output: ``` Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Updating submodule src/llvm-project Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project' Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d' ``` - Don't try to update the LLVM submodule when using system LLVM Previously, this would try to update LLVM unconditionally. Now the submodule is only initialized if `llvm-config` is not set. - Don't update LLVM submodule in dry runs This prevents the following test failures: ``` running 17 tests fatal: invalid gitfile format: /checkout/src/llvm-project/.git test builder::tests::defaults::build_cross_compile ... FAILED ---- builder::tests::defaults::build_default stdout ---- thread 'main' panicked at 'command did not execute successfully: "git" "rev-parse" "HEAD" expected success, got: exit code: 128', src/build_helper/lib.rs:139:9 ``` - Try running git without --progress if it fails the first time This avoids having to do version detection to see if --progress is supported or not. - Don't try to update submodules when the source repository isn't managed by git - Update LLVM submodules that have already been checked out - Only check for whether the submodule should be updated in lib.rs; update it unconditionally in native.rs
2021-05-01Allow formatting specific subdirectoriesJoshua Nelson-2/+2
2021-04-07Cleanup option parsing and config.toml.exampleJoshua Nelson-1/+1
- Add an assertion that `link-shared = true` when `thin-lto = true`. Previously, link-shared would be silently overwritten. - Get rid of `Option<bool>` in bootstrap/config.rs. Set defaults immediately instead of delaying until later in bootstrap. This makes it easier to find what the default value is. - Remove redundant `config.x = false` when the default was already false - Set defaults for `bindir` in `default_opts()` instead of `parse()` - Update `download-ci-llvm = if-supported` option to match bootstrap.py - Remove redundant check for link_shared. Previously, it was checked twice. - Update various options in config.toml.example to their defaults. Previously, some options showed an example value instead of the default value. - Fix incorrect defaults in config.toml.example + `use-libcxx` defaults to false + Add missing `check-stage = 0` + Update several defaults to be conditional (e.g. `if incremental { 10 } else { 100 }`) - Remove redundant defaults in prose - Use the same comment for the default and target-dependent `musl-root` - Fix typos - Link to `cc_detect` for `cc` and `cxx`, since the logic is ... complicated. - Update more defaults to better reflect how they actually get set - Remove ignored `gpg-password-file` option This stopped being used in https://github.com/rust-lang/rust/commit/7704d35accfe1b587ce41ea09ca3bf6a47aca117, but was never removed from config.toml. - Remove unused flags from `config.toml` + Disallow `infodir` and `localstatedir` in `config.toml` + Allow the flags in `./configure`, but give a warning that they will be ignored. + Fix incorrect comment that `datadir` will be ignored. Example output: ``` $ ./configure --set install.infodir=xxx configure: processing command line configure: configure: install.infodir := xxx configure: build.configure-args := ['--set', 'install.infodir=xxx'] warning: infodir will be ignored configure: configure: writing `config.toml` in current directory configure: configure: run `python /home/joshua/rustc3/x.py --help` configure: ``` - Update CHANGELOG - Add "as an example" where appropriate - Link to an issue instead of to ephemeral chats
2021-02-21Add new rustdoc-gui test suiteGuillaume Gomez-0/+4
2020-12-31bootstrap: clippy fixesMatthias Krüger-2/+2
addresses: clippy::or_fun_call clippy::single_char_add_str clippy::comparison_to_empty clippy::or_fun_call
2020-12-23bootstrap: convert llvm-tools to use TarballPietro Albini-4/+0
2020-12-23bootstrap: convert build-manifest to use the new Tarball structPietro Albini-0/+1
2020-12-16Revert "Auto merge of #78790 - Gankra:rust-src-vendor, r=Mark-Simulacrum"Eric Huss-21/+0
This reverts commit 7afc5172305cdae588a0318ce545749cf4ed947d, reversing changes made to d4ea0b3e46a0303d5802b632e88ba1ba84d9d16f.
2020-11-16x.py: allow a custom string appended to the versionJosh Stone-1/+7
This adds `rust.description` to the config as a descriptive string to be appended to `rustc --version` output, which is also used in places like debuginfo `DW_AT_producer`. This may be useful for supplementary build information, like distro-specific package versions. For example, in Fedora 33, `gcc --version` outputs: gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) With this change, we can add similar vendor info to `rustc --version`.
2020-11-11Merge changes from rust-lang/rustZachary Catlin-15/+40
2020-11-11Include llvm-as in llvm-tools-preview componentZachary Catlin-0/+1
Including llvm-as adds the ability to include assembly language fragments that can be inlined using LTO.
2020-11-11Rollup merge of #78947 - dalance:llvm_cov, r=Mark-SimulacrumJonas Schievink-10/+11
Ship llvm-cov through llvm-tools `llvm-cov` is used to generate coverage report with LLVM InstrProf-based code coverage #34701. So if `llvm-cov` is shipped through llvm-tools, users can try it easily accorging to the instruction of [The Rust Unstable Book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/source-based-code-coverage.html).
2020-11-11Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-SimulacrumJonas Schievink-4/+7
Support enable/disable sanitizers/profiler per target This PR add options under `[target.*]` of `config.toml` which can enable or disable sanitizers/profiler runtime for corresponding target. If these options are empty, the global options under `[build]` will take effect. Fix #78329
2020-11-11Auto merge of #78790 - Gankra:rust-src-vendor, r=Mark-Simulacrumbors-0/+21
Vendor libtest's dependencies in the rust-src component This is the Rust side of https://github.com/rust-lang/wg-cargo-std-aware/issues/23 Note that this won't produce a useful result for `cargo -Zbuild-std` if there are multiple versions of a crate vendored, but will otherwise produce a valid vendor dir. See https://github.com/rust-lang/cargo/pull/8834 for the other half of this change.
2020-11-12Ship llvm-cov through llvm-toolsdalance-10/+11
2020-11-09Vendor libtest's dependencies in the rust-src componentAlexis Beingessner-0/+21
This is the Rust side of https://github.com/rust-lang/wg-cargo-std-aware/issues/23
2020-11-06Compile tools and internal libraries with the initial-exec TLS modelJosh Triplett-0/+4
This should produce more efficient code, with fewer calls to __tls_get_addr. The tradeoff is that libraries using it won't work with dlopen, but that shouldn't be a problem for tools or for our own internal libraries. Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
2020-11-03Fix panic in bootstrap for non-workspace path dependencies.Eric Huss-0/+4
2020-10-27Rollup merge of #77703 - Keruspe:system-libunwind, r=Mark-SimulacrumYuki Okushi-3/+5
add system-llvm-libunwind config option allows using the system-wide llvm-libunwind as the unwinder Workaround for #76020
2020-10-26Add support for using cg_clif to bootstrap rustcbjorn3-0/+4
2020-10-26Support enable/disable sanitizers/profiler per target12101111-4/+7
2020-10-21allow using the system-wide llvm-libunwind as the unwinderMarc-Antoine Perennou-3/+5
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-10-14Rollup merge of #77868 - Aaron1011:llvm-tools-opt-llc, r=Mark-SimulacrumYuki Okushi-0/+3
Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component Fixes #55890 It's useful to have `llc` and `opt` available when debugging an LLVM miscompilation,.
2020-10-12Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` componentAaron Hill-0/+3
Fixes #55890 It's useful to have `llc` and `opt` available when debugging an LLVM miscompilation,.
2020-10-13Rollup merge of #77746 - winnayx:issue-77572-fix, r=jyn514Yuki Okushi-0/+2
Fix `x.py setup` sets `changelog-seen` Fixes #77572 by setting changelog-seen in setup.rs
2020-10-11Mostly print statements to see where things areWinnie Xiao-0/+2
More print statementsstatements lol Solved the basic case of eliminating check_version ifk_version if subcommand = setup Finished v1 checking out old bootstrap.py checked out old irrelevant files fixed tidy Moved VERSION from bin/main.rs to lib.rs Fixed semicolon return issue x.py fmt
2020-10-09bootstrap: always use the Rust version in package namesPietro Albini-34/+0
The format of the tarballs produced by CI is roughly the following: {component}-{release}-{target}.{ext} While on the beta and nightly channels `{release}` is just the channel name, on the stable channel is either the Rust version or the version of the component we're shipping: cargo-0.47.0-x86_64-unknown-linux-gnu.tar.xz clippy-0.0.212-x86_64-unknown-linux-gnu.tar.xz llvm-tools-1.46.0-x86_64-unknown-linux-gnu.tar.xz miri-0.1.0-x86_64-unknown-linux-gnu.tar.xz rls-1.41.0-x86_64-unknown-linux-gnu.tar.xz rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz ... This makes it really hard to get the package URL without having access to the manifest (and there is no manifest on ci-artifacts.rlo), as there is no consistent version number to use. This commit addresses the problem by always using the Rust version number as `{release}` for the stable channel, regardless of the version number of the component we're shipping. I chose that instead of "stable" to avoid breaking the URL scheme *that* much. Rustup should not be affected by this change, as it fetches the URLs from the manifest. Unfortunately we don't have a way to test other clients before making a stable release, as this change only affects the stable channel.
2020-10-06Use Profile enum for x.py setupAntoine Martin-2/+2
2020-09-24Add `x.py setup`Joshua Nelson-1/+6
- Suggest `x.py setup` if config.toml doesn't exist yet (twice, once before and once after the build) - Prompt for a profile if not given on the command line - Print the configuration file that will be used - Print helpful starting commands after setup - Link to the dev-guide after finishing - Note that distro maintainers will see the changelog warning
2020-09-18bootstrap: move the version number to a plaintext filePietro Albini-7/+14
The Rust version number is currently embedded in bootstrap's source code, which makes it hard to update it automatically or access it outside of ./x.py (as you'd have to parse the source code). This commit moves the version number to a standalone plaintext file, which makes accessing or updating it trivial.
2020-09-13Auto merge of #76588 - guswynn:debug_logging, r=jyn514,Mark-Simulacrumbors-0/+10
Add a dedicated debug-logging option to config.toml `@Mark-Simulacrum` and I were talking in zulip and we found that turning on debug/trace logging in rustc is fairly confusing, as it effectively depends on debug-assertions and is not documented as such. `@Mark-Simulacrum` mentioned that we should probably have a separate option for logging anyways. this diff adds that, having the option follow debug-assertions (so everyone's existing config.toml should be fine) and if the option is false to test I ran ./x.py test <something> twice, once with `debug-logging = false` and once with `debug-logging = true` and made sure i only saw trace's when it was true
2020-09-12Download LLVM from CI to bootstrapMark Rousskov-0/+4
2020-09-11just max_level_infoGus Wynn-1/+1
2020-09-10add debug-logging to config.tomlGus Wynn-0/+10
2020-09-10Auto merge of #76378 - petrochenkov:lldtest, r=Mark-Simulacrumbors-7/+8
rustbuild: Build tests with LLD if `use-lld = true` was passed Addresses https://github.com/rust-lang/rust/pull/76127#discussion_r479932392. Our test suite is generally ready to run with an explicitly specified linker (https://github.com/rust-lang/rust/pull/45191), so LLD specified with `use-lld = true` works as well. Only 4 tests fail (on `x86_64-pc-windows-msvc`): ``` ui/panic-runtime/lto-unwind.rs run-make-fulldeps/debug-assertions run-make-fulldeps/foreign-exceptions run-make-fulldeps/test-harness ``` All of them are legitimate issues with LLD (or at least with combination Rust+LLD) and manifest in segfaults on access to TLS (https://github.com/rust-lang/rust/pull/76127#issuecomment-683473325). UPD: These issues are caused by https://github.com/rust-lang/rust/issues/72145 and appear because I had `-Ctarget-cpu=native` set. UPD: Further commits build tests with LLD for non-MSVC targets and propagate LLD to more places when `use-lld` is enabled.
2020-09-09Rollup merge of #76379 - petrochenkov:nodegen, r=Mark-SimulacrumDylan DPC-4/+0
rustbuild: Remove `Mode::Codegen` It's no longer used.
2020-09-06Make bootstrap build on stableMark Rousskov-2/+0
This is generally a good idea, and will help with being able to build bootstrap without Python over time as it means we can "just" build with cargo +beta build rather than needing the user to set environment variables. This is a minor step, but a necessary one on that road.
2020-09-07rustbuild: Deduplicate LLD checks slightlyVadim Petrochenkov-3/+7
2020-09-07rustbuild: Build tests with LLD if `use-lld = true` was passedVadim Petrochenkov-7/+4
2020-09-05rustbuild: Remove `Mode::Codegen`Vadim Petrochenkov-4/+0
2020-09-04Fix rust.use-lld when linker is not setMateusz Mikuła-1/+6
2020-09-01Move ninja requirements to a dynamic check, when actually buildingMark Rousskov-1/+38
It isn't practical to determine whether we'll build LLVM very early in the pipeline, so move the ninja checking to a dynamic check.
2020-08-27Rollup merge of #75758 - bpangWR:master, r=Mark-SimulacrumDylan DPC-0/+4
Fixes for VxWorks r? @alexcrichton
2020-08-25For VxWorks:Pang, Baoshan-0/+4
fix building errors use wr-c++ as linker
2020-08-22bootstrap: fix a couple of clippy lint warningsMatthias Krüger-4/+1
clippy::print_literal clippy::clone_on_copy clippy::single_char_pattern clippy::into_iter_on_ref clippy::match_like_matches_macro
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-51/+55
`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-07-14Use local links in the alloc docs.Eric Huss-7/+0
2020-07-10Use str::strip* in bootstrapLzu Tao-6/+5
This commit replaces the use of `trim_start_matches` because in `rustc -Vv` output there are no lines starting with multiple "release:".
2020-07-03Add rust-analyzer submoduleAleksey Kladov-0/+9
The current plan is that submodule tracks the `release` branch of rust-analyzer, which is updated once a week. rust-analyzer is a workspace (with a virtual manifest), the actual binary is provide by `crates/rust-analyzer` package. Note that we intentionally don't add rust-analyzer to `Kind::Test`, for two reasons. *First*, at the moment rust-analyzer's test suite does a couple of things which might not work in the context of rust repository. For example, it shells out directly to `rustup` and `rustfmt`. So, making this work requires non-trivial efforts. *Second*, it seems unlikely that running tests in rust-lang/rust repo would provide any additional guarantees. rust-analyzer builds with stable and does not depend on the specifics of the compiler, so changes to compiler can't break ra, unless they break stability guarantee. Additionally, rust-analyzer itself is gated on bors, so we are pretty confident that test suite passes.
2020-06-30Auto merge of #73456 - tmiasko:musl-libdir, r=Mark-Simulacrumbors-0/+9
bootstrap: Configurable musl libdir Make it possible to customize the location of musl libdir using musl-libdir in config.toml, e.g., to use lib64 instead of lib.