ci: Enable opt-dist for dist-aarch64-linux builds by mrkajetanp · Pull Request #133807 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation76 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Enable optimised AArch64 dist builds with the opt-dist pipeline.
For the time being, disable bolt on aarch64 due to upstream bolt bugs.
try-job: dist-aarch64-linux
rustbot added A-testsuite
Area: The testsuite used to check the correctness of rustc
Status: Awaiting review from the assignee but also interested parties.
Relevant to the infrastructure team, which will review and decide on the PR/issue.
labels
Some changes occurred in src/tools/opt-dist
cc @Kobzol
Hi! Could you please split the part that moves the job to the aarch64 runner and the PGO/LTO part? So that we can evaluate the CI cost of these two actions separately. Thanks!
Comment on lines +48 to +99
ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ |
---|
./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ |
--host HOSTS−−targetHOSTS --target HOSTS−−targetHOSTS --include-default-paths build-manifest bootstrap |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way this is a completely new dockerfile, so do you mean just replace this with a simple ./x dist
call and then wrap it with opt-dist separately? Just in separate commits or separate PRs altogether?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant a separate PR, so that we can land these two changes (move to aarch64 host first, and then enable optimizations) separately :)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, just wanted to make sure - no problem :)
What improvements are you seeing with this PR, over the current artifacts?
I've not yet benchmarked the changes, and I'm not sure how they compare to the artifacts from cross-compilation because I was only doing aarch64 runs but specifically adding opt-dist with LTO and PGO seems to increase the binary sizes of the main artifacts as follows:
librustc_driver-8c547d00f2ea16d5.so - 84M -> 94M
libLLVM.so.19.1-rust-1.85.0-nightly - 106M -> 108M
rustc -> 2.7M for both, +100 bytes
@bors try
Let's also see how long it takes with the optimizations.
bors added a commit to rust-lang-ci/rust that referenced this pull request
ci: Enable opt-dist for dist-aarch64-linux builds
Move the CI dist-aarch64-linux job to an aarch64 runner and enable optimised dist builds with the opt-dist pipeline.
For the time being, disable bolt on aarch64 due to upstream bolt bugs.
r? @Kobzol
cc @lqd
bors added a commit to rust-lang-ci/rust that referenced this pull request
ci: Enable opt-dist for dist-aarch64-linux builds
Move the CI dist-aarch64-linux job to an aarch64 runner and enable optimised dist builds with the opt-dist pipeline.
For the time being, disable bolt on aarch64 due to upstream bolt bugs.
r? @Kobzol
cc @lqd
That’s not going to be the good try job Jakub :3
bors added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Ah, crap. Thanks!
@bors try
bors added a commit to rust-lang-ci/rust that referenced this pull request
ci: Enable opt-dist for dist-aarch64-linux builds
Move the CI dist-aarch64-linux job to an aarch64 runner and enable optimised dist builds with the opt-dist pipeline.
For the time being, disable bolt on aarch64 due to upstream bolt bugs.
r? @Kobzol
cc @lqd
try-job: dist-aarch64-linux
☀️ Try build successful - checks-actions
Build commit: d156b32 (d156b32c73dd32916f0ca83fb0104e600fbad49d
)
So that's an extra hour for LTO+PGO without the cache. 2h22 vs 3h22.
bors added a commit to rust-lang-ci/rust that referenced this pull request
ci: Enable opt-dist for dist-aarch64-linux builds
Move the CI dist-aarch64-linux job to an aarch64 runner and enable optimised dist builds with the opt-dist pipeline.
For the time being, disable bolt on aarch64 due to upstream bolt bugs.
r? @Kobzol
cc @lqd
try-job: dist-aarch64-linux
☀️ Try build successful - checks-actions
Build commit: ef33f24 (ef33f249830d94b7afdb529458aae4052f14ca98
)
1h54 cached, not so bad. Back to roughly the same time as the x86 cross build then.
Completely outside of the CI costs conversations, these changes not making the overall turnaround time for bors longer than it is already is probably a nice bonus.
I assume good benchmark results can also help with the cost discussion.
Indeed! You can download the CI artifacts e.g. using rustup-toolchain-install-master and benchmark it locally using rustc-perf. It would be nice to see the perf. diff. Let me know on Zulip if you want help with that.
📌 Commit 3d54764 has been approved by Kobzol
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Kobzol added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Performance improvements that should be mentioned in the release notes.
and removed S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 7 pull requests
Successful merges:
- rust-lang#132397 (Make missing_abi lint warn-by-default.)
- rust-lang#133807 (ci: Enable opt-dist for dist-aarch64-linux builds)
- rust-lang#134143 (Convert
struct FromBytesWithNulError
into enum) - rust-lang#134338 (Use a C-safe return type for
__rust_[ui]128_*
overflowing intrinsics) - rust-lang#134678 (Update
ReadDir::next
instd::sys::pal::unix::fs
to use&raw const (*p).field
instead ofp.byte_offset().cast()
) - rust-lang#135424 (Detect unstable lint docs that dont enable their feature)
- rust-lang#135520 (Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs)
r? @ghost
@rustbot
modify labels: rollup
r+ but removed S-waiting-on-bors
?
Kobzol added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Oops, looks like my manual issue modification has raced with bors :) Thanks!
Maybe we should rollup=never big CI changes like these in the future
Yes, I just thought that after I noticed that it was already included in a rollup 😆 I guess that usually we run perf. for similar changes, so it's done by default, but since we don't have perf. monitoring for ARM (yet!), it wasn't done here, so I forgot about it, sorry.
Just in case the currently running rollup fails, let's mark it as such.
@bors rollup=never
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#133807 - mrkajetanp:ci-aarch64-opt-dist, r=Kobzol
ci: Enable opt-dist for dist-aarch64-linux builds
Move the CI dist-aarch64-linux job to an aarch64 runner and enable optimised dist builds with the opt-dist pipeline.
For the time being, disable bolt on aarch64 due to upstream bolt bugs.
r? @Kobzol
cc @lqd
try-job: dist-aarch64-linux
^ is hopefully just a visual bug.
Comment on lines +149 to +163
let is_aarch64 = target_triple.starts_with("aarch64"); |
---|
let mut skip_tests = vec![ |
// Fails because of linker errors, as of June 2023. |
"tests/ui/process/nofile-limit.rs".to_string(), |
]; |
if is_aarch64 { |
skip_tests.extend([ |
// Those tests fail only inside of Docker on aarch64, as of December 2024 |
"tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs".to_string(), |
"tests/ui/consts/large_const_alloc.rs".to_string(), |
]); |
} |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, I beg of you, do not do this. This hack is causing CI to pass and local developer workflows to fail, and it is hiding this regression #135952.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain, we already skip some tests in a similar manner on dist x64 (not just the explicitly skipped ones, but also whole test suites, e.g. run-make).
Some tests fail on dist, but work locally, these are candidates for being skipped on CI (after all, running the test suite on an extracted dist atchive is already a hack).
But if the test fails also outside of this extracted dist setup, then it shouldn't be skipped, ofc.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same feedback about the two tests that were using this feature before. See #135961.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, we could remove specific skipped tests, but do you also have an issue with skipping any tests in the dist tests? Because we currently don't run some parts of the test suite, so these are also effectivelly skipped, just without being explicitly enumerated.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of the 4 tests that were individually skipped, 3 also did not work for me with x test --stage 2
in an aarch64 dev environment, and the 4th was for a platform I don't have a dev environment on.
Ignoring or skipping tests in the harness is fine if there is some fundamental incompatibility with the harness. Or not running them because nobody has gotten to wiring them into opt-dist yet.
I would have preferred these tests be ignored in the tests themselves via annotations; that would have at least not had me chasing my tail wondering how CI could be passing when the tests fail locally. And it would have made the problem more visible.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree with explicit skipping via annotations being the better approach for these kinds of problems, you're right.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll write up a patch to change this in a moment, let's see what people say
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point with the annotations. Recently we added a test annotation for only running a given test in dist jobs, the same should be usable also for ignoring a test in a dist job (#135164 - ignore-dist
).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've posted a PR that I've linked above which fixes the two tests that aren't related to the aarch64 vs x86_64 allocation failure issue. I'm away from a keyboard for a few days, but it looks like it works, and I would recommend applying that change and ignoring the large const allocs failure on aarch64, pending further investigation.
Move the CI dist-aarch64-linux job to an aarch64 runner and enable optimised dist builds with the opt-dist pipeline.
We should ideally never simultaneously change the CI runner and also enable an optimized build.
We should ideally never simultaneously change the CI runner and also enable an optimized build.
FWIW the description there is a leftover from before we split the PRs, the runner change was done separately here.
Ah, thank you. In that case ideally PRs should be updated so that their messages reflect their actual content, but I am happy to know things happened in a more bisectable fashion.
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request
Rollup of 7 pull requests
Successful merges:
- rust-lang#132397 (Make missing_abi lint warn-by-default.)
- rust-lang#133807 (ci: Enable opt-dist for dist-aarch64-linux builds)
- rust-lang#134143 (Convert
struct FromBytesWithNulError
into enum) - rust-lang#134338 (Use a C-safe return type for
__rust_[ui]128_*
overflowing intrinsics) - rust-lang#134678 (Update
ReadDir::next
instd::sys::pal::unix::fs
to use&raw const (*p).field
instead ofp.byte_offset().cast()
) - rust-lang#135424 (Detect unstable lint docs that dont enable their feature)
- rust-lang#135520 (Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs)
r? @ghost
@rustbot
modify labels: rollup
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request
Upstream changes relative to 1.85.1:
Version 1.86.0 (2025-04-03)
Language
- [Stabilize upcasting trait objects to supertraits.] (rust-lang/rust#134367)
- [Allow safe functions to be marked with the
#[target_feature]
attribute.] (rust-lang/rust#134090) - [The
missing_abi
lint now warns-by-default.] (rust-lang/rust#132397) - Rust now lints about double negations, to catch cases that might
have intended to be a prefix decrement operator (
--x
) as written in other languages. This was previously a clippy lint,clippy::double_neg
, and is [now available directly in Rust asdouble_negations
.] (rust-lang/rust#126604) - [More pointers are now detected as definitely not-null based on their alignment in const eval.] (rust-lang/rust#133700)
- [Empty
repr()
attribute applied to invalid items are now correctly rejected.] (rust-lang/rust#133925) - [Inner attributes
#![test]
and#![rustfmt::skip]
are no longer accepted in more places than intended.] (rust-lang/rust#134276)
Compiler
- [Debug-assert that raw pointers are non-null on access.] (rust-lang/rust#134424)
- [Change
-O
to mean-C opt-level=3
instead of-C opt-level=2
to match Cargo's defaults.] (rust-lang/rust#135439) - [Fix emission of
overflowing_literals
under certain macro environments.] (rust-lang/rust#136393)
Platform Support
- [Replace
i686-unknown-redox
target withi586-unknown-redox
.] (rust-lang/rust#136698) - [Increase baseline CPU of
i686-unknown-hurd-gnu
to Pentium 4.] (rust-lang/rust#136700) - New tier 3 targets:
- [
{aarch64-unknown,x86_64-pc}-nto-qnx710_iosock
] (rust-lang/rust#133631). For supporting Neutrino QNX 7.1 withio-socket
network stack. - [
{aarch64-unknown,x86_64-pc}-nto-qnx800
] (rust-lang/rust#133631). For supporting Neutrino QNX 8.0 (no_std
-only). - [
{x86_64,i686}-win7-windows-gnu
] (rust-lang/rust#134609). Intended for backwards compatibility with Windows 7.{x86_64,i686}-win7-windows-msvc
are the Windows MSVC counterparts that already exist as Tier 3 targets. amdgcn-amd-amdhsa
.x86_64-pc-cygwin
.- [
{mips,mipsel}-mti-none-elf
] (rust-lang/rust#135074). Initial bare-metal support. m68k-unknown-none-elf
.- [
armv7a-nuttx-{eabi,eabihf}
,aarch64-unknown-nuttx
, andthumbv7a-nuttx-{eabi,eabihf}
] (rust-lang/rust#135757).
- [
Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- The type of
FromBytesWithNulError
inCStr::from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>
was [changed from an opaque struct to an enum] (rust-lang/rust#134143), allowing users to examine why the conversion failed. - [Remove
RustcDecodable
andRustcEncodable
.] (rust-lang/rust#134272) - [Deprecate libtest's
--logfile
option.] (rust-lang/rust#134283) - [On recent versions of Windows,
std::fs::remove_file
will now remove read-only files.] (rust-lang/rust#134679)
Stabilized APIs
- [
{float}::next_down
] (https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_down) - [
{float}::next_up
] (https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_up) - [
<[_]>::get_disjoint_mut
] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_mut) - [
<[_]>::get_disjoint_unchecked_mut
] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_unchecked_mut) - [
slice::GetDisjointMutError
] (https://doc.rust-lang.org/stable/std/slice/enum.GetDisjointMutError.html) - [
HashMap::get_disjoint_mut
] (https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_mut) - [
HashMap::get_disjoint_unchecked_mut
] (https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_unchecked_mut) - [
NonZero::count_ones
] (https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.count_ones) - [
Vec::pop_if
] (https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pop_if) - [
sync::Once::wait
] (https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait) - [
sync::Once::wait_force
] (https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait_force) - [
sync::OnceLock::wait
] (https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html#method.wait)
These APIs are now stable in const contexts:
- [
hint::black_box
] (https://doc.rust-lang.org/stable/std/hint/fn.black_box.html) - [
io::Cursor::get_mut
] (https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_mut) - [
io::Cursor::set_position
] (https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.set_position) - [
str::is_char_boundary
] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.is_char_boundary) - [
str::split_at
] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at) - [
str::split_at_checked
] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_checked) - [
str::split_at_mut
] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut) - [
str::split_at_mut_checked
] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut_checked)
Cargo
- [When merging, replace rather than combine configuration keys that refer to a program path and its arguments.] (rust-lang/cargo#15066)
- [Error if both
--package
and--workspace
are passed but the requested package is missing.] (rust-lang/cargo#15071) This was previously silently ignored, which was considered a bug since missing packages should be reported. - [Deprecate the token argument in
cargo login
to avoid shell history leaks.] (rust-lang/cargo#15057) - [Simplify the implementation of
SourceID
comparisons.] (rust-lang/cargo#14980) This may potentially change behavior if the canonicalized URL compares differently in alternative registries.
Rustdoc
- [Add a sans-serif font setting.] (rust-lang/rust#133636)
Compatibility Notes
- [The
wasm_c_abi
future compatibility warning is now a hard error.] (rust-lang/rust#133951) Users ofwasm-bindgen
should upgrade to at least version 0.2.89, otherwise compilation will fail. - [Remove long-deprecated no-op attributes
#![no_start]
and#![crate_id]
.] (rust-lang/rust#134300) - [The future incompatibility lint
cenum_impl_drop_cast
has been made into a hard error.] (rust-lang/rust#135964) This means it is now an error to cast a field-less enum to an integer if the enum implementsDrop
. - [SSE2 is now required for "i686" 32-bit x86 hard-float targets; disabling it causes a warning that will become a hard error eventually.] (rust-lang/rust#137037) To compile for pre-SSE2 32-bit x86, use a "i586" target instead.
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
- [Build the rustc on AArch64 Linux with ThinLTO + PGO.] (rust-lang/rust#133807) The ARM 64-bit compiler (AArch64) on Linux is now optimized with ThinLTO and PGO, similar to the optimizations we have already performed for the x86-64 compiler on Linux. This should make it up to 30% faster.
Labels
Area: The testsuite used to check the correctness of rustc
Performance improvements that should be mentioned in the release notes.
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the infrastructure team, which will review and decide on the PR/issue.