about summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
AgeCommit message (Collapse)AuthorLines
2025-09-25bootstrap.py: Respect build.jobs while building bootstrap toolJ. Neuschäfer-0/+2
On resource-constrained systems, it is vital to respect the value of build.jobs, in order to avoid overwhelming the available memory.
2025-09-16Do not use `git -C dir`Samuel Tardieu-3/+3
Older versions of git (≤ 1.8.5) do not support the `-C dir` global option. Use the `cwd` optional argument when using Python's `subprocess` functionality instead.
2025-09-16Auto merge of #146614 - Zalathar:rollup-hcxvdi1, r=Zalatharbors-1/+2
Rollup of 9 pull requests Successful merges: - rust-lang/rust#145095 (Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_`) - rust-lang/rust#145960 (Split `FnCtxt::report_args_error` into subfunctions) - rust-lang/rust#146402 (interpret: fix overlapping aggregate initialization) - rust-lang/rust#146466 (llvm-wrapper: other cleanup) - rust-lang/rust#146574 (compiletest: Enable new-output-capture by default) - rust-lang/rust#146599 (replace some `#[const_trait]` with `const trait`) - rust-lang/rust#146601 (compiletest: Make `./x test --test-args ...` work again) - rust-lang/rust#146608 (improve internal bootstrap docs) - rust-lang/rust#146609 (bootstrap: lower verbosity of cargo to one less than bootstrap's) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-15bootstrap: lower verbosity of cargo to one less than bootstrap'sbinarycat-1/+2
the main thing this does is eliminate the "Fresh ..." output when `--verbose` is only passed once.
2025-09-14bootstrap.py: disable incremental build for bootstrap in CIbinarycat-0/+3
2025-08-24bootstrap.py: follow up more 'tidy' insistence (string quotes).Havard Eidnes-2/+2
2025-08-23bootstrap.py: follow up tidy output from CI.Havard Eidnes-2/+3
I thought tidy would be more allergic to 80-coloumn overflow, but so be it.
2025-08-23bootstrap.py: Improve CPU detection on NetBSD,Havard Eidnes-1/+12
...and add adaptation of detection for some arm variants.
2025-07-18bootstrap: Detect musl hostsJens Reidel-1/+6
Currently, all non-Android Linux hosts are assumed to be using glibc. This obviously isn't very portable and will currently result in downloading a stage0 toolchain for glibc even on musl hosts. There are multiple ways to detect musl somewhat reliably, but the easiest option is to check for the python SOABI config variable, which has values like "cpython-313-x86_64-linux-gnu" or "cpython-313-powerpc64-linux-musl". Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-0/+1
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-05-27bootstrap: Remove `bin_root` from `PATH`Vadim Petrochenkov-1/+0
2025-04-14Rollup merge of #139804 - WaffleLapkin:real, r=jieyouxuMatthias Krüger-1/+1
use `realpath` in `bootstrap.py` when creating build-dir Fixes #139800 r? `@jieyouxu` My use case for `./build` being a symlink is this: my "default" ~~partition~~ btrfs subvolume is snapshotted/backed up. I don't want to backup target-likes, so I move them to a special subvolume which isn't backed up. `./build` is a symlink into that subvolume. (`build.build-dir` configuration is not fully sufficient, it is still nice to be able to check build files with `ls ./build` or call tools from there)
2025-04-14use `realpath` in `bootstrap.py` when creating build-dirWaffle Lapkin-1/+1
this avoids crashes when `./build` is a symlink to a non-existent directory.
2025-04-01replace commit placeholder in vendor status with actual commitbit-aloo-1/+26
2025-03-17change config.toml to bootstrap.toml for bootstrap modulebit-aloo-9/+17
2025-01-24Don't move ownership of job objectChris Denton-3/+0
2025-01-20Add logic to override profile for non git sourcesTanvi Pooranmal Meena-0/+5
2025-01-13bootstrap.py: build bootstrap binary with `--features=tracing` if ↵许杰友 Jieyou Xu (Joe)-0/+4
`BOOTSTRAP_TRACING` env var is set
2024-12-05Rollup merge of #133821 - Kobzol:replace-black-with-ruff, r=onur-ozkanGuillaume Gomez-270/+393
Replace black with ruff in `tidy` `ruff` can both lint and format Python code (in fact, it should be a mostly drop-in replacement for `black` in terms of formatting), so it's not needed to use `black` anymore. This PR removes `black` and replaces it with `ruff`, to get rid of one Python dependency, and also to make Python formatting faster (although that's a small thing). If we decide to merge this, we'll need to "reformat the world" - `ruff` is not perfectly compatible with `black`, and it also looks like `black` was actually ignoring some files before. I tried it locally (`./x test tidy --extra-checks=py:fmt --bless`) and it also reformatted some code in subtrees (e.g. `clippy` or `rustc_codegen_gcc`) - I'm not sure how to handle that.
2024-12-05Update comments on Windows job objectsChris Denton-0/+2
2024-12-04Reformat Python code with `ruff`Jakub Beránek-270/+393
2024-11-30bootstrap: show diagnostics relative to rustc src dirRalf Jung-1/+2
2024-10-23do not remove `.cargo` directroyonur-ozkan-3/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-17delete sub directory "debug" to not delete the change-id fileonur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-07Rollup merge of #129594 - lolbinarycat:explain-curl-options, r=albertlarsan68Matthias Krüger-7/+14
explain the options bootstrap passes to curl also fixes a discrepancy where the rust side doesn't use -L docs are only on the rust side, since duplicated prose has a tendancy to get out-of-sync, and also because there are talks of removing the python script all together eventually.
2024-09-05bootstrap: pass long options to curlbinarycat-7/+10
2024-08-25explain the options curl passes to bootstrapbinarycat-0/+4
also fixes a discrepency where the rust side doesn't use -L must not be merged before #129134 docs are only on the rust side, since duplicated prose has a tendancy to get out-of-sync, and also because there are talks of removing the python script all together eventually.
2024-08-25Rollup merge of #129459 - onur-ozkan:separate-stage0-bins, r=KobzolMatthias Krüger-9/+17
handle stage0 `cargo` and `rustc` separately This change allows setting either `build.cargo` or `build.rustc` without requiring both to be set simultaneously, which was not possible previously. To try it, set `build.rustc` without setting `build.cargo`, and try to bootstrap on clean build. Blocker for https://github.com/rust-lang/rust/pull/129152
2024-08-23use tuples for semver, not floatsbinarycat-2/+5
2024-08-23handle stage0 cargo and rustc separatelyonur-ozkan-9/+17
This change allows setting either `build.cargo` or `build.rustc` without requiring both to be set simultaneously, which was not possible previously. To try it, set `build.rustc` without setting `build.cargo`, and try to bootstrap on clean build. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-16bootstrap: improve error recovery flags to curlbinarycat-1/+7
alternative to #128459 fixes #110178
2024-07-07use "bootstrap" instead of "rustbuild" in comments and docsonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-19patch `rust-lld` and `ld.lld` on NixOSDianQK-4/+4
2024-06-03wipe bootstrap build before switching to bumped rustconur-ozkan-1/+17
Technically, wiping bootstrap builds can increase the build time. But in practice, trying to manually resolve post-bump issues and even accidentally removing the entire build directory will result in a much greater loss of time. After all, the bootstrap build process is not a particularly lengthy operation. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-09use stage0 file in `bootstrap.py`onur-ozkan-14/+24
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-22suggest `x.py vendor` instead of `cargo vendor`onur-ozkan-7/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-05Rollup merge of #122334 - GuillaumeGomez:vendor-cg_gcc, r=Mark-SimulacrumGuillaume Gomez-0/+1
Vendor rustc_codegen_gcc I used https://github.com/rust-lang/rust/pull/115274 as base for this update. r? `@bjorn3`
2024-03-22Fix nix patching for LLVM 18Nilstrieb-3/+9
LLVM 18 now ships `libLLVM*.so.*`, so `.so` is not the sole extension anymore, which breaks the dylib detection. Oops! Adjust it to only search for `.so` somewhere.
2024-03-11Vendor rustc_codegen_gccGuillaume Gomez-0/+1
2024-03-05Add a build option to specify the bootstrap cacheLuca Barbato-1/+3
Setting the bootstrap cache path to an external location can help to speed up builds in cases where the build directory is not kept between builds, e.g. in CI or other automated build systems.
2024-03-04Allow bootstrap cache path to be set by environment variableJeffery To-1/+1
This allows the bootstrap cache path to be set by the `RUSTC_BOOTSTRAP_CACHE` environment variable. Setting the bootstrap cache path to an external location can help to speed up builds in cases where the build directory is not kept between builds, e.g. in CI or other automated build systems.
2024-01-28Add instructions of how to use pre-vendored 'rustc-src'Marek 'seqre' Grzelak-1/+10
2024-01-20Capture the rationale for -Zallow-features= in bootstrap.pyDavid Tolnay-8/+20
2024-01-18Set RUSTC_BOOTSTRAP=1 consistentlyonur-ozkan-8/+11
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-15Consistently unset RUSTC_BOOTSTRAP when compiling bootstrapDavid Tolnay-0/+13
2023-12-16make x.py clippy download and use beta clippyasquared31415-16/+0
2023-12-05add comment about keeping flags in sync between bootstrap.py and bootstrap.rsRalf Jung-0/+2
2023-11-26give dev-friendly error message for incorrect config profilesonur-ozkan-0/+5
before this change, an incorrect profile would result in the following error: ```sh ... ... File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap with open(include_path) as included_toml: ^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/defaults/config.aaaa.toml' ``` with this change, the error message is now: ```sh ... ... File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap raise Exception("Unrecognized profile '{}'. Check src/bootstrap/defaults" Exception: Unrecognized profile 'aaaa'. Check src/bootstrap/defaults for available options. ``` Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-09chore(bootstrap): capitalize {error, warning, info, note} tagsonur-ozkan-8/+8
This should enhance the readability. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-08Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilationonur-ozkan-0/+7
Note that RUSTFLAGS_BOOTSTRAP should always be added to the end of RUSTFLAGS to be actually effective (e.g., if we have `-Dwarnings` in RUSTFLAGS, passing `-Awarnings` from RUSTFLAGS_BOOTSTRAP should override it). Signed-off-by: onur-ozkan <work@onurozkan.dev>