-
Notifications
You must be signed in to change notification settings - Fork 1k
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
use MSBuild binlog to report dependencies #10597
base: main
Are you sure you want to change the base?
Conversation
1edef09
to
eaa3f30
Compare
cccbcf2
to
60c6971
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With MSBuild evaluation, will this improve (or fix) the way dependabot handles NuGet updates for projects that multi-target and/or prevent transient packages being updated unnecessarily?
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs
Outdated
Show resolved
Hide resolved
The handling is certainly better. When detecting dependencies we can now handle all |
60c6971
to
2ed2f0f
Compare
I've added tests explicitly checking:
|
This PR contains a temporary commit to redirect the smoke tests. That commit will have to be removed prior to merging.
This PR has a corresponding smoke test PR that will hav to be merged at the same time: dependabot/smoke-tests#227
Previously, a temporary project was created to try and determine a project's full set of dependencies. This wasn't always 100% accurate and could be slow due to all of the file copying.
This PR instead invokes MSBuild directly against the relevant project and produces a binary log (
.binlog
) that is then analyzed to get the full set of dependencies.One of the benefits to this approach is that any give package can be directly associated with its parent project and MSBuild handles all of the complex property evaluation that might occur.
There are two main differences in behavior:
$(SomePackageVersion)
; we know exactly what was resolved.Directory.Packages.props
as the source of a dependency. While the dependency version might be found there, the dependency really lies with the project file. This has no effect on actually performing the update; that occurs just like before.Another relatively minor side effect is that we no longer report
NETStandard.Library
as a dependency; it's explicitly excluded. While it is a NuGet package that gets resolved, it's not one that can be directly updated so it is simply no longer reported.The vast majority of the changes in this PR are to tests.
The primary file to review is
SdkProjectDiscovery.cs
; that's where the dependency analysis was completely migrated to the binary log.