aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Basic implementation of build cache.

Open mitchdenny opened this issue 7 months ago • 1 comments

Fixes: #8990

This PR introduces a build cache for the Aspire CLI. It works by first executing msbuild to get a collection of properties and items and computing a hash of that content. If the inputs to the build have not changed, then they should remain the same. If a build has successfully completed successfully previously with the same hash then we don't bother triggering a build again.

This implementation has a few problems (not quite ready yet):

  • [ ] If the build completed successfully (so fingerprint created) and a dotnet clean is performed then the fingerprint will match but the outputs won't be available. We need to figure out the best way of validating that build outputs are available to run.
  • [x] We need to add a --no-cache option to both aspire run and aspire publish.
  • [x] Need to update unit tests and add more test coverage for run/publish commands.

https://github.com/user-attachments/assets/8fde1e8b-e6b6-463e-afd3-1c6b4151f24b

mitchdenny avatar Apr 13 '25 13:04 mitchdenny

Force pushed updated code base on latest in main. In terms of transitivity we could look at all the project references, and for every project reference compute the same fingerprint. Hacky as - and the cure could be worse than the disease in terms of overall build performance - particularly on larger projects.

mitchdenny avatar Apr 30 '25 03:04 mitchdenny