ci: Apply a consistent Cargo profile - #5133
Conversation
| "1" => Self::Release, | ||
| "2" => Self::ReleaseWithLto, | ||
| _ => Self::Debug, | ||
| _ => match std::env::var("CI").unwrap_or_default().as_str() { |
There was a problem hiding this comment.
We set RELEASE=2 in the release workflow so this has no effect there.
iamllama
left a comment
There was a problem hiding this comment.
Changes LGTM, but i'm seeing the opposite on ubuntu: ~68s for ./check on main vs ~96s for CI=true ./check on the pr branch 🤔
|
Yeah, I agree with @iamllama. The changes LGTM, but I cannot confirm that they demonstrably reduce time. Is there any way you can demonstrate an improvement with these changes? |
Documentation build overview
48 files changed ·
|
Do you see a meaningful difference if you set
|
|
I don't see consistent differences between this PR and main however (https://github.com/ankitects/anki/actions/runs/30923778268) and I'm not sure that's possible to confirm considering how unreliable GitHub runners are. Applying a single compilation profile though appears to work for the purpose of reducing recompilation. We could set |
It's definitely slower for me as well when run locally |
For easier time comparison
|
Does incremental compilation not get used in subsequent tests? I thought it would because of |
It looks like it's common to disable it on CI: dtolnay/rust-toolchain#26
Yeah I think something is not working here - the last run recompiled some stuff despite the commit only touching ci.yml. Maybe we should use the Swatinem/rust-cache action: #5134 (comment) I'll revert the change for now until that's figured out. |
Linked issue
Related: #5102 (comment)
Summary / motivation
This adds a new Cargo profile (
ci) for use in all Rust build commands on CI. The goal is to reduce unnecessary recompilation of the same crates in dev/release profiles.Steps to reproduce (before)
View the logs of the last CI run on main and notice that some crates are getting compiled with the
releaseprofile, e.g. compilation ends with "Finishedreleaseprofile [optimized]".How to test (after)
View the logs of the last CI run in this PR and confirm all Rust compilation commands end with "Finished
ciprofile [unoptimized]", indicating that only a single profile is being used.Checklist (minimum)
./ninja checkor an equivalent relevant check locally.Scope