about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-08-09Enable zstd for debug compression.Kyle Huey-4/+21
Set LLVM_ENABLE_ZSTD alongside LLVM_ENABLE_ZLIB so that --compress-debug-sections=zstd is an option. Use static linking to avoid a new runtime dependency. Add an llvm.libzstd bootstrap option for LLVM with zstd. Set it off by default except for the dist builder. Handle llvm-config --system-libs output that contains static libraries.
2024-08-09Make `Build::run` comment more accurateJakub Beránek-1/+2
2024-08-09don't try to find target tools on certain commandsonur-ozkan-9/+23
For commands like check/clean there is no need to check for target tools. Avoiding this check can also speed up the process. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-09call `Cargo::configure_linker` only for specific commandsonur-ozkan-1/+9
Calling `Cargo::configure_linker` unconditionally slows down certain commands (e.g., "check" command) without providing any benefit. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-09use absolute path for `config.toml`onur-ozkan-1/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-09add `builder-config` into tarball sourcesonur-ozkan-0/+6
This will be useful for certain scenarios where developers want to know how the tarball sources were generated. We also want this to check for CI rustc incompatible options on bootstrap. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-07Rollup merge of #128353 - ↵Matthias Krüger-1/+3
ferrocene:jonathanpallant/add-dependencies-to-copyright-file, r=Kobzol Change generate-copyright to generate HTML, with cargo dependencies included `x.py run generate-copyright` now produces `build/COPYRIGHT.html`. This includes a new format for in-tree dependencies, and also adds out-of-tree cargo dependencies. After consulting expert opinion, I have elected to include every top-level: * `*NOTICE*` * `*AUTHOR*` * `*LICENSE*` * `*LICENCE*`, and * `*COPYRIGHT*` file I can find - case-insensitive. This is because the cargo package metadata's `author` field is not a list of copyright holders and does not meet the requirements of the Apache-2.0 license (which says you must include a NOTICE file with the binary if one was supplied by the author) nor the MIT license (which says you must include 'the above copyright notice'). I believe it would be appropriate to include this file with every Rust release, in order to do an even better job of appropriately recognising the efforts of the authors of the first-party and third-party libraries we are using here. The output includes something like 524 copies of the Apache-2.0 text because they are not all identical. I think I count about 50 different variations by shasum - some differ in whitespace, while some have the boilerplate block at the bottom erroneously modified (don't modify the copy in the license, modify the copy you paste into your own source code!). Running `gzip` on the HTML file largely makes this problem go away, and the average browser is far happier with a ~6 MiB HTML file than the average Markdown viewer is with a ~6 MiB markdown file. But, if someone wants to, do they could submit a follow-up which de-dups the license text files and adds back-links to earlier identical copies (for some value of 'identical copy'). ```console $ xpy run generate-copyright $ cd build $ gzip -c COPYRIGHT.html > COPYRIGHT.gz $ xz -c COPYRIGHT.html > COPYRIGHT.xz $ ls -lh COPYRIGHT.* -rw-r--r-- 1 jonathan staff 241K 29 Jul 17:19 COPYRIGHT.gz -rw-r--r--@ 1 jonathan staff 6.6M 29 Jul 11:30 COPYRIGHT.html -rw-r--r-- 1 jonathan staff 59K 29 Jul 17:19 COPYRIGHT.xz ``` Here's an example [COPYRIGHT.gz](https://github.com/user-attachments/files/16416147/COPYRIGHT.gz).
2024-08-07bootstrap: clear miri's ui test deps when rustc changesRalf Jung-0/+8
2024-08-06Rollup merge of #128685 - bjorn3:rust_src_remove_leftover, r=onur-ozkanMatthias Krüger-4/+0
Remove the root Cargo.lock from the rust-src component The Cargo.lock in library/ should be used instead. Including the Cargo.lock for the root workspace is both unnecessary and confusing. Missed in https://github.com/rust-lang/rust/pull/128534
2024-08-06improve rustup check in `x setup`onur-ozkan-4/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-06remove redundant FIXMEsonur-ozkan-17/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-06unify path syncing logic for vendor and distonur-ozkan-35/+31
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-06generate-copyright: Produce HTML, not MarkdownJonathan Pallant-1/+1
This format works better with large amounts of structured data. We also mark which deps are in the stdlib
2024-08-06Update generate-copyrightJonathan Pallant-0/+2
This tool now scans for cargo dependencies and includes any important looking license files. We do this because cargo package metadata is not sufficient - the Apache-2.0 license says you have to include any NOTICE file, for example. And authors != copyright holders (cargo has the former, we must include the latter).
2024-08-05Rollup merge of #128686 - onur-ozkan:unnecessary-type-cast, r=KobzolMatthias Krüger-2/+1
fix the invalid argument type It was obviously wrong..
2024-08-05Rollup merge of #128631 - onur-ozkan:hotfix, r=Mark-SimulacrumMatthias Krüger-2/+12
handle crates when they are not specified for std docs Fixes a regression from https://github.com/rust-lang/rust/pull/128182. Resolves #128610
2024-08-05fix the invalid argument type in `helpers::get_closest_merge_base_commit`onur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-05Remove the root Cargo.lock from the rust-src componentbjorn3-4/+0
The Cargo.lock in library/ should be used instead. Including the Cargo.lock for the root workspace is both unnecessary and confusing.
2024-08-05Rollup merge of #127974 - onur-ozkan:force-std-builds, r=Mark-SimulacrumMatthias Krüger-8/+31
force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. https://github.com/rust-lang/rust/pull/127322#discussion_r1666418280. Blocker for https://github.com/rust-lang/rust/pull/122709.
2024-08-04Auto merge of #128534 - bjorn3:split_stdlib_workspace, r=Mark-Simulacrumbors-2/+8
Move the standard library to a separate workspace This ensures that the Cargo.lock packaged for it in the rust-src component is up-to-date, allowing rust-analyzer to run cargo metadata on the standard library even when the rust-src component is stored in a read-only location as is necessary for loading crates.io dependencies of the standard library. This also simplifies tidy's license check for runtime dependencies as it can now look at all entries in library/Cargo.lock without having to filter for just the dependencies of runtime crates. In addition this allows removing an exception in check_runtime_license_exceptions that was necessary due to the compiler enabling a feature on the object crate which pulls in a dependency not allowed for the standard library. While cargo workspaces normally enable dependencies of multiple targets to be reused, for the standard library we do not want this reusing to prevent conflicts between dependencies of the sysroot and of tools that are built using this sysroot. For this reason we already use an unstable cargo feature to ensure that any dependencies which would otherwise be shared get a different -Cmetadata argument as well as using separate build dirs. This doesn't change the situation around vendoring. We already have several cargo workspaces that need to be vendored. Adding another one doesn't change much. There are also no cargo profiles that are shared between the root workspace and the library workspace anyway, so it doesn't add any extra work when changing cargo profiles.
2024-08-04Update incorrect commentbjorn3-1/+1
2024-08-04Rollup merge of #128589 - onur-ozkan:llvm-configs, r=cuviperMatthias Krüger-3/+17
allow setting `link-shared` and `static-libstdcpp` with CI LLVM These options also affect `compiler/rustc_llvm` builds. They should be configurable even when using CI LLVM. r? ```@cuviper```
2024-08-04handle crates when they are not specified for std docsonur-ozkan-2/+12
This fixes a regression from https://github.com/rust-lang/rust/pull/128182. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-03Rollup merge of #128283 - lolbinarycat:bootstrap-custom-target, r=albertlarsan68Matthias Krüger-3/+14
bootstrap: fix bug preventing the use of custom targets the bug was caused by two factors: 1. only checking the RUST_TARGET_PATH form, not the full filepath form 2. indirectly trying to use the Debug presentation to get the file path
2024-08-03Remove another false-negative hidden by dead code changesMichael Goulet-4/+0
2024-08-03Promote aarch64-apple-darwin to Tier 1Evelyn Harthbrooke-1/+1
Per rust-lang/rfcs#3671.
2024-08-03allow setting `link-shared` and `static-libstdcpp` with CI LLVMonur-ozkan-3/+17
These options also affect `compiler/rustc_llvm` builds. They should be configurable even when using CI LLVM. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-02bootstrap: fix bug preventing the use of custom targetsbinarycat-3/+14
the bug was caused by two factors: 1. only checking the RUST_TARGET_PATH form, not the full filepath form 2. indirectly trying to use the Debug presentation to get the file path
2024-08-02Move the standard library to a separate workspacebjorn3-1/+7
This ensures that the Cargo.lock packaged for it in the rust-src component is up-to-date, allowing rust-analyzer to run cargo metadata on the standard library even when the rust-src component is stored in a read-only location as is necessary for loading crates.io dependencies of the standard library. This also simplifies tidy's license check for runtime dependencies as it can now look at all entries in library/Cargo.lock without having to filter for just the dependencies of runtime crates. In addition this allows removing an exception in check_runtime_license_exceptions that was necessary due to the compiler enabling a feature on the object crate which pulls in a dependency not allowed for the standard library. While cargo workspaces normally enable dependencies of multiple targets to be reused, for the standard library we do not want this reusing to prevent conflicts between dependencies of the sysroot and of tools that are built using this sysroot. For this reason we already use an unstable cargo feature to ensure that any dependencies which would otherwise be shared get a different -Cmetadata argument as well as using separate build dirs. This doesn't change the situation around vendoring. We already have several cargo workspaces that need to be vendored. Adding another one doesn't change much. There are also no cargo profiles that are shared between the root workspace and the library workspace anyway, so it doesn't add any extra work when changing cargo profiles.
2024-08-02Rollup merge of #128436 - GuillaumeGomez:update-sysinfo, r=clubby789Matthias Krüger-37/+93
Update sysinfo version to 0.31.2 I needed to update `memchr` version (which was pinned in https://github.com/rust-lang/rust/commit/36a16798f798eb59db21ff2a8a163135b4a599fe). So let's see if it triggers the linker issue. try-job: x86_64-mingw
2024-08-01Update sysinfo version to 0.31.2Guillaume Gomez-37/+93
2024-08-01Rollup merge of #128437 - onur-ozkan:handle-llvm-tools-properly, ↵Matthias Krüger-3/+34
r=albertlarsan68,Kobzol improve bootstrap to allow selecting llvm tools individually Everything works as before, + now bootstrap allows for individually selecting LLVM tools (e.g., `x dist opt llvm-dis`) to include in the dist artifact.
2024-07-31improve bootstrap to allow selecting llvm tools individuallyonur-ozkan-3/+34
Everything works as before, + now bootstrap allows for individually selecting LLVM tools (e.g., `x dist opt llvm-dis`) to include in the dist artifact. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-30Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68bors-4/+1
Bump bootstrap compiler to new beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-07-30set `force_recompile: true` if library is modifiedonur-ozkan-8/+31
This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29Rollup merge of #128342 - onur-ozkan:ci-env-usage, r=KobzolMatthias Krüger-8/+6
simplify the use of `CiEnv` self-explanatory
2024-07-29simplify the use of `CiEnv`onur-ozkan-8/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29ignore `crates` if running unit testsonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29remove the requirement of `Builder` arg in `doc::Std::new` functiononur-ozkan-18/+2
`crates` field is handled in the `Step::make_run` just like in any other `Std` implementation, so we don't need to resolve them in `Std::new`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29allow running `x doc` on std for no_std targetsonur-ozkan-8/+2
Since we now handle library crates properly, there's no need to panic for `no_std` targets anymore. `x doc library` now generates documentation for the `alloc` crate from standard library. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29handle no_std targets on std buildsonur-ozkan-8/+22
This change unifies the `Step::run_make` logic and improves it by skipping std specific crates for no_std targets. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29Rollup merge of #128269 - onur-ozkan:improve-cargo-invocations, ↵Matthias Krüger-117/+151
r=Mark-Simulacrum improve cargo invocations on bootstrap Fixes few of the `FIXME`s on cargo invocations and should be considered as blocker for https://github.com/rust-lang/rust/issues/128180.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-208/+166
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28step cfg(bootstrap)Mark Rousskov-4/+1
2024-07-28Auto merge of #128301 - matthiaskrgr:rollup-9fyf587, r=matthiaskrgrbors-92/+219
Rollup of 3 pull requests Successful merges: - #125889 (Add migration lint for 2024 prelude additions) - #128215 (Update the reference) - #128263 (rustdoc: use strategic ThinVec/Box to shrink `clean::ItemKind`) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-28Rollup merge of #128215 - ehuss:update-reference, r=KobzolMatthias Krüger-92/+219
Update the reference This updates the reference to use the new mdbook-spec preprocessor, which is a Cargo library inside the reference submodule. Note that this PR contains a bunch of bootstrap cleanup commits to assist with making sure the submodules are working correctly. All of the cleanup PRs should have a description in their commit. I'd be happy to move those to a separate PR if that makes review easier. The main changes for the reference are: - Move the `doc::Reference` bootstrap step out of the generic macro into a custom step. - This step needs to build rustdoc because the new mdbook-spec plugin uses rustdoc for generating links. - PATH is updated so that the rustdoc binary can be found. - rustbook now includes the mdbook-spec plugin as a dependency. - rustbook enables the mdbook-spec preprocessor. I did a bunch of testing with the various commands and setups, such as: - `submodules=true` and `submodules=false` - having all submodules deinitialized - not in a git repository However, there are probably thousands of different permutations of different commands, settings, and environments, so there is a chance I'm missing something.
2024-07-28Auto merge of #127799 - Kobzol:bootstrap-cmd-refactor-7, r=onur-ozkanbors-171/+167
Bootstrap command refactoring: make command output API more bulletproof (step 7) Continuation of https://github.com/rust-lang/rust/pull/127680. This PR modifies the API of running commands to make it more explicit when a command is expected to produce programmatically handled output. Now if you call just `run`, you cannot access the stdout/stderr by accident, because it will not be returned to the caller. This API change might be seen as overkill, let me know what do you think. In any case, I'd like to land the second commit, to make it harder to accidentally read stdout/stderr of commands that did not capture output (now you'd get an empty string as a result, but you should probably get a panic instead, if you try to read uncaptured stdout/stderr). Tracking issue: https://github.com/rust-lang/rust/issues/126819 r? `@onur-ozkan` try-job: x86_64-msvc
2024-07-27improve `check::{Std, Rustc}` to handle clippy properlyonur-ozkan-11/+37
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-27Rename require_and_update_submodule to require_submoduleEric Huss-25/+25
Just trying to be a little less verbose here.
2024-07-27Add clarifying documentation to require_and_update_submodule.Eric Huss-1/+4