-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Read PackageDefinitions and PackageDependencies from the cache assets file instead of ResolvePackageDependencies #28057
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
Conversation
59f88e6
to
dab7d17
Compare
Removing all the conditions that depend on EmitLegacyAssetsFileItems since there is case when this variable is false.
I've tried this change and I see an amazing speed improvement. Thank you! |
Actually, I didn't spot the build errors that are happening after 47e09093:
I'm trying to debug the problem and implement a fix. |
Revert PR #28212 just in case it is needed. |
I'm not sure if the revert is necessary. After cleaning the solution, running restore and then testing the design time build it worked. I don't know yet what is going on, I'll keep digging tomorrow. |
This pr adds two new properties to the nuget assets cache, so it will invalidate the old cache. |
Does the cache file have a version number? Changing the file format without advertising that fact will cause errors for users that are hard to diagnose. |
I created this pr #28218 to increase the format version of the header |
Yes, indeed. Running |
Thanks for confirming. We can't ship it as is and will fix it. |
It seems that the only missing change is to update the format version. @drewnoakes if that is the case I can add your suggested changes in the same pr (in main branch) |
I'm not aware of any other required changes, but the SDK team should weigh in as they know more about the consequences of your original PR. |
Fixes #27738
We want to avoid reading the assets file because it is a large file, which can cause performance degradation in design-time builds for large projects when executing
ResolvePackageDependencies
.To improve this, the assets cache file in
ResolvePackageAssets
will now keep track ofPackageDefinitions
andPackageDependencies
.The change:
Output
PackageDefinitions
andPackageDependencies
items fromResolvePackageAssets
, and modified the targets so thatResolvePackageDependencies
is only called whenEmitLegacyAssetsFileItems
is true.All the code related to
EmitLegacyAssetsFileItems
inResolvePackageDependencies
was removed since there is case for when the value is false.Unit-tests were modified to remove
EmitLegacyAssetsFileItems
in ResolvePackageDependencies.