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

PackageValidation runs in no-op incremental builds #23517

Closed
Tracked by #23910
ViktorHofer opened this issue Jan 20, 2022 · 3 comments · Fixed by #26935
Closed
Tracked by #23910

PackageValidation runs in no-op incremental builds #23517

ViktorHofer opened this issue Jan 20, 2022 · 3 comments · Fixed by #26935

Comments

@ViktorHofer
Copy link
Member

The PackageValidation SDK feature currently runs always, even if the package hasn't changed:

<Target Name="RunPackageValidation"
DependsOnTargets="$(RunPackageValidationDependsOn)"
AfterTargets="Pack"

This is the case because the RunPackageValidation target is hooked onto the wrong target (maybe there's one that doesn't run in no-op incremental packaging builds) and because it doesn't define any Inputs and Outputs.

When incrementally building the libraries subset of dotnet/runtime for allconfigurations (build.cmd libs -allconfigurations && build.cmd libs -allconfigurations /bl), this adds 111 seconds to the overall build.

image

cc @safern @joperezr @ericstj

@rainersigwald
Copy link
Member

I suspect there is not a better target to hook, but this could be avoided with inputs + outputs. Right now it looks like the only output is MSBuild properties/items/warnings/errors, but the target or task can always touch a marker file to create a new timestamped output.

@ericstj ericstj added this to the .NET 7.0 milestone Jan 20, 2022
@ericstj
Copy link
Member

ericstj commented Jan 20, 2022

Agree, inputs/outputs would be more resilient here. We also need to rerun even if the package isn't rebuilt: for example, someone changes a suppression file or changes the left-hand-side package.

@ViktorHofer
Copy link
Member Author

FWIW, here's another data point that I just collected from a libraries allconfigurations build:

image

ViktorHofer added a commit that referenced this issue Aug 2, 2022
Fixes #23517

By defining inputs and a semaphore file as the output, PackageValidation doesn't run anymore in an no-op incremental build. In the example of dotnet/runtime, this saves nearly two minutes of unnecessary work.
ViktorHofer added a commit that referenced this issue Aug 2, 2022
Fixes #23517

By defining inputs and a semaphore file as the output, PackageValidation doesn't run anymore in an no-op incremental build. In the example of dotnet/runtime, this saves nearly two minutes of unnecessary work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants