about summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
AgeCommit message (Collapse)AuthorLines
2023-01-11Revert "warn newer available version of the x tool"J Haigh-1/+2
2022-12-31remove commented out old codeDebugSteven-1/+0
2022-12-31remove leading comma from macro expansionDebugSteven-2/+2
2022-12-29Respect --set=target.platform during buildMarcus Calhoun-Lopez-0/+3
Avoid quoting targets that do not contain a period. See https://github.com/rust-lang/rust/commit/1532fd8cd0db93f469e414f9da31ef083a44fcba `--set=target.platform.linker` is ignored if RUSTFLAGS is not set. Undo parts of https://github.com/rust-lang/rust/commit/d1291dc8b4ac9a98ff1d286402559e4ba5d68488
2022-11-29Run patchelf also on rust-analyzer-proc-macro-srv.Joe Neeman-0/+1
2022-09-17Auto merge of #101949 - matthiaskrgr:rollup-xu5cqnd, r=matthiaskrgrbors-1/+2
Rollup of 7 pull requests Successful merges: - #101093 (Initial version of 1.64 release notes) - #101713 (change AccessLevels representation) - #101821 (Bump Unicode to version 15.0.0, regenerate tables) - #101826 (Enforce "joined()" and "joined_with_noop()" test) - #101835 (Allow using vendoring when running bootstrap from outside the source root) - #101942 (Revert "Copy stage0 binaries into stage0-sysroot") - #101943 (rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-16Improve handing of env vars during bootstrap processChris Wailes-4/+11
This CL modifies the handing of env vars during the bootstrap process in two ways: 1. Replaces '-' characters with '_' characters in target names to increase compatibility with different shells 2. Passes Stage0 snapshot compiler related env vars to early invocations of Cargo
2022-09-14Allow using vendoring when running bootstrap from outside the current ↵Joshua Nelson-1/+2
working directory
2022-09-01Rollup merge of #100852 - Samyak2:samyak/100459, r=Mark-SimulacrumMatthias Krüger-0/+2
Use `getuid` to check instead of `USER` env var in rustbuild This makes it consistent with `x.py` as changed in #95671 Fixes #100459
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-26Use getuid to check instead of USER env var in rustbuildSamyak Sarnayak-0/+2
This makes it consistent with `x.py` as changed in #95671 Fixes #100459
2022-07-05Fix typo in src/bootstrap/bootstrap.pyChris Denton-1/+1
Co-authored-by: Marco Colombo <mar.colombo13@gmail.com>
2022-07-04bootstrap.py: Always use `.exe` for WindowsChris Denton-0/+4
This ensure that it will run the Windows executable if other files in the directory (such as Linux executables) have the same file name minus the extension.
2022-07-03Auto merge of #98373 - joshtriplett:bootstrap-locking, r=jyn514bors-41/+0
Move locking from bootstrap.py to rust bootstrap, using fd-lock Helps with https://github.com/rust-lang/rust/issues/94829.
2022-06-30Add a `--build-dir` flag to rustbuildThom Chiovoloni-1/+2
2022-06-27Move locking from bootstrap.py to rust bootstrap, using fd-lockJosh Triplett-41/+0
2022-06-26Respect --color when building rustbuild itselfJoshua Nelson-2/+8
2022-06-21Remove vendoring support when building from git sourcesJoshua Nelson-41/+17
This is difficult to support without submodule handling in bootstrap.py, because cargo will refuse to vendor sources unless it knows the Cargo.toml files of all tools in tree. Moving vendor support to rustbuild means that rustbuild will be built without vendoring. Rather than trying to solve this, just remove support altogether and require people to use `rustc-src` if they want vendoring (or run `cargo vendor` manually).
2022-06-21Fully remove submodule handling from bootstrap.pyJoshua Nelson-105/+1
These submodules were previously updated in python because Cargo gives a hard error if toml files are missing from the workspace: ``` error: failed to load manifest for workspace member `/home/jnelson/rust-lang/rust/src/tools/rls` Caused by: failed to read `/home/jnelson/rust-lang/rust/src/tools/rls/Cargo.toml` Caused by: No such file or directory (os error 2) failed to run: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /home/jnelson/rust-lang/rust/src/bootstrap/Cargo.toml ``` However, bootstrap doesn't actually need to be part of the workspace. Remove it so we can move submodule handling fully to Rust, avoiding duplicate code between Rust and Python. Note that this does break `cargo run`; it has to be `cd src/bootstrap && cargo run` now. Given that we're planning to make the main entrypoint a shell script (or rust binary), I think this is a good tradeoff for reduced complexity in bootstrap.py.
2022-06-09keep the same config values in stage0 between invocationsPietro Albini-1/+1
This commit allows users to change the contents of the "config" key in src/stage0.json without having it overridden the next time the bump-stage0 tool is executed.
2022-06-07Move beta rustfmt downloads to rustbuildJoshua Nelson-63/+21
2022-06-05Auto merge of #93717 - pietroalbini:pa-ci-profiler, r=Mark-Simulacrumbors-0/+3
Add build metrics to rustbuild This PR adds a new module of rustbuild, `ci_profiler`, whose job is to gather as much information as possible about the CI build as possible and store it in a JSON file uploaded to `ci-artifacts`. Right now for each step it collects: * Type name and debug representation of the `Step` object. * Duration of the step (excluding child steps). * Systemwide CPU stats for the duration of the step (both single core and all cores). * Which child steps were executed. This is capable of replacing both the scripts to collect CPU stats and the `[TIMING]` lines in build logs (not yet removed, until we port our tooling to use the CI profiler). The format is also extensible to be able in the future to collect more information. r? `@Mark-Simulacrum`
2022-05-29Re-add help_on_error for download-ci-llvmbinggh-10/+8
Remove dead code Missing } ./x.py fmt Remove duplicate check Recursively remove all usage of help_on_error
2022-05-25Remove download-rustc handling from bootstrap.pyJoshua Nelson-53/+2
2022-05-25Move download-rustc from bootstrap.py to rustbuildJoshua Nelson-65/+38
- Remove download-rustc handling from bootstrap.py - Allow a custom `pattern` in `builder.unpack()` - Only download rustc once another part of bootstrap depends on it. This is somewhat necessary since the download functions rely on having a full `Builder`, which isn't available until after config parsing finishes.
2022-05-24Rollup merge of #97290 - jyn514:fast-submodules, r=Mark-SimulacrumYuki Okushi-19/+11
Turn on `fast_submodules` unconditionally I don't know why anyone would turn this off; doing so makes builds much slower (nearly a 60x slowdown according to #49057). Remove the option to do so, which makes bootstrap a little easier to maintain. Bootstrap continues to allow you to manage submodules manually by setting `submodules = false`.
2022-05-23Turn on `fast_submodules` unconditionallyJoshua Nelson-19/+11
I don't know why anyone would turn this off; doing so makes builds much slower (nearly a 60x slowdown according to #49057). Remove the option to do so, which makes bootstrap a little easier to maintain. Bootstrap continues to allow you to manage submodules manually by setting `submodules = false`.
2022-05-22Rollup merge of #97277 - jyn514:no-unstable-for-bootstrap, r=Mark-SimulacrumJack Huey-1/+0
Avoid accidentally enabling unstable features in compilers (take 2) This allows rustbuild to control whether crates can use nightly features or not. It also prevents rustbuild from using nightly features itself. This is #92261, but I fixed the CI error.
2022-05-22Avoid accidentally enabling unstable features in compilers (take 2)Joshua Nelson-1/+0
This allows rustbuild to control whether crates can use nightly features or not. It also prevents rustbuild from using nightly features itself.
2022-05-15Auto merge of #96602 - TApplencourt:patch-1, r=Mark-Simulacrumbors-18/+35
boostrap.py use curl by default Fixes #61611
2022-05-08Auto merge of #96457 - yungkneez:fix-bootstrap, r=Mark-Simulacrumbors-0/+4
Initialize rust-analyzer submodule on bootstrap Fixes #96456
2022-05-02add build metrics, to gather ci stats from x.pyPietro Albini-0/+3
This tool will generate a JSON file with statistics about each individual step to disk. It will be used in rust-lang/rust's CI to replace the mix of scripts and log scraping we currently have to gather this data.
2022-05-01Use curl by defaultThomas Applencourt-18/+35
2022-05-01Initialize rust-analyzer submodule on bootstrapyungkneez-0/+4
2022-04-24Move download-ci-llvm to rustbuildJoshua Nelson-149/+0
This attempts to keep the logic as close to the original python as possible. `probably_large` has been removed, since it was always `True`, and UTF-8 paths are no longer supported when patching files for NixOS. I can readd UTF-8 support if desired. Note that this required making `llvm_link_shared` computed on-demand, since we don't know whether it will be static or dynamic until we download LLVM from CI.
2022-04-19Rollup merge of #95809 - ytmimi:llvm_stamp_typo, r=Mark-SimulacrumDylan DPC-1/+1
Fix typo in bootstrap.py
2022-04-13Rollup merge of #95885 - gimbles:patch-1, r=Mark-SimulacrumDylan DPC-1/+5
Improve error message in case of missing checksum # Fixes #94217
2022-04-13Improve error message when there's no checksumgimbles-1/+5
2022-04-12Rollup merge of #95671 - gimbles:master, r=Mark-Simulacrumfee1-dead-2/+2
feat: Allow usage of sudo [while not accessing root] in x.py # Fixes This PR should fix #93344 # Info Allows usage of sudo (while not accessing root) in x.py
2022-04-11Auto merge of #95796 - bzEq:bzEq/curl-redirect, r=Dylan-DPCbors-0/+1
[bootstrap.py] Instruct curl to follow redirect Some mirror RUSTUP_DIST_SERVER (like https://mirrors.sjtug.sjtu.edu.cn/rust-static) perform redirection when downloading stage0 compiler. Curl should be able to follow that.
2022-04-10Allow usage of sudo while not accessing rootgimbles-2/+2
2022-04-09Check for git submodules in non-git source tree.Eric Huss-2/+13
2022-04-08Fix typo in bootstrap.pyYacin Tmimi-1/+1
2022-04-08[bootstrap.py] Instruct curl to follow redirectKai Luo-0/+1
Some RUSTUP_DIST_SERVER perform redirection when downloading stage0 compiler. Curl should be able to follow that.
2022-03-23bootstrap.py: nixos check in /etc/os-release with quotesBenjamin Herr-1/+1
Per https://www.freedesktop.org/software/systemd/man/os-release.html, > Variable assignment values must be enclosed in double or single quotes > if they include spaces, semicolons or other special characters outside > of A–Z, a–z, 0–9. (Assignments that do not include these special > characters may be enclosed in quotes too, but this is optional.) So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`. One of these is necessary between nixos/nixpkgs#162168 and nixos/nixpkgs#164068, but this seems more correct either way.
2022-03-09Fallback to top-level config.toml if not present in current directoryJoshua Nelson-5/+7
This also preserves the behavior where x.py will only give a hard error on a missing config file if it was configured through `--config` or RUST_BOOTSTRAP_CONFIG. It also removes the top-level fallback for everything except the default path.
2022-03-07Don't depend on python for RUST_BOOTSTRAP_CONFIGJoshua Nelson-2/+0
2022-03-07Move some more bootstrap logic from python to rustJoshua Nelson-2/+1
Same rationale as https://github.com/rust-lang/rust/pull/76544; it would be nice to make python entirely optional at some point. This also removes $ROOT as an option for the build directory; I haven't been using it, and like Alex said in https://github.com/rust-lang/rust/pull/76544#discussion_r488248930 it seems like a misfeature. This allows running `cargo run` from src/bootstrap, although that still gives lots of compile errors if you don't use the beta toolchain.
2022-02-12Suggest disabling download-ci-llvm option if url fails to downloadBadel2-8/+20
2022-02-07bootstrap: prefer using '--config' over 'RUST_BOOTSTRAP_CONFIG'Muhammad Falak R Wani-2/+2
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>