Commit Graph

89 Commits

Author SHA1 Message Date
Manuel Drehwald
e2d3f5aaec Allow building rustc's LLVM with Offload support 2024-10-25 14:31:09 -07:00
Orion Gonzalez
28095bc541 real default value 2024-10-22 19:11:46 +02:00
Orion Gonzalez
c8de61b50d s/display-diff-tool/compiletest-diff-tool/ 2024-10-22 19:11:44 +02:00
Orion Gonzalez
ef4325eb85 implemented custom differ 2024-10-22 19:10:35 +02:00
许杰友 Jieyou Xu (Joe)
65458aed68 bootstrap: allow setting --jobs in config.toml 2024-10-19 13:35:41 +08:00
Shriram Balaji
8b968764f1 bootstrap: add std_features config
bootstrap: add std_features  to config.example

fix: use BTreeSet for std-features; add unit tests

* fix formatting of string in front of std_features
* rename `std_features` to `std-features` in config.toml

fix: remove space before std-features in config.toml

fix: remove explicit .into_iter conversion

bootstrap: add details for rust.std-features in config.example.toml

Co-authored-by: Onur Özkan <onurozkan.dev@outlook.com>

fix: remove `Option<T>` from `rust_std_features`

fix: move default rust_std_features to config

fix: make std_features CI rustc incompatible
2024-10-06 09:59:10 +05:30
onur-ozkan
4e090e70d1 update llvm.download-ci-llvm documentation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-19 14:28:06 +03:00
onur-ozkan
9778f25ea5 document dist.vendor in config.example.toml
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-15 12:23:05 +03:00
Jubilee
5c91cc5d4c
Rollup merge of #129473 - Urgau:fix-llvm-if-unchanged, r=onur-ozkan
use  `download-ci-llvm=true` in the default compiler config

1ca2708e77 made it so that the `src/llvm-project` submodule has to be checkout for `download-ci-llvm = "if-unchanged"` to know if the submodule has been changed, but that is not required, if the submodule hasn't been checkout it cannot have been modified.

~~This PR restore the previous behavior by only updating the submodule if it has already been checkout.~~

This PR makes `download-ci-llvm = true` check if CI llvm is available and make it the default for the compiler profile, as to prevent unnecessarily checking out `src/llvm-project` with `"if-unchanged"`.

r? `````@onur-ozkan`````
2024-09-09 19:20:35 -07:00
onur-ozkan
13ea104798 update rust.verbose-tests doc in config.example.toml
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09 18:56:37 +03:00
Urgau
5f367bbbd2 Make download-ci-llvm = true check if CI llvm is available
and make it the default for the compiler profile, as to prevent
unnecessarily checking out `src/llvm-project` with `"if-unchanged"`.
2024-09-06 17:49:45 +02:00
Manuel Drehwald
4f5c16d62f Enzyme backend
Co-authored-by: Lorenz Schmidt <bytesnake@mailbox.org>
2024-09-05 22:47:23 -04:00
Matthias Krüger
8a60d0a5ec
Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-Simulacrum
enable -Zrandomize-layout in debug CI builds

This builds rustc/libs/tools with `-Zrandomize-layout` on *-debug CI runners.

Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives.

The config.toml flag `rust.randomize-layout` defaults to false, so it has to be explicitly enabled for now.
2024-09-05 03:47:39 +02:00
The 8472
121e9f4cc8 Add rust.randomize-layout config to build artifacts with -Zrandomize-layout
Additionally teach compiletest to ignore tests that rely on deterministic layout.
Tests themselves aren't built with randomization but they can still observe
slight changes in std or rustc
2024-08-31 23:56:45 +02:00
onur-ozkan
9dcc65600e document build.cargo-clippy option
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-26 08:28:54 +03:00
onur-ozkan
0ce7705356 document miri and cargo-miri in build.tools
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-22 08:32:39 +03:00
Kyle Huey
6e9afb8dde Enable zstd for debug compression.
Set LLVM_ENABLE_ZSTD alongside LLVM_ENABLE_ZLIB so that --compress-debug-sections=zstd is an option.
Use static linking to avoid a new runtime dependency. Add an llvm.libzstd bootstrap option for LLVM
with zstd. Set it off by default except for the dist builder. Handle llvm-config --system-libs output
that contains static libraries.
2024-08-09 05:55:23 -07:00
onur-ozkan
6fcc630e56 update download-rustc documentation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-30 17:00:07 +03:00
onur-ozkan
1140750f6e update rust.channel documentation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-27 11:08:29 +03:00
Matthew Maurer
8bf9aeaa80 Update Android testing to API 21, matching NDK 26
We were running testing on API 18, which was already out of support for
NDK 25, and some of the ancient behavior in that image was causing
trouble when developing `rustc` features (#120326).

Update to the current LTS NDK 26, and to its minimum supported API 21.

Fixes: #120567
2024-07-26 00:52:42 +00:00
Alex Crichton
ae82726a44 Conditionally build wasm-component-ld
This commit updates the support for the `wasm-component-ld` tool
from #126967 to conditionally build it rather than unconditionally
building it when LLD is enabled. This support is disabled by default and
can be enabled by one of two means:

* the `extended` field in `config.toml` which dist builders use to build
  a complete set of tools for each host platform.
* a `"wasm-component-ld"` entry in the `tools` section of `config.toml`.

Neither of these are enabled by default meaning that most local builds
will likely not have this new tool built. Dist builders should still,
however, build the tool.
2024-07-19 07:51:17 -07:00
Matthias Krüger
60e10e65ba
Rollup merge of #127322 - onur-ozkan:ci-rustc-incompatible-options, r=Mark-Simulacrum
handle ci-rustc incompatible options during config parse

This PR ensures that `config.toml` does not use CI rustc incompatible options when CI rustc is enabled (just like [ci-llvm checks](e2cf31a614/src/bootstrap/src/core/config/config.rs (L1809-L1836))). Some options can change compiler's behavior in certain scenarios. If we don't check these incompatible options, CI runners using CI rustc might ignore options we have explicitly set. This could be dangerous as we might think a rustc test passed with option T but in fact it wasn't tested with option T.

Later in https://github.com/rust-lang/rust/pull/122709, I will disable CI rustc if any of those options were used (similar to [this approach](dd2c24aafd/src/ci/run.sh (L165-L169))). If CI runners fail because of these checks, it means the logic in run.sh isn't covering the incompatible options correctly (since any incompatible option should turn off CI rustc).

The list may not be complete, but should be a good first step as it's better than nothing!

Blocker for https://github.com/rust-lang/rust/pull/122709
2024-07-14 10:05:20 +02:00
onur-ozkan
48192701e0 use "bootstrap" instead of "rustbuild" in comments and docs
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-07 00:07:08 +03:00
onur-ozkan
937b5c4594 remove leading space on frame-pointers
Leading spaces in config options cause `configure` script to fail.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-04 17:16:53 +03:00
Zalathar
fd4fe7d129 Remove src/tools/rust-demangler 2024-06-19 20:41:34 +10:00
Jakub Beránek
b4df72aae2
Do not enable llvm-bitcode-linker in most default bootstrap profiles 2024-06-14 15:49:09 +02:00
Tshepang Mbambo
9aa96b4623
config.example.toml: minor improves 2024-06-07 19:41:37 +02:00
onur-ozkan
56dddd4c7e Remove deprecated field dist.missing-tools
It's been 5 months since this field was deprecated.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-25 10:35:07 +03:00
Rémy Rakic
514765b405 describe new default value for rust.lld in config template 2024-05-16 16:08:06 +00:00
bors
645bc609d9 Auto merge of #124883 - onur-ozkan:change-stage0-file, r=Mark-Simulacrum
use key-value format in stage0 file

Currently, we are working on the python removal task on bootstrap. Which means we have to extract some data from the stage0 file using shell scripts. However, parsing values from the stage0.json file is painful because shell scripts don't have a built-in way to parse json files.

This change simplifies the stage0 file format to key-value pairs, which makes it easily readable from any environment.

See the zulip thread for more details: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Using.20different.20format.20in.20the.20stage0.20file
2024-05-12 06:26:20 +00:00
onur-ozkan
aa2faefe12 remove outdated stage0.json parts
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-11 20:48:58 +03:00
Vladimir Makaev
79e09a6fc5 Added an entry for "lldb" in config.example.toml 2024-05-04 17:55:19 +00:00
klensy
1d929cf8b7 allow to set line-directives-only too 2024-04-17 15:43:52 +03:00
Matthias Krüger
873de7e106
Rollup merge of #123642 - onur-ozkan:restrict-llvm-option, r=Mark-Simulacrum
do not allow using local llvm while using rustc from ci

From: https://github.com/rust-lang/rust/issues/123586#issuecomment-2043296578

> Even if `llvm.download-ci-llvm` is set to true, `stage > 0` rustc will always use the prebuilt LLVM library which comes with ci-rustc. So I tried to use locally-built LLVM libraries in the ci-rustc by replacing the existing LLVM libraries with the locally built ones, and it appears that this is indeed a limitation of using `rust.download-rustc=true` as it fails with the following error:
>
> ```
> $ ./build/host/ci-rustc/bin/rustc --version
> ./build/host/ci-rustc/bin/rustc: symbol lookup error: /home/nimda/devspace/.other/rustc-builds/build/x86_64-unknown-linux-gnu/ci-rustc/bin/../lib/librustc_driver-a03ea465d8e03db1.so: undefined symbol: LLVMInitializeARMTargetInfo, version LLVM_18.1
> ```
>
> So, if `rust.download-rustc` is set to true and `llvm.download-ci-llvm` is false, I believe bootstrap should terminate the process (as it always uses prebuilt LLVM libraries from ci-rustc, there is no point to build LLVM locally) while parsing the configuration.

Resolves #123586

r? Mark-Simulacrum
2024-04-13 16:42:04 +02:00
onur-ozkan
bd479113d3 correct the handling of bootstrap-cache-path option
This change makes `build.bootstrap-cache-path` option to be configurable with
`./configure` script, so it can be used like `./configure --bootstrap-cache-path=demo`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-11 14:57:10 +03:00
onur-ozkan
a7aa7fdd12 do not allow using local llvm while using rustc from ci
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-09 00:09:55 +03:00
Tshepang Mbambo
75a5196490
use more accurate terminology
rustc is just one tool/executable, even if at the center of the toolchain
2024-03-19 20:32:55 +02:00
Tim Neumann
0e354c98a8 [bootstrap] Move the split-debuginfo setting to the per-target section 2024-03-11 20:17:00 +01:00
Kjetil Kjeka
6a50d059a5 Bootstrap: Add argument for building llvm bitcode linker 2024-03-11 13:35:55 +01:00
Alex Crichton
dd95cb7106 Add target.*.runner configuration for targets
This commit adds a `runner` field configuration to `config.toml` for
specifying a wrapper executable when executing binaries for a target.
This is pulled out of #122036 where a WebAssembly runtime is used, for
example, to execute tests for `wasm32-wasip1`.

The name "runner" here is chosen to match Cargo's `CARGO_*_RUNNER`
configuration, and to make things a bit more consistent this
additionally renames compiletest's `--runtool` argument to `--runner`.
2024-03-08 07:44:03 -08:00
Matthias Krüger
24a2169a23
Rollup merge of #121976 - lu-zero:bootstrap-cache, r=onur-ozkan
Add an option to have an external download/bootstrap cache

Follow up from #116697 to address https://github.com/rust-lang/rust/pull/116697#pullrequestreview-1677176395
2024-03-06 22:41:53 +01:00
Luca Barbato
c98e25bab9 Add a build option to specify the bootstrap cache
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-05 10:35:43 +01:00
Alex Crichton
cb39d6c515 Add a new wasm32-wasip1 target to rustc
This commit adds a new target called `wasm32-wasip1` to rustc.
This new target is explained in these two MCPs:

* https://github.com/rust-lang/compiler-team/issues/607
* https://github.com/rust-lang/compiler-team/issues/695

In short, the previous `wasm32-wasi` target is going to be renamed to
`wasm32-wasip1` to better live alongside the [new
`wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616).
This new target is added alongside the `wasm32-wasi` target and has the
exact same definition as the previous target. This PR is effectively a
rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that
as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi`
target is not being removed at this time. This change will reach stable
Rust before even a warning about the rename will be printed. At this
time this change is just the start where a new target is introduced and
users can start migrating if they support only Nightly for example.
2024-03-02 09:03:51 -08:00
Nilstrieb
09e6043483 Add rust.frame-pointers config option
This is very helpful for profiling. I've hacked this in many times, so
let's add it properly.
2024-02-18 22:23:09 +01:00
Tshepang Mbambo
6147973082 remove extraneous text from example config 2024-02-18 10:41:31 +02:00
bjorn3
28af00c611 Support configuring the set of codegen backends to build per host triple
This allows building the compiler itself with one backend while using
another backend at runtime. For example this allows compiling rustc to
wasm using LLVM, while using Cranelift at runtime to produce actual
code. Cranelift can't compile to wasm, but is perfectly capable of
running on wasm. LLVM can compile to wasm, but can't run on wasm. [^1]

[^1]: The prototype of this still requires a couple of other patches.
2024-01-25 18:55:27 +00:00
jyn
6a409ddbe4 add a new optimized_compiler_builtins option
in particular, this makes the `c` feature for compiler-builtins an explicit opt-in, rather than silently detected by whether `llvm-project` is checked out on disk.
exposing this is necessary because the `cc` crate doesn't support cross-compiling to MSVC, and we want people to be able to run `x check --target foo` regardless of whether they have a c toolchain available.

this also uses the new option in CI, where we *do* want to optimize compiler_builtins.

the new option is off by default for the `dev` channel and on otherwise.
2024-01-07 13:04:40 +03:00
onur-ozkan
12190e5dd2 utilize the unused llvm-tools option
This field was not functioning as described in its comment in `config.example.toml`.
Also, updated the default value to `true` to keep the bootstrapping behavior as it was before.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-28 17:27:59 +03:00
jyn
0e88874292 fix ./configure --set change-id 2023-12-25 08:04:00 -05:00
Matthias Krüger
c644d00285
Rollup merge of #119124 - onur-ozkan:help-118861, r=Mark-Simulacrum
don't build `rust-analyzer-proc-macro-srv` on def config

Should be very easy to understand when reviewing commit-by-commit.

Blocker for #118861
2023-12-21 16:43:07 +01:00