aspire
aspire copied to clipboard
Basic implementation of build cache.
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 cleanis 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-cacheoption to bothaspire runandaspire 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
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.