about summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
AgeCommit message (Collapse)AuthorLines
2023-07-12Fix bootstrap.py uname error.Edgar Luque-1/+1
The x.py script fails with `ValueError: too many values to unpack (expected 3)` when uname -smp gives more than 3 words
2023-06-26bootstrap: rename 'user' profile to 'dist'clubby789-1/+7
2023-06-26Rollup merge of #111326 - he32:netbsd-aarch64-be, r=oli-obkMatthias Krüger-0/+1
Add support for NetBSD/aarch64-be (big-endian arm64).
2023-06-25fix some bugsjyn-0/+2
- fix tests when `--build` is set - don't leak `config.example.toml` fd - don't crash if `config.toml` doesn't exist yet
2023-06-24Don't test the profile override hackjyn-12/+15
It generates invalid TOML. I want to get rid of it eventually, but this avoids the issue in the meantime.
2023-06-23Test color/verbose/warnings properlyjyn-15/+19
These weren't being passed in to bootstrap consistently before; in particular `serialize_and_parse` forgot to pass them in.
2023-06-23Test cargo arguments passed by bootstrap.pyjyn-61/+64
This moves a lot of code around, but the logic itself is not too terribly complicated. - Move almost all logic in `def bootstrap` to the `RustBuild` class, to avoid mixing setting configuration with running commands - Update various doctests to the new (more complete) RustBuild config. In particular, don't pretend that `bin_root` supports `build` being unset. - Change `parse_args` not to use a global, to allow testing it - Set BUILD_DIR appropriately so bootstrap.py doesn't panic because cargo isn't found
2023-06-16Apply changes to fix python linting errorsTrevor Gross-2/+2
2023-05-31Rollup merge of #112089 - Kobzol:bootstrap-warnings, r=jyn514Matthias Krüger-3/+8
Add `--warnings warn` flag to `x.py` So that bootstrap itself can be built with warnings not being treated as errors. Fixes: https://github.com/rust-lang/rust/issues/76805 r? ```@jyn514```
2023-05-31Rollup merge of #111979 - jyn514:cargoflags, r=albertlarsan68Matthias Krüger-0/+4
Respect CARGOFLAGS in bootstrap.py This makes it possible to pass flags to bootstrap itself, for consistency with std/rustc: https://github.com/rust-lang/rust/blob/04265621f9a82cfc2fc2278b935dcc5d4a1c39b7/src/bootstrap/builder.rs#L1446-L1447 Like RUSTFLAGS, this doesn't support CARGOFLAGS_BOOTSTRAP: https://github.com/rust-lang/rust/blob/6674dcda7a1da4c66e0aa0cfc67b27e42f4ebb34/src/bootstrap/bootstrap.py#L883-L884 I found this useful recently when I wanted to pass `-Zsparse-registry` to an old checkout of the compiler from before it was stabilized in cargo.
2023-05-30Add `--warnings warn` flag to `x.py`Jakub Beránek-3/+8
So that bootstrap itself can be built with warnings not being treated as errors.
2023-05-29Fix linkage for large binaries on mips64 platforms ...Ximin Luo-0/+6
... by enabling xgot feature Co-Authored-By: Zixing Liu <zixing.liu@canonical.com>
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-25respect CARGOFLAGS in bootstrap.pyjyn-0/+4
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-07Add support for NetBSD/aarch64-be (big-endian arm64).Havard Eidnes-0/+1
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