Skip to content

Gate advanced features of citool to reduce compilation time #139678

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

Closed
wants to merge 1 commit into from

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Apr 11, 2025

This reduces the duration of the citool step of the Calculate job matrix job, which is on the critical path for all CI executions, from ~1 minute to ~20s. It will also make it easier for us to add more stuff to citool in the future, because if we can gate it behind extended, it won't increase the duration of this job.

r? @ghost

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Apr 11, 2025
@Kobzol Kobzol marked this pull request as ready for review April 11, 2025 15:12
@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 11, 2025

r? @marcoieni

@rustbot ready

@@ -1,3 +1,5 @@
#![allow(unused)]
Copy link
Member

@marcoieni marcoieni Apr 14, 2025

Choose a reason for hiding this comment

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

can you write a comment explaining why this is here?

@marcoieni
Copy link
Member

I'm not sure if it's worth adding this complexity. I can imagine us easily introducing bugs because of this feature.

Aren't there other ways to speed up the compilation? E.g. cache dependencies or use a pre-compiled binary.

@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 14, 2025

I'm not sure if it's worth adding this complexity. I can imagine us easily introducing bugs because of this feature.

Could you clarify what kind of bugs you have in mind? I can't imagine how this could cause any bugs.

Aren't there other ways to speed up the compilation? E.g. cache dependencies or use a pre-compiled binary.

A pre-compiled binary would IMO introduce too much implementation complexity, due to having to handle cache invalidations. An easy solution would be to use rust-cache. I was a bit vary of adding it to our CI, but as long as we would pin the hash and we only use it in the matrix computation step, I suppose that it should be fine. If you're ok with that, I will send a PR.

@marcoieni
Copy link
Member

I prefer using the rust-cache action wrt to selecting features like this 👍

Could you clarify what kind of bugs you have in mind? I can't imagine how this could cause any bugs.

E.g. forget to add configuration flags around, which could cause compilation error. I have seen codebases that don't test all permutation of features that don't catch these errors, but probably in this CI would me more difficult.

Still I would prefer rust-cache to keep the code simpler 👍

@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 14, 2025

E.g. forget to add configuration flags around, which could cause compilation error. I have seen codebases that don't test all permutation of features that don't catch these errors, but probably in this CI would me more difficult.

Right, I mean sure, there could be a compilation error, but that's not a bug =D We would compile the crate both with and without the single feature, so we would find out soon. But rust-cache should be simple.

@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 15, 2025

Obsoleted by #139819.

@Kobzol Kobzol closed this Apr 15, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 15, 2025
Use `rust-cache` to speed-up `citool` compilation

Alternative to rust-lang#139678.

r? `@marcoieni`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 15, 2025
Use `rust-cache` to speed-up `citool` compilation

Alternative to rust-lang#139678.

r? ``@marcoieni``
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 15, 2025
Rollup merge of rust-lang#139819 - Kobzol:rust-cache, r=marcoieni

Use `rust-cache` to speed-up `citool` compilation

Alternative to rust-lang#139678.

r? ``@marcoieni``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

3 participants