Skip to content

Ship correct Cranelift library in its dist component #145207

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

Merged
merged 3 commits into from
Aug 11, 2025

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Aug 10, 2025

The first commit adds a post-dist UI test to check that Cranelift can be used with the extracted dist x64 Linux archive.

The original codegen copy logic in the Cranelift dist step was a bit redundant, and I didn't notice in #144787 that it's copying the codegen backend from the build compiler's sysroot, rather than the target compiler's sysroot. The second commit modifies the logic to directly access the built codegen file (there is no need to search for it in the compiler's sysroot, in fact when you run just x dist rustc_codegen_cranelift, it shouldn't "taint" the sysroot with the codegen backend! Which it did before #144787) and copy it to the tarball under a normalized name. Thus we get around any similar potential issues in the future, and make previously implicit logic more explicit.

This also fixes running just x dist rustc_codegen_cranelift without enabling cranelift in rust.codegen-backends, which should have been enabled by #144787, but it didn't work fully, because the dist step tried to copy the codegen backend from the compiler's sysroot, but it didn't contain the codegen backend if it was not enabled by rust.codegen-backends.

Fixes: #145201

try-job: dist-x86_64-linux

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 10, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 10, 2025

@bors try

rust-bors bot added a commit that referenced this pull request Aug 10, 2025
[WIP] Fix Cranelift dist

try-job: dist-x86_64-linux
@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

⌛ Trying commit 49e8eb9 with merge 2e161bc

To cancel the try build, run the command @bors try cancel.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Aug 10, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 10, 2025

I'm relatively sure that the second commit fixes the issue, but I'll let the try build finish to see if the UI test fails. If yes, then I'll rerun it to see if it works with the second commit.

@Kobzol Kobzol changed the title [WIP] Fix Cranelift dist Ship correct Cranelift library in its dist component Aug 10, 2025
@Kobzol Kobzol marked this pull request as ready for review August 10, 2025 10:42
@rustbot
Copy link
Collaborator

rustbot commented Aug 10, 2025

r? @albertlarsan68

rustbot has assigned @albertlarsan68.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 10, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 10, 2025

r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned albertlarsan68 Aug 10, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

💔 Test failed (CI). Failed jobs:

@rustbot
Copy link
Collaborator

rustbot commented Aug 10, 2025

Some changes occurred in src/tools/opt-dist

cc @Kobzol

@Kobzol
Copy link
Member Author

Kobzol commented Aug 10, 2025

@bors try

rust-bors bot added a commit that referenced this pull request Aug 10, 2025
Ship correct Cranelift library in its dist component

try-job: dist-x86_64-linux
@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

⌛ Trying commit 85610e6 with merge f6f3471

To cancel the try build, run the command @bors try cancel.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

💔 Test failed (CI). Failed jobs:

@Kobzol Kobzol force-pushed the codegen-backend-clif-dist branch from 85610e6 to 1329f91 Compare August 10, 2025 14:48
@Kobzol
Copy link
Member Author

Kobzol commented Aug 10, 2025

@bors try

rust-bors bot added a commit that referenced this pull request Aug 10, 2025
Ship correct Cranelift library in its dist component

try-job: dist-x86_64-linux
@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

⌛ Trying commit 1329f91 with merge b85b030

To cancel the try build, run the command @bors try cancel.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

💔 Test failed (CI). Failed jobs:

@Kobzol Kobzol force-pushed the codegen-backend-clif-dist branch from 1329f91 to 6893e69 Compare August 10, 2025 18:46
@Kobzol
Copy link
Member Author

Kobzol commented Aug 10, 2025

@bors try

rust-bors bot added a commit that referenced this pull request Aug 10, 2025
Ship correct Cranelift library in its dist component

try-job: dist-x86_64-linux
@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

⌛ Trying commit 6893e69 with merge bea1bd3

To cancel the try build, run the command @bors try cancel.

@rust-bors
Copy link

rust-bors bot commented Aug 10, 2025

☀️ Try build successful (CI)
Build commit: bea1bd3 (bea1bd3e7c211b60f0a440570fbb45999134cd11, parent: 18eeac04fc5c2a4c4a8020dbdf1c652077ad0e4e)

@Kobzol
Copy link
Member Author

Kobzol commented Aug 11, 2025

Ok, should be ready now.

@rustbot ready

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jieyouxu
Copy link
Member

@bors r+ rollup=never (dist)

@bors
Copy link
Collaborator

bors commented Aug 11, 2025

📌 Commit 6893e69 has been approved by jieyouxu

It is now in the queue for this repository.

@bors 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 Aug 11, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 11, 2025

I'll bump the priority here, because the queue is short, and we could still make today's nightly, to allow people to use Cranelift on latest nightly again.

@bors p=1

@jieyouxu
Copy link
Member

If we're going to do that, same prio as rollups:
@bors p=5

@bors
Copy link
Collaborator

bors commented Aug 11, 2025

⌛ Testing commit 6893e69 with merge 6355cd3...

@bors
Copy link
Collaborator

bors commented Aug 11, 2025

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing 6355cd3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 11, 2025
@bors bors merged commit 6355cd3 into rust-lang:master Aug 11, 2025
12 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 11, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing fce0e74 (parent) -> 6355cd3 (this PR)

Test differences

Show 5 test diffs

Stage 1

  • [ui] tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs: [missing] -> ignore (only executed when performing tests on dist toolchain) (J1)

Stage 2

  • [ui] tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs: [missing] -> ignore (only executed when performing tests on dist toolchain) (J0)
  • [ui] tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs: [missing] -> ignore (only executed when the target is x86_64-unknown-linux-gnu) (J2)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 6355cd39c81e9699b1925c58d2ed3165bcab1715 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-apple: 6070.2s -> 8056.3s (32.7%)
  2. x86_64-apple-2: 5369.8s -> 3833.2s (-28.6%)
  3. tidy: 98.1s -> 125.9s (28.4%)
  4. dist-apple-various: 3876.3s -> 4811.2s (24.1%)
  5. x86_64-gnu-llvm-19-3: 6837.5s -> 8068.9s (18.0%)
  6. dist-x86_64-apple: 13172.6s -> 10809.3s (-17.9%)
  7. dist-android: 2562.3s -> 2889.1s (12.8%)
  8. x86_64-apple-1: 8368.3s -> 7305.1s (-12.7%)
  9. x86_64-gnu-llvm-19-1: 3311.9s -> 3631.1s (9.6%)
  10. x86_64-gnu-tools: 3277.5s -> 3541.7s (8.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@Kobzol Kobzol deleted the codegen-backend-clif-dist branch August 11, 2025 20:10
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6355cd3): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.2%, secondary -2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.2% [2.7%, 3.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) 3.2% [2.7%, 3.7%] 2

Cycles

Results (primary 2.3%, secondary 0.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.0%, 2.5%] 3
Regressions ❌
(secondary)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) 2.3% [2.0%, 2.5%] 3

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 464.993s -> 463.68s (-0.28%)
Artifact size: 377.36 MiB -> 377.35 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cranelift: librustc_driver-2bb05b679736573e.so: cannot open shared object file
7 participants