about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2022-01-06Rollup merge of #92589 - ChrisDenton:break-loop, r=Mark-SimulacrumMatthias Krüger-1/+3
Break the loop A missing break statement lead to an infinite loop in bootstrap.py. I also added a short sleep so it's not constantly running at 100%. But I can remove that if it's not wanted. Fixes #76661
2022-01-06Revert "bootstrap: copy `llvm-dwp` to sysroot"David Wood-12/+1
This reverts commit 241160de72b5b55187ca54243e2a6e82e336d07c.
2022-01-05Break the loopChris Denton-1/+3
A missing break statement lead to an infinite loop in bootstrap.py.
2022-01-05Rollup merge of #92182 - nnethercote:label-more-build-steps, r=Mark-SimulacrumMatthias Krüger-24/+13
Label more build steps Some small improvements. r? ```@Mark-Simulacrum```
2022-01-04Do not use deprecated -Zsymbol-mangling-version in bootstrapJakub Beránek-3/+13
2022-01-04Tweak the usage messages for `x.py build` and `x.py check`.Nicholas Nethercote-23/+11
They're a bit out of date, and overly complicated.
2022-01-04Label more build steps.Nicholas Nethercote-1/+2
Currently the output of a command like `./x.py build --stage 0 library/std` is this: ``` Updating only changed submodules Submodules updated in 0.02 seconds extracting [...] Compiling [...] Finished dev [unoptimized] target(s) in 17.53s Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Compling [...] Finished release [optimized + debuginfo] target(s) in 21.99s Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Build completed successfully in 0:00:51 ``` I find the part before the "Building stage0 std artifacts" a bit confusing. After this commit, it looks like this: ``` Updating only changed submodules Submodules updated in 0.02 seconds extracting [...] Building rustbuild Compiling [...] Finished dev [unoptimized] target(s) in 17.53s Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Compling [...] Finished release [optimized + debuginfo] target(s) in 21.99s Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Build completed successfully in 0:00:51 ``` The "Building rustbuild" label makes it clear what the first cargo build invocation is for. The indentation of the "Submodules updated" line indicates it is a sub-step of a parent task.
2022-01-01Remove some dead codebjorn3-31/+1
2022-01-01Remove the merge dependencybjorn3-3/+9
2022-01-01Make the rustc and rustdoc wrapper not depend on libbootstrapbjorn3-29/+39
This slightly improves compilation time by reducing linking time (saving about a 1/10 of the the total compilation time after changing rustbuild) and slightly reduces disk usage (from 16MB for the rustc wrapper to 4MB).
2022-01-01Avoid the merge derive macro in rustbuildbjorn3-166/+197
The task of the macro is simple enough that a decl macro is almost ten times shorter than the original proc macro. The proc macro is 159 lines while the decl macro is just 18 lines. This reduces the amount of dependencies of rustbuild from 45 to 37. It also slight reduces compilation time from 47s to 44s for debug builds.
2022-01-01Remove the lazy_static dependency from rustbuildbjorn3-5/+3
Rustbuild already depends on once_cell which in the future can be replaced with std::lazy::Lazy.
2022-01-01Rollup merge of #88310 - worldeva:bootstrap-locking, r=Mark-SimulacrumMatthias Krüger-0/+42
Lock bootstrap (x.py) build directory Closes #76661, closes #80849, `x.py` creates a lock file at `project_root/lock.db` r? `@jyn514` , because he was one that told me about this~
2021-12-31rustbuild: Add support for a per-target default-linker option.Maxim Cournoyer-2/+11
2021-12-31Lock x.py build stateworldeva-0/+42
Prevent spurious build failures and other bugs caused by parallel runs of x.py. We back the lock with sqlite, so that we have a cross-platform locking strategy, and which can be done nearly first in the build process (from Python), which helps move the lock as early as possible.
2021-12-17pass -Wl,-z,origin to set DF_ORIGIN when using rpathSébastien Marie-0/+1
DF_ORIGIN flag signifies that the object being loaded may make reference to the $ORIGIN substitution string. Some implementations are just ignoring DF_ORIGIN and do substitution for $ORIGIN if present (whatever DF_ORIGIN pr Set the flag inconditionally if rpath is wanted.
2021-12-12bootstrap: Change `unwrap()` to `expect()` for `WIX` pathAbhishek Sudhakaran-1/+3
On Windows, `x.py dist` command panics without proper error message if 'WIX' environment variable is not set. This patch changes `Option::unwrap()` to `Option::expect()`.
2021-12-11Auto merge of #91720 - Aaron1011:skip-llvm-ci-tools, r=Mark-Simulacrumbors-1/+6
Don't copy llvm tools to sysroot when using download-ci-llvm Fixes #91710
2021-12-10Rollup merge of #91716 - jyn514:x.py-defaults, r=Mark-SimulacrumMatthias Krüger-8/+15
Improve x.py logging and defaults a bit more r? ```@Mark-Simulacrum```
2021-12-10Rollup merge of #91668 - ChrisDenton:bootstrap-clean-error, r=Mark-SimulacrumMatthias Krüger-3/+3
Remove the match on `ErrorKind::Other` It's a) superfluous and b) doesn't work any more.
2021-12-09Don't copy llvm tools to sysroot when using download-ci-llvmAaron Hill-1/+6
Fixes #91710
2021-12-09Default to `doc-stage = 2` for the tools profileJoshua Nelson-0/+4
This already enables `download-rustc`, so it's quick to build rustdoc, and this makes it less confusing when changes to rustdoc aren't reflected in the docs. Note that this uses 2 and not 1 because `download-rustc` only affects stage 2 runs.
2021-12-09Don't print bootstrap caching/ensure info unless `-vv` is passedJoshua Nelson-3/+3
Previously, passing `-v` would emit an overwhelming amount of logging: ``` > Std { stage: 1, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } > Assemble { target_compiler: Compiler { stage: 1, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } < Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > Rustc { target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None }, compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > Std { target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None }, compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > StartupObjects { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } < StartupObjects { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } c Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } > Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } < Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } < Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } c Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } c Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } c Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > StdLink { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } c Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } c Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } < StdLink { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } < Std { target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None }, compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } ... continues for another 150 lines ... ``` This info is occasionally useful when debugging bootstrap itself, but not very useful for figuring out why a config option was ignored or command wasn't run. Demote it to `-vv` logging so that `-v` is more useful.
2021-12-09If --verbose is passed, print a warning in `bootstrap.py` when ↵Joshua Nelson-0/+3
download-rustc is ignored
2021-12-09Use more accurate wording in `bootstrap.py` loggingJoshua Nelson-5/+5
2021-12-09Add reminder to match the error kind once ` DirectoryNotEmpty` is stabilizedChris Denton-0/+2
2021-12-08Install llvm tools to sysroot when assembling local toolchainAaron Hill-0/+11
Some projects (e.g. the `bootimage` crate) may require the user to install the `llvm-tools-preview` rustup component. However, this cannot be easily done with a locally built toolchain. To allow a local toolchain to be used a drop-in replacement for a normal rustup toolchain in more cases, this PR copies the built LLVM tools to the sysoot. From the perspective a tool looking at the sysroot, this is equivalent to installing `llvm-tools-preview`.
2021-12-08Remove the match on `ErrorKind::Other`Chris Denton-3/+1
It's a) superfluous and b) doesn't work any more.
2021-12-06Auto merge of #91284 - t6:freebsd-riscv64, r=Amanieubors-4/+9
Add support for riscv64gc-unknown-freebsd For https://doc.rust-lang.org/nightly/rustc/target-tier-policy.html#tier-3-target-policy: * A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) For all Rust targets on FreeBSD, it's [rust@FreeBSD.org](mailto:rust@FreeBSD.org). * Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. Done. * Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. Done * Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. Done. * The target must not introduce license incompatibilities. Done. * Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). Fine with me. * The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. Done. * If the target supports building host tools (such as rustc or cargo), those host tools must not depend on proprietary (non-FOSS) libraries, other than ordinary runtime libraries supplied by the platform and commonly used by other binaries built for the target. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. Done. * Targets should not require proprietary (non-FOSS) components to link a functional binary or library. Done. * "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. Fine with me. * Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. Ok. * This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. Ok. * Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. std is implemented. * The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running tests (even if they do not pass), the documentation must explain how to run tests for the target, using emulation if possible or dedicated hardware if necessary. Building is possible the same way as other Rust on FreeBSD targets. * Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. Ok. * Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. Ok. * Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. Ok. * In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. Ok.
2021-12-05Bump download-ci-llvm-stamp for LLD inclusionAaron Hill-1/+1
This will make 'lld' available locally now, instead of needing to wait for the next LLVM submodule bump.
2021-12-05Auto merge of #88611 - m-ou-se:array-into-iter-new-deprecate, r=joshtriplettbors-1/+1
Deprecate array::IntoIter::new.
2021-12-04Include `lld` in `rust-dev` packageAaron Hill-0/+7
Fixes #88941 This will allow using `download-ci-llvm` while still having LLD available.
2021-12-04Use IntoIterator for array impl everywhere.Mara Bos-1/+1
2021-12-03Explain why libatomic is not needed on FreeBSD riscv64Tobias Kortkamp-2/+7
From Jessica Clarke (jrtc27@)
2021-11-27Add riscv64gc-unknown-freebsdTobias Kortkamp-2/+2
2021-11-26Fix bug where submodules wouldn't be updated when running x.py from a ↵Joshua Nelson-1/+1
subdirectory Previously, it would concatenate the relative path to the current subdirectory, which looked at the wrong folder. I tested this by checking out `1.56.1`, changing the current directory to `src/`, and running `../x.py build`.
2021-11-19Rollup merge of #90800 - aplanas:fix_cargo_config, r=Mark-SimulacrumYuki Okushi-9/+14
bootstap: create .cargo/config only if not present In some situations we should want on influence into the .cargo/config when we use vendored source. One example is #90764, when we want to workaround some references to crates forked and living in git, that are missing in the vendor/ directory. This commit will create the .cargo/config file only when the .cargo/ directory needs to be created.
2021-11-18Auto merge of #90382 - alexcrichton:wasm64-libstd, r=joshtriplettbors-1/+1
std: Get the standard library compiling for wasm64 This commit goes through and updates various `#[cfg]` as appropriate to get the wasm64-unknown-unknown target behaving similarly to the wasm32-unknown-unknown target. Most of this is just updating various conditions for `target_arch = "wasm32"` to also account for `target_arch = "wasm64"` where appropriate. This commit also lists `wasm64` as an allow-listed architecture to not have the `restricted_std` feature enabled, enabling experimentation with `-Z build-std` externally. The main goal of this commit is to enable playing around with `wasm64-unknown-unknown` externally via `-Z build-std` in a way that's similar to the `wasm32-unknown-unknown` target. These targets are effectively the same and only differ in their pointer size, but wasm64 is much newer and has much less ecosystem/library support so it'll still take time to get wasm64 fully-fledged.
2021-11-14bootstap: create .cargo/config only if not presentAlberto Planas-9/+14
In some situations we should want on influence into the .cargo/config when we use vendored source. One example is #90764, when we want to workaround some references to crates forked and living in git, that are missing in the vendor/ directory. This commit will create the .cargo/config file only when the .cargo/ directory needs to be created.
2021-11-13Change paths for `dist` command to match the components they generateJoshua Nelson-9/+10
Before, you could have the confusing situation where the command to generate a component had no relation to the name of that component (e.g. the `rustc` component was generated with `src/librustc`). This changes the name to make them match up.
2021-11-10Update more rustc/libtest things for wasm64Alex Crichton-1/+1
* Add wasm64 variants for inline assembly along the same lines as wasm32 * Update a few directives in libtest to check for `target_family` instead of `target_arch` * Update some rustc codegen and typechecks specialized for wasm32 to also work for wasm64.
2021-11-09Rollup merge of #90685 - jyn514:remove-dead-code, r=Mark-SimulacrumMatthias Krüger-7/+1
x.py: remove fixme by deleting code As far as I can tell, this parameter was never used, so just delete it as unnecessary.
2021-11-09Rollup merge of #90683 - jyn514:compiler-docs, r=Mark-SimulacrumMatthias Krüger-16/+5
Make `compiler-docs` only control the default instead of being a hard off-switch This also fixes `x doc src/tools/clippy` when compiler-docs is disabled. See https://github.com/rust-lang/rust/pull/90354#issuecomment-955854508. r? ``@Mark-Simulacrum``
2021-11-09Allow to run a specific rustdoc-js* testGuillaume Gomez-33/+52
2021-11-08x.py: remove fixme by deleting codeJoshua Nelson-7/+1
As far as I can tell, this parameter was never used, so just delete it as unnecessary.
2021-11-08Make `compiler-docs` only control the default instead of being a hard off-switchJoshua Nelson-16/+5
This also fixes `x doc src/tools/clippy` when compiler-docs is disabled.
2021-11-03Provide standalone libc.a in self-contained for musl and wasi12101111-3/+3
2021-11-02Rollup merge of #90354 - xFrednet:00000-lets-deploy-clippy-docs, ↵Matthias Krüger-0/+2
r=Mark-Simulacrum Document clippy on nightly-rustc Adding Clippy's docs to nightly-rustc, based on commit 01cf0bde. This PR only adds `clippy_utils` to the documentation. I've decided to only document one crate for now, as `clippy_lints` etc. contain very specific and undocumented functions which aren't really reusable. I'm guessing that they would mostly clutter up the search results with little benefit. `./x.py --stage 1 doc src/tools/clippy` if working fine now after the help that ```````@jyn514``````` and ```````@ehuss``````` have provided. A big THANK YOU to them!
2021-11-01Rollup merge of #89929 - ↵Matthias Krüger-1/+9
yuvaldolev:handle-submodule-checkout-more-gracefully, r=Mark-Simulacrum Handling submodule update failures more gracefully from x.py Addresses #80498 Handling the case where x.py can't check out the right commit of a submodule, because the submodule has local edits that would be overwritten by the checkout, more gracefully. The error is printed in detail, with some hints on how to revert the local changes to the submodule.
2021-10-28Document clippy on nightly-rustcxFrednet-0/+2