about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2023-10-22add bootstrap flag `--skip-stage0-validation`onur-ozkan-1/+6
This change introduces the --skip-stage0-validation flag, which permits the use of any desired version of the stage0 compiler without verifying its version. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-22re-enable stage0 compiler version checkonur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-19fix(bootstrap) info message show correct path nowVitaliy Busko-1/+1
2023-10-17Simplify BehaviorOnFailureJakub Beránek-14/+17
2023-10-17Rename Supress variantJakub Beránek-5/+9
2023-10-17Remove usages of `Config::try_run`Jakub Beránek-15/+13
Commands should be run on Builder, if possible.
2023-10-17Add output mode to BootstrapCommandJakub Beránek-54/+76
2023-10-17Add behavior on failure to BootstrapCommandJakub Beránek-37/+37
2023-10-17Add BootstrapCommand and `run_cmd`Jakub Beránek-9/+47
2023-10-17Don't pass `-stdlib=libc++` when building C files on macOSZalathar-4/+3
When using *Command Line Tools for Xcode* version 15.0, clang will warn about `argument unused during compilation: '-stdlib=libc++'` if this flag is present when compiling C files only (i.e. no C++ files). To avoid this warning, we can add the flag only to CXXFLAGS and not to CFLAGS.
2023-10-17bootstrap: fix warningsonur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17rename bootstrap module utils/dylib_util->utils/dylibonur-ozkan-4/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17move bootstrap utils into bootstrap/src/utils moduleonur-ozkan-861/+297
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17move bootstrap core implementation to bootstrap/src/core moduleonur-ozkan-189/+792
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17improve bootstrap tests structureonur-ozkan-10/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17reorganize bootstrap bins and helper module utilizationsonur-ozkan-35/+19
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-16Rollup merge of #116430 - onur-ozkan:vendoring-in-tarball-sources, r=clubby789Matthias Krüger-6/+9
vendoring in tarball sources fixes #94782
2023-10-15add x.py.zsh to tidy checkonur-ozkan-1/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15optimize `GenerateCompletions::run`onur-ozkan-17/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15generate zsh autocompletion for xonur-ozkan-2/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15bump bootstrap:clap_complete to `4.4.3`onur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15Auto merge of #116635 - onur-ozkan:improve-file-read, r=Mark-Simulacrumbors-11/+50
optimize file read in `Config::verify` `Config::verify` refactored to improve the efficiency and memory usage of file hashing.
2023-10-14Auto merge of #116352 - Kobzol:rustc-driver-bolt, r=Mark-Simulacrumbors-0/+16
Optimize `librustc_driver.so` with BOLT This PR optimizes `librustc_driver.so` on 64-bit Linux CI with BOLT. ### Code One thing that's not clear yet to me how to resolve is how to best pass a linker flag that we need for BOLT (the second commit). It is currently passed unconditionally, which is not a good idea. We somehow have to: 1) Only pass it when we actually plan to use BOLT. How to best do that? `config.toml` entry? Environment variable? CLI flag for bootstrap? BOLT optimization is done by `opt-dist`, therefore bootstrap doesn't know about it by default. 2) Only pass it to `librustc_driver.so` (see performance below). Some discussion of this flag already happened on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Adding.20a.20one-off.20linker.20flag). ### Performance Latest perf. results can be found [here](https://github.com/rust-lang/rust/pull/102487#issuecomment-1743469053). Note that instruction counts are not very interesting here, there are only regressions on hello world programs. Probably caused by a larger C++ libstd (?). Summary: - :heavy_check_mark: `-1.8%` mean improvement in cycle counts across many primary benchmarks. - :heavy_check_mark: `-1.8%` mean Max-RSS improvement. - :heavy_multiplication_x: 34 MiB (+48%) artifact size regression of `librustc_driver.so`. - This is caused by building `librustc_driver.so` with relocations (which are required for BOLT). Hopefully, it will be [fixed](https://discourse.llvm.org/t/bolt-rfc-a-new-mode-to-rewrite-entire-binary/68674) in the future with BOLT improvements, but now trying to reduce this size increase is [tricky](https://github.com/rust-lang/rust/pull/114649). - Note that the size of this file was recently reduced in https://github.com/rust-lang/rust/pull/115554 by pretty much the same amount (33 MiB). So the size after this PR is basically the same as it was for the last ~year. - :heavy_multiplication_x: 1.4 MiB (+53%) artifact size regression of `rustc`. - This is annoying and pretty much unnecessary. It is caused by the way relocations are currently applied in this PR, because they are applied both to `librustc_driver.so` (where they are needed) and for `rustc` (where they aren't needed), since both are built with a single cargo invocation. We might need e.g. some tricks in the bootstrap `rustc` shim to only apply the relocation flag for the shared library and not for `rustc`. ### CI time CI (try build) got slower by ~5 minutes, which is fine, IMO. It can be further reduced by running LLVM and `librustc_driver` BOLT profile gathering at the same time (now they are gathered separately for LLVM and `librustc_driver`). r? `@Mark-Simulacrum` Also CC `@onur-ozkan,` primarily for the bootstrap linker flag issue.
2023-10-14add unit test for Config::verifyonur-ozkan-1/+22
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-14optimize file read in Config::verifyonur-ozkan-10/+28
`Config::verify` refactored to improve the efficiency and memory usage of file hashing. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-14Rollup merge of #116603 - onur-ozkan:reorganize-cargo-file, r=Mark-SimulacrumMatthias Krüger-12/+12
Reorganize `bootstrap/Cargo.toml` The information here https://github.com/rust-lang/rust/blob/5b88d659f8c2428536589d4bd36b9099d53a6815/src/bootstrap/Cargo.toml#L55-L59 was wrong. This PR fixes that and sorts the dependencies in ascending order. Additionally, I moved the 'features' section above up to make it appear easier.
2023-10-14Auto merge of #116727 - matthiaskrgr:rollup-3qqdrny, r=matthiaskrgrbors-4/+0
Rollup of 5 pull requests Successful merges: - #116630 (Add ability to get lines/filename for Span in smir) - #116644 (remove outdated bootstrap FIXME) - #116695 (Fix a comment) - #116696 (Misc improvements) - #116704 (Fix AFIT lint message to mention pitfall) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-14Rollup merge of #116577 - onur-ozkan:add-safety-block-on-unsafe, r=clubby789Matthias Krüger-0/+4
add `SAFETY` block on the usage of unsafe `getuid` We pointed out this unsafe usage in #109859, and as a result, we received a fix PR #116476. However, it's important to note that the `libc::getuid()` never actually fails. This PR aims to clarify its safety.
2023-10-14Rollup merge of #116644 - onur-ozkan:outdated-fixme, r=clubby789Matthias Krüger-4/+0
remove outdated bootstrap FIXME https://github.com/emscripten-core/emscripten/issues/9013 is fixed and this should be no longer needed.
2023-10-14Auto merge of #116407 - Mark-Simulacrum:bootstrap-bump, r=onur-ozkanbors-11/+2
Bump bootstrap compiler to just-released beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2023-10-11Auto merge of #116448 - Kobzol:bootstrap-host-flags, r=onur-ozkan,petrochenkovbors-37/+57
Pass rustc shim flags using environment variable This PR implements a generalized way of passing of host flags to the `rustc` shim in bootstrap, as proposed [here](https://github.com/rust-lang/rust/pull/116278#discussion_r1346979960). I tried to implement the bootstrap side using `OsString`, but then I realized that the shim code was using `env::var` before anyway, instead of `env::var_os`, so I just settled on a `String`. The shim side is still general and uses `env::vars_os` now. I'm not sure if we actually need to do something with the `rustdoc` shim. It *seems* to me that the env. vars passed to it (`RUSTDOC_LINKER`) and (`RUSTDOC_LLD_NO_THREADS`) could just be passed to cargo directly (or rather, the commands that they invoke in the shim could be passed directly). I'm not sure why are they set by the shim. r? `@onur-ozkan` CC `@petrochenkov`
2023-10-12remove outdated bootstrap FIXMEonur-ozkan-4/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-11Pass BOLT settings at the correct stepJakub Beránek-1/+1
2023-10-10move `features` above to appear before others sectionsonur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-10sort/reorganize dependencies in bootstrap/Cargo.tomlonur-ozkan-9/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-09Add `--enable-bolt-settings` bootstrap flagJakub Beránek-1/+6
2023-10-09Enable relocations for BOLTJakub Beránek-0/+11
2023-10-09Pass more host flags using `RUSTC_HOST_FLAGS`Jakub Beránek-15/+15
2023-10-09add `SAFETY` block on usage of unsafe `getuid`onur-ozkan-0/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-09Auto merge of #116532 - onur-ozkan:enable-rustflags-bootstrap-on-bootstrap, ↵bors-0/+7
r=albertlarsan68 Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation Adds `RUSTFLAGS_BOOTSTRAP` to `RUSTFLAGS` for bootstrap compilation when `RUSTFLAGS_BOOTSTRAP` exists in the environment. With this PR, `RUSTFLAGS_BOOTSTRAP` will affect every build(as we already do for rustc and std) compiled with stage0 compiler. Resolves #94234
2023-10-08Bump to latest betaMark Rousskov-11/+2
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-08linker: Remove `-Zgcc-ld` optionVadim Petrochenkov-10/+13
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now
2023-10-06Rename `flag` to `arg`Jakub Beránek-4/+4
2023-10-06remove the use of `fn update_submodule` on rust-analyzeronur-ozkan-2/+0
We don't need to run `fn update_submodule` on rust-analyzer as it's no longer a submodule. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-05Pass host flags to `rustc` shim using prefixed env. varsJakub Beránek-18/+42
2023-10-05Remove unused `RUSTDOC_FUSE_LD_LLD` flagJakub Beránek-4/+0
2023-10-04vendor distribution on the tarball sourcesonur-ozkan-5/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-03bootstrap: make copying linker binaries conditionalJoseph Ryan-5/+7
2023-10-02ensure the parent path's existence on `x install`onur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>