-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Optimize away separate evaluation for /restore when the restore didn't actually pull down new props/targets #2677
Comments
This is a damn good idea. This would immediately save 400ms in our no-changes //cc @jainaashish |
It should be possible to find the last modified date of .nuget.g.props and .nuget.g.targets before restore and compare it to the modified date after restore. If they are the same then there haven't been any changes. Restore checks that something actually changed before modifying the props/targets. These files should also always exist, if they aren't there then the project is in a bad state. |
To do that we need to evaluate and know about stuff that only NuGet should know about. I'd prefer the restore target returning something. |
@davkean that makes sense. Restore could return a RestoreResult item with metadata for the props/targets change status. I've opened NuGet/Home#6122 to track the work for adding this to restore. |
Seems like fix is pending review from MSBuild team: NuGet/NuGet.Client#1831. |
This can be closed now as it will not bring us the initially expected benefit, due to the fact that restore evaluation is with ExcludeRestorePackageImports=true. For OrchardCore: /t:build /restore /t:restore,build |
Agreed. @nguerrera? |
We're moving the CLI's implicit restore over to using /restore. I was describing to @DustinCampbell how this will eliminate the need for two processes, but not the need for two evaluations. He pointed out that we don't always need two evaluations.
Common cases:
Perhaps the Restore target could return a value to indicate whether or not it invalidated the evaluation. If it indicates that no props/targets have changed, then we could reuse the same evaluation for build...
cc @emgarten @jeffkl @AndyGerlicher @davkean
The text was updated successfully, but these errors were encountered: