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

improve SDK incremental builds by not running redist-installer layout generation on inner loop builds #44687

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

baronfel
Copy link
Member

@baronfel baronfel commented Nov 6, 2024

@SimaTian reported very long incremental build times, and @ViktorHofer pointed out it's because Crossgen was being run even on builds where the installer was not packaged (aka builds where -pack was not passed). While we condition several of the packaging-related redist-installer target imports on PackInstaller conditions, Crossgen was not. However, simply conditioning the Import of the Crossgen.targets wouldn't work, because merely building redist-installer.csproj was invoking Crossgen.

One potential solution is to not call the redist-installer's layout logic unless building installers, but there are probably other approaches that could be taken as well.

Simply not doing these layouts results in incremental builds that take 30s on my machine.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Nov 6, 2024
@baronfel baronfel changed the title improve SDK incremental builds by not running crossgen on inner loop builds improve SDK incremental builds by not running redist-installer layout generation on inner loop builds Nov 6, 2024
@kasperk81
Copy link
Contributor

for any given ci job, Microsoft.NET.Publish.Tests.dll is the slowest to complete (3-4x worse than the others, combined). there may be redundancies to clean up or merge tests to improve its timings

@baronfel
Copy link
Member Author

baronfel commented Nov 6, 2024

@kasperk81 this is specifically not about CI jobs, though if you wanted to dig into that it would be welcome! This is about trying to reduce cycle times for local builds.

@kasperk81
Copy link
Contributor

i saw that :) just sharing another pain point that we have to wait for that slowest test suite to finish to see the test results.

@baronfel
Copy link
Member Author

baronfel commented Nov 7, 2024

Ok, this one is slightly less performant (~43s inner loop on my machine) but it keeps the overall generate layout pathways working (so tests and such for the installer should be usable). Instead, we now also set DISABLE_CROSSGEN to prevent the crossgen targets from being run. Since crossgen is in-place updating the binaries, this requires no other changes to the layout targets.

The next target would be the OverlaySdkOnLKG target, which on my machine takes 12s (of the 43), but we can get to that in later PRs.

@baronfel baronfel force-pushed the no-crossgen-on-inner-loop branch from aa1bd94 to afb0c4d Compare November 7, 2024 02:40
@baronfel baronfel marked this pull request as ready for review November 7, 2024 02:40
@marcpopMSFT
Copy link
Member

@baronfel merge and then backport to 9.0.1xx?

@baronfel baronfel merged commit 74a93ff into dotnet:main Nov 7, 2024
37 checks passed
@baronfel
Copy link
Member Author

baronfel commented Nov 7, 2024

/backport to release/9.0.1xx

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/11728595571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants