Skip to content
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

Run part of cg_clif's tests in CI #112701

Merged
merged 1 commit into from
Sep 10, 2023
Merged

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Jun 16, 2023

While currently cg_clif is already built in CI ensuring that it always compiles, sometimes there is a bug in the changes that were made causing tests to fail. This PR is one step towards preventing this.

Part of the test suite is still skipped until vendoring for the projects that are being tested is implemented. I will implement that in a future PR.

Fixes part of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1290
Fixes part of #95518
Required for #81746

@bjorn3 bjorn3 added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-cranelift Things relevant to the [future] cranelift backend labels Jun 16, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2023

r? @albertlarsan68

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 16, 2023
let backends_dst = image.join("lib").join(&backends_rel);

t!(fs::create_dir_all(&backends_dst));
builder.cp_r(&backends_src, &backends_dst);
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to make this change immediately to prevent shipping cg_clif in the rustc component. #81746 will create a separate component for cg_clif.

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this break users who do want this? If we avoid modifying defaults or change CI to not have cranelift enabled in dist builders, then this is probably not needed, right?

@albertlarsan68
Copy link
Member

r? @Mark-Simulacrum
Sorry for the delay

@@ -608,7 +608,7 @@ changelog-seen = 2
# and currently the only standard options supported are `"llvm"`, `"cranelift"`
# and `"gcc"`. The first backend in this list will be used as default by rustc
# when no explicit backend is specified.
#codegen-backends = ["llvm"]
#codegen-backends = ["llvm", "cranelift"]
Copy link
Member

Choose a reason for hiding this comment

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

The list here tends to be the default built list - are we starting to build cranelift in this PR by default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. We already compile it by default in ./x.py check. If this was enabled in the CI config instead it would be easy to forget to test it locally.

Choose a reason for hiding this comment

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

@@ -13,6 +13,8 @@ extended = true
download-ci-llvm = false
[rust]
download-rustc = false
# Skip building the cranelift backend. It isn't ready to be shipped yet.
codegen-backends = ["llvm"]
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we can rely on profiles as the way to modify the defaults - is there a reason we're modifying those in this PR? We can enable building/testing cranelift in CI without changing defaults.

Copy link

@Ohoodalzoubi Ohoodalzoubi Aug 21, 2023

Choose a reason for hiding this comment

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

لا أعتقد أنه يمكننا الاعتماد على الملفات الشخصية كطريقة لتعديل الإعدادات الافتراضية - هل هناك سبب لتعديل تلك الموجودة في هذه العلاقات العامة؟ يمكننا تمكين بناء / اختبار رافعة الرافعة في CI دون تغيير الإعدادات الافتراضية.

let backends_dst = image.join("lib").join(&backends_rel);

t!(fs::create_dir_all(&backends_dst));
builder.cp_r(&backends_src, &backends_dst);
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this break users who do want this? If we avoid modifying defaults or change CI to not have cranelift enabled in dist builders, then this is probably not needed, right?

src/bootstrap/test.rs Outdated Show resolved Hide resolved

if !builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("cranelift")) {
builder.info("cranelift not in rust.codegen-backends. skipping");
return;
Copy link
Member

Choose a reason for hiding this comment

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

I suspect these might want to be default_condition/lazy_default_condition rather than gated here...

Copy link
Member Author

@bjorn3 bjorn3 Jun 24, 2023

Choose a reason for hiding this comment

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

That would still attempt to run it on ./x.py test compiler/rustc_codegen_cranelift, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, and allow running it that way even if rust_codegen_backends doesn't contain cranelift.

Copy link
Member Author

Choose a reason for hiding this comment

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

librustc_codegen_cranelift-*.so needs to end up in the sysroot for cg_clif testing to work. This doesn't happen if rust_codegen_backends doesn't contain cranelift. And overwriting rust_codegen_backends if ./x.py test compiler/rustc_codegen_cranelift is done would lead to surprising results I think.

@Mark-Simulacrum Mark-Simulacrum 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 Jun 24, 2023
@bors
Copy link
Contributor

bors commented Jun 27, 2023

☔ The latest upstream changes (presumably #113102) made this pull request unmergeable. Please resolve the merge conflicts.

@bjorn3 bjorn3 force-pushed the test_cg_clif_in_ci2 branch from c384140 to fcd0a0c Compare June 28, 2023 16:25
@bjorn3 bjorn3 force-pushed the test_cg_clif_in_ci2 branch from fcd0a0c to e1eebff Compare July 26, 2023 15:33
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the test_cg_clif_in_ci2 branch from e1eebff to b9dd977 Compare July 26, 2023 17:03
@rustbot rustbot added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Jul 26, 2023
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the test_cg_clif_in_ci2 branch from aa5c1fb to 3c2fc10 Compare July 26, 2023 18:07
@bjorn3
Copy link
Member Author

bjorn3 commented Jul 26, 2023

I switched everything to enable cg_clif testing in ci/run.sh rather than by enabling cg_clif by default for all ./x.py.

@bjorn3 bjorn3 mentioned this pull request Aug 8, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Sep 8, 2023

@rustbot ready

I think that this is ready for another round of review.

@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 Sep 8, 2023
@Mark-Simulacrum
Copy link
Member

r=me with commits squashed

@bjorn3 bjorn3 force-pushed the test_cg_clif_in_ci2 branch from 6c8c5cb to 238d8e3 Compare September 10, 2023 15:57
@bjorn3
Copy link
Member Author

bjorn3 commented Sep 10, 2023

Rebased and squashed.

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Sep 10, 2023

📌 Commit 238d8e3 has been approved by Mark-Simulacrum

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 Sep 10, 2023
@bors
Copy link
Contributor

bors commented Sep 10, 2023

⌛ Testing commit 238d8e3 with merge c0583a0...

@bors
Copy link
Contributor

bors commented Sep 10, 2023

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing c0583a0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 10, 2023
@bors bors merged commit c0583a0 into rust-lang:master Sep 10, 2023
11 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 10, 2023
@bjorn3 bjorn3 deleted the test_cg_clif_in_ci2 branch September 10, 2023 22:16
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c0583a0): 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

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-3.5%, -2.2%] 2
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 629.704s -> 630.509s (0.13%)
Artifact size: 317.61 MiB -> 317.56 MiB (-0.02%)

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 1, 2023
Run part of `rustc_codegen_gcc`'s tests in CI

Thanks to rust-lang#112701 and `@bjorn3,` it made this much easier.

Also cc `@antoyo.`

r? `@bjorn3`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 1, 2023
Run part of `rustc_codegen_gcc`'s tests in CI

Thanks to rust-lang#112701 and `@bjorn3,` it made this much easier.

Also cc `@antoyo.`

r? `@bjorn3`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2023
…ozkan

Run part of `rustc_codegen_gcc`'s tests in CI

Thanks to rust-lang#112701 and `@bjorn3,` it made this much easier.

Also cc `@antoyo.`

r? `@bjorn3`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2023
…ozkan

Run part of `rustc_codegen_gcc`'s tests in CI

Thanks to rust-lang#112701 and `@bjorn3,` it made this much easier.

Also cc `@antoyo.`

r? `@bjorn3`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2023
…ozkan

Run part of `rustc_codegen_gcc`'s tests in CI

Thanks to rust-lang#112701 and `@bjorn3,` it made this much easier.

Also cc `@antoyo.`

r? `@bjorn3`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2023
…ozkan

Run part of `rustc_codegen_gcc`'s tests in CI

Thanks to rust-lang#112701 and `@bjorn3,` it made this much easier.

Also cc `@antoyo.`

r? `@bjorn3`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cranelift Things relevant to the [future] cranelift backend A-testsuite Area: The testsuite used to check the correctness of rustc 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants