summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
AgeCommit message (Collapse)AuthorLines
2023-05-26Auto merge of #111562 - clubby789:speedup-bootstrap-py, r=jyn514bors-49/+44
Improve startup time of bootstrap ~~If the user has a `build/host` symlink set up, we can determine the target triple by reading it rather than invoking rustc. This significantly reduces startup time of bootstrap once any kind of build has been done~~ New approach explained below ``` ➜ hyperfine -p 'git checkout -q master' -N './x.py -h' -r 50 Benchmark 1: ./x.py -h Time (mean ± σ): 140.7 ms ± 2.6 ms [User: 99.9 ms, System: 39.3 ms] Range (min … max): 136.8 ms … 149.6 ms 50 runs ➜ rust git:(master) hyperfine -p 'git checkout -q speedup-bootstrap-py' -N './x.py -h' -r 50 Benchmark 1: ./x.py -h Time (mean ± σ): 95.2 ms ± 1.5 ms [User: 67.7 ms, System: 26.7 ms] Range (min … max): 92.9 ms … 99.6 ms 50 runs ``` Also a small microoptimisation in using string splitting rather than regex when reading toml, which saves a few more milliseconds (2-5 testing locally), but less important. Profiling shows the remaining runtime is around half setting up the Python runtime, and the vast majority of the remaining time is spent in subprocess building and running bootstrap itself, so probably can't be improved much further.
2023-05-26Improve startup time for bootstrap.pyclubby789-49/+44
2023-05-19Set the timestamp of downloaded stage0 files ...Ximin Luo-1/+1
... using server-reported timestamp. This allows us to track changes to the downloaded artifact more easily and in a more reproducible manner. Co-authored-by: Zixing Liu <zixing.liu@canonical.com>
2023-05-01Make x.py work again in most (all?) casesAlbert Larsan-1/+19
Wrap all of x.py in `if __name__ == '__main__':` to avoid problems with `multiprocessing` Make the pool sizing better
2023-04-30Auto merge of #110427 - Nilstrieb:parallel-bootstrap-startup, r=albertlarsan68bors-15/+86
Parallelize initial Rust download in bootstrap Parallelize the initial download of Rust in `bootstrap.py` `time ./x.py --help` after `rm -r build` Before: 33s After: 27s
2023-04-30Parallelize initial rust extractionNilstrieb-2/+68
This is quite slow and embarassingly parallel, even in python. This speeds up the initial bootstrap build by about 5-10s.
2023-04-30Rollup merge of #110999 - clubby789:bootstrap-stderr, r=Mark-SimulacrumMatthias Krüger-33/+43
Output some bootstrap messages on stderr Fixes #110995
2023-04-29Output some bootstrap messages on stderrclubby789-33/+43
2023-04-29windows: kill rust-analyzer-proc-macro-srv before deleting stage0 directoryjyn-6/+29
This fixes the following recurring error on windows: ``` Traceback (most recent call last): File "C:\Users\jyn\src\rust\x.py", line 29, in <module> bootstrap.main() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 963, in main bootstrap(args) File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 927, in bootstrap build.download_toolchain() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 437, in download_toolchain shutil.rmtree(bin_root) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree return _rmtree_unsafe(path, onerror) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\jyn\\src\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\rust-analyzer-proc-macro-srv.exe' ```
2023-04-27Comment round #1John Kelly-2/+3
2023-04-27Skip rustc version detection on macOSJohn Kelly-13/+18
2023-04-22Group entire build steps in the gha logsOli Scherer-2/+8
2023-04-19Rollup merge of #110429 - jsoref:spelling-src-bootstrap, r=albertlarsan68Matthias Krüger-1/+1
Spelling src bootstrap The various src/* items seem slightly disparate, so I'm doing src/* individually. split from #110392
2023-04-17Spelling src/bootstrapJosh Soref-1/+1
* although * correct * granular * libunwind * repository * section Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-16Extract variableNilstrieb-4/+5
2023-04-16bootstrap.py: Use loop for `_download_component_helper`Nilstrieb-10/+11
2023-04-16bootstrap.py: Create cache before downloadNilstrieb-8/+11
This make `_download_component_helper` "pure".
2023-04-16chore: allow `cargo` to have its own workspaceWeihang Lo-1/+2
This also * bumps cargo to the latest in rust-lang/cargo. * adds 0BSD to allowed list of licenses Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org>
2023-04-11Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiserMichael Goulet-0/+1
Initial support for loongarch64-unknown-linux-gnu Hi, We hope to add a new port in rust for LoongArch. LoongArch intro LoongArch is a RISC style ISA which is independently designed by Loongson Technology in China. It is divided into two versions, the 32-bit version (LA32) and the 64-bit version (LA64). LA64 applications have application-level backward binary compatibility with LA32 applications. LoongArch is composed of a basic part (Loongson Base) and an expanded part. The expansion part includes Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX). Currently the LA464 processor core supports LoongArch ISA and the Loongson 3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit high-performance processor core. It can be used as a single core for high-end embedded and desktop applications, or as a basic processor core to form an on-chip multi-core system for server and high-performance machine applications. Documentations: ISA: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html ABI: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html More docs can be found at: https://loongson.github.io/LoongArch-Documentation/README-EN.html Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally. I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
2023-04-04Add LLVM target and cputype matching for loongarch64zhaixiaojuan-0/+1
2023-03-28Set LIBPATHKai Luo-0/+3
2023-02-11emit JSON output for building of bootstrap itselfZephaniah Ong-0/+4
2023-02-09Rollup merge of #107808 - kadiwa4:built-unsuccessfully, r=albertlarsan68Matthias Krüger-1/+3
bootstrap.py: fix build-failure message A small mistake I did. Corrects #107470, fixes #107804 r? `@albertlarsan68` (since you reviewed the last one)
2023-02-08bootstrap.py: fix build-failure messageKaDiWa-1/+3
2023-02-08 x.py fails all downloads that use a tempdir with snap curl #107722Tharun Suresh-8/+10
2023-01-31assert that `should_fix_bins_and_dylibs` has been runKaDiWa-39/+50
2023-01-30bootstrap: --help handlingKaDiWa-23/+24
2023-01-30bootstrap script: slight cleanupKaDiWa-86/+70
2023-01-27Fix woriding from `rustbuild` to `bootstrap`chansuke-1/+1
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