Repository navigation
ci: build without LTO in the build matrix - #1761
Merged
Merged
Conversation
builds.yml runs `cargo build --release --workspace` for 11 targets. The release profile has `lto = true` and `codegen-units = 1`, so each of about 20 example binaries ran a full LTO link in each job. No cache can keep that step. The build stage was 42% of the CI compute. Two environment variables turn LTO off and set 16 codegen units for these builds. The rest of the release profile stays. ffi-builds.yml still builds livekit-ffi with the profile as it ships, on each push to main and for a release. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The build stage of CI is 42% of its compute: 11 jobs of 12 to 22 minutes each, in the median of 90 runs.
builds.ymlrunscargo build --release --workspace. The release profile haslto = trueandcodegen-units = 1. The workspace links 23 binaries and 3 native libraries. Each one runs a full LTO link in each job, and no cache can keep that step.LTO is one part of the cost, not the main part. The first run of this PR was about 14% faster in the build jobs (see "Measured"). The larger part is the cold compile of the dependencies, which #1760 addresses.
Change
builds.ymlsets two environment variables for its builds:CARGO_PROFILE_RELEASE_LTO=falseCARGO_PROFILE_RELEASE_CODEGEN_UNITS=16The rest of the release profile stays:
opt-level = "z",panic = "abort"and strip.Cargo.tomldoes not change, so a release still uses the full profile.The values are the same for a PR and for
main. A PR can then use the sccache objects that the runs onmainsave.What the build stage no longer covers: a failure that only a full LTO link shows.
ffi-builds.ymlbuildslivekit-ffiwith the profile as it ships, for the same 11 targets, on each push tomainand for a release. Such a failure therefore shows after the merge, not on the PR. The example binaries get no LTO build in CI.Measured
One run of this PR, 46626662268, with a cold cache, against the median of 90 earlier runs.
aarch64-apple-ios-simaarch64-pc-windows-msvcx86_64-unknown-linux-gnuaarch64-apple-darwinx86_64-apple-darwinx86_64-linux-androidaarch64-unknown-linux-gnuaarch64-apple-iosx86_64-pc-windows-msvcaarch64-linux-androidThe sum of these 10 jobs is 151 minutes, and it was 175. This is one run, so the numbers have noise.
The eleventh job,
armv7-linux-androideabi, took 59 minutes. Its driver install step took 50 of them. Its build took 7. That step is not part of this change.Verified
cargo build --release -v, with and without the two variables. Without them:-C linker-plugin-lto -C codegen-units=1. With them:-C embed-bitcode=no -C codegen-units=16. The flags foropt-level,panicandstripare the same in both.actionlintpasses onbuilds.yml.Not done yet
mainis not measured. It needs ci: stop the cache eviction and skip builds for files that CI does not read #1760, which stops the cache eviction. It also needs some runs onmainafter both merges.🤖 Generated with Claude Code