-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build library/profiler_builtins
from ci-llvm
if appropriate
#129295
Conversation
As mentioned in the comments, I've added a new environment variable so that there's no risk of breaking whatever it is that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Left a few comments.
The current `build.rs` will automatically skip source files that don't exist. An unfortunate side-effect is that if _no_ files could be found (e.g. because the directory was wrong), the build fails with a mysterious linker error. We can reduce the awkwardness of this by explicitly checking that at least one source file was found.
880707b
to
a1d2971
Compare
Added fallback if |
After this PR, if people use @onur-ozkan Do you think that this warrants an |
IMO it's worth to have this information in the change history (so devs can open this PR and see the details behind this work). |
a1d2971
to
4acc531
Compare
Thank you! :) @bors r+ |
Build `library/profiler_builtins` from `ci-llvm` if appropriate Running all of `tests/coverage` requires the LLVM profiler runtime, which requires setting `build.profiler = true`. Historically, doing that has required checking out the entire `src/llvm-project` submodule. For compiler contributors who otherwise don't need that submodule (thanks to `download-ci-vm`), that's quite inconvenient. However, thanks to rust-lang#129116, the downloaded CI LLVM tarball now contains a copy of LLVM's `compiler-rt` directory, which includes all the files needed to build the profiler runtime. So with a little bit of extra logic in bootstrap, we can have `library/profiler_builtins` look for the `compiler-rt` files in `ci-llvm` instead of the `src/llvm-project` submodule.
Rollup of 7 pull requests Successful merges: - rust-lang#126985 (Implement `-Z embed-source` (DWARFv5 source code embedding extension)) - rust-lang#128507 (Migrate `libtest-thread-limit` `run-make` test to rmake) - rust-lang#128935 (More work on `zstd` compression) - rust-lang#129190 (Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs) - rust-lang#129295 (Build `library/profiler_builtins` from `ci-llvm` if appropriate) - rust-lang#129416 (library: Move unstable API of new_uninit to new features) - rust-lang#129418 (rustc: Simplify getting sysroot library directory) r? `@ghost` `@rustbot` modify labels: rollup
Failed in 🧻 #129474 (comment):
|
@bors r- |
We either need to wait until the ci-llvm archives are rebuilt on CI (after the next LLVM change), or implement the suggestion I had in a comment, to fallback to the checked out path. |
The actual problem seems to be that So I think my overall strategy is going to be:
|
4acc531
to
e04e3fb
Compare
I'm sad that I couldn't get this to be fully robust, but I don't think that's possible without sweeping changes to how bootstrap keeps track of which LLVM it's using. So hopefully this should be good enough for realistic use cases. |
Yes, test builders use |
💔 Test failed - checks-actions |
@bors retry (spurious Windows error) |
Build `library/profiler_builtins` from `ci-llvm` if appropriate Running all of `tests/coverage` requires the LLVM profiler runtime, which requires setting `build.profiler = true`. Historically, doing that has required checking out the entire `src/llvm-project` submodule. For compiler contributors who otherwise don't need that submodule (thanks to `download-ci-vm`), that's quite inconvenient. However, thanks to rust-lang#129116, the downloaded CI LLVM tarball now contains a copy of LLVM's `compiler-rt` directory, which includes all the files needed to build the profiler runtime. So with a little bit of extra logic in bootstrap, we can have `library/profiler_builtins` look for the `compiler-rt` files in `ci-llvm` instead of the `src/llvm-project` submodule.
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1a94d83): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary 0.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 751.721s -> 752.849s (0.15%) |
Here are all the changes. I went through them one-by-one and confirmed that they should not be affecting us. In paritcular, we explicitly set rust.lld = false (because we want to use the lld that ships with clang), so the change in default does not affect us. There have been changes to x.py since you last updated: [INFO] New option `build.lldb` that will override the default lldb binary path used in debuginfo tests - PR Link rust-lang/rust#124501 [INFO] The compiler profile now defaults to rust.debuginfo-level = "line-tables-only" - PR Link rust-lang/rust#123337 [WARNING] `rust.lld` has a new default value of `true` on `x86_64-unknown-linux-gnu`. Starting at stage1, `rust-lld` will thus be this target's default linker. No config changes should be necessary. - PR Link rust-lang/rust#124129 [WARNING] Removed `dist.missing-tools` configuration as it was deprecated long time ago. - PR Link rust-lang/rust#125535 [WARNING] `llvm.lld` is enabled by default for the dist profile. If set to false, `lld` will not be included in the dist build. - PR Link rust-lang/rust#126701 [WARNING] `debug-logging` option has been removed from the default `tools` profile. - PR Link rust-lang/rust#127913 [INFO] the `wasm-component-ld` tool is now built as part of `build.extended` and can be a member of `build.tools` - PR Link rust-lang/rust#127866 [INFO] Removed android-ndk r25b support in favor of android-ndk r26d. - PR Link rust-lang/rust#120593 [WARNING] For tarball sources, default value for `rust.channel` will be taken from `src/ci/channel` file. - PR Link rust-lang/rust#125181 [INFO] New option `llvm.libzstd` to control whether llvm is built with zstd support. - PR Link rust-lang/rust#125642 [WARNING] ./x test --rustc-args was renamed to --compiletest-rustc-args as it only applies there. ./x miri --rustc-args was also removed. - PR Link rust-lang/rust#128841 [INFO] The `build.profiler` option now tries to use source code from `download-ci-llvm` if possible, instead of checking out the `src/llvm-project` submodule. - PR Link rust-lang/rust#129295 Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/1120078 Original-Revision: 27df37a30e50b14b9ffefc872b6997790f03d4ea GitOrigin-RevId: 341e222f002e36886b9960645b21faeaed633f90 Change-Id: Id1eb54a677a6f538bf7666d65b85d5fdba17ea42
Running all of
tests/coverage
requires the LLVM profiler runtime, which requires settingbuild.profiler = true
.Historically, doing that has required checking out the entire
src/llvm-project
submodule. For compiler contributors who otherwise don't need that submodule (thanks todownload-ci-vm
), that's quite inconvenient.However, thanks to #129116, the downloaded CI LLVM tarball now contains a copy of LLVM's
compiler-rt
directory, which includes all the files needed to build the profiler runtime. So with a little bit of extra logic in bootstrap, we can havelibrary/profiler_builtins
look for thecompiler-rt
files inci-llvm
instead of thesrc/llvm-project
submodule.