summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
AgeCommit message (Collapse)AuthorLines
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>
2023-10-01Rollup merge of #116292 - onur-ozkan:warn-wrong-sources, r=clubby789Matthias Krüger-0/+6
warn if source is not either a git clone or a dist tarball When the repository is downloaded directly via HTTP(as in #115041), builds may fail due to missing submodules. This PR adds a check that warns people in such cases.
2023-09-30warn if source is not either a git clone or a dist tarballonur-ozkan-0/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-25ref(bootstrap.py): add `eprint` functionPouriya Jahanbakhsh-49/+41
just like `print` but for `stderr`
2023-09-21added support for GNU/HurdSamuel Thibault-1/+3
2023-09-13Adjust commentKai Luo-2/+2
2023-09-13Adjust commentKai Luo-2/+2
2023-09-13Add comment to elaborateKai Luo-0/+6
2023-09-13Make AIX known by bootstrapKai Luo-0/+2
2023-08-31Auto merge of #115323 - onur-ozkan:curl-download-checksum-fix, r=Mark-Simulacrumbors-10/+9
avoid stdout redirection on `curl` executions Avoid redirecting the curl output directly to the stdout. This alteration affects the integrity of the file during the retry process, as it also redirects the logs from the retries. Consequently, this leads to the bootstrap process failing because of an invalid checksum. For more information, see the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/checksum.20errors) Fixes #115275
2023-08-28avoid stdout redirection on `curl` executionsonur-ozkan-10/+9
Avoid redirecting the curl output directly to the stdout. This alteration affects the integrity of the file during the retry process, as it also redirects the logs from the retries. Consequently, this leads to the bootstrap process failing because of an invalid checksum. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-08-23Accommodate tidy.Felix S. Klock II-9/+7
In addition: Incorporated some review feedback (namely, removed a useless initial assignment to True that was never read), and unified code a bit more between bootstrap.py and download.rs (by using the same variable name for the same concept).
2023-08-22Better diagnostics for people using nix subshell on non-NixOS.Felix S. Klock II-4/+19
1. Turned patch-binaries-for-nix from a boolean into a ternary flag: true, false, and unset. 2. When patch-binaries-for-nix is unset, we continue with the existing NixOS detection heuristic (look for nixos in /etc/os-release, if present), but if we are not atop NixOS, then issue a note if we see the IN_NIX_SHELL environment variable telling the user to consider setting patch-binaries-for-nix explicitly.
2023-08-22drive-by fix to Python doc comment.Felix S. Klock II-1/+1
2023-08-22Always use `os-release` rather than `/lib` to detect `NixOS`Ethan Brierley-7/+2
[Two users over on zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Bootstrapping.20on.20NixOS) bumped into issues where NixOS wasn't being properly detected. I believe this was caused by the presence of `/lib` on their machines. `/lib` is not standard on NixOS but can still be created by users or scripts. We are already checking `/etc/os-release`. The presence of `ID=nixos` in it's output should be trustworthy and we shouldn't then go on to also check for `/lib`.