-
Notifications
You must be signed in to change notification settings - Fork 1.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
DTB only returns top-level package references #11358
DTB only returns top-level package references #11358
Conversation
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.
Some nit in the beginning. And then I am lost at 1baaca2 .
Looks like tests are start from fresh. So I don't know what is actually removed. We should fine a time to look into this change together
src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs
Outdated
Show resolved
Hide resolved
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.
Had an about 1 hour meeting with Drew. Now I understand this change. The only consumer of this code is project system. So removing all these information should be safe. The code left is also straightforward. The new tests around the code are also sufficient to cover and to understand what the code is doing.
@dsplaisted do you want to have a look at this PR since this it is rather big? I think it is good after talking to Drew. We plan to merge this in a day so we have more time for an another team |
Just learnt Daniel is OOF today. Could we wait until end of the Friday? |
We should also update the minimum MSBuild version to 16.7 for this release, right? |
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.
Looks good.
Should we also update the minimum MSBuild version to 16.7 for this release? Otherwise using this SDK with an older VS will have a broken dependency tree, right?
To Drew's questions:
Let's remove the ReportAssetsLogMessages
task.
I think the TargetDefinitions
, FileDefinitions
, and FileDependencies
may be used by some of our build infrastructure (in dotnet/installer, for example). However, I would propose that by default we don't produce them, with a flag that can be used to turn them back on.
@KathleenDollard, the two previous changes are ones we should track / document as part of our "possibly breaking changes for MSBuild logic" process.
src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs
Show resolved
Hide resolved
Changes to the design-time build targets used to populate the dependency node mean that this SDK will only work with VS 16.7 or later. See dotnet/sdk#11358
26f3e8f
to
17c60d0
Compare
@dsplaisted thanks for your review.
Yes, using this SDK with older VS versions will break. Submitted dotnet/toolset#4542 with the update.
Removed in f868606. Please review.
Added flag |
String.Replace(char, char) allocates a new string even if no replacement is made.
These are no longer being consumed by the Dependencies node, which now sources them directly from the assets file.
From now on, this task will only return top-level items, so we do not need to output assemblies, nor do we need to accept FileDefinitions.
…nTime Performance work on the Dependencies node in dotnet/project-system mean that only top-level package data is needed from the design-time build. This commit removes items and metadata related to transitive dependencies and hierarchy. - Remove metadata Dependencies, which used to list child IDs - Remove metadata IsTopLevelDependency, which is now implicitly true - Remove 'target' items - Remove object cloning, now that instances are immutable
Previously PreprocessPackageDependenciesDesignTime returned package dependencies for all targets, and PackageRuleHandler in the project system would filter based on TargetFrameworkMoniker. This change applies the filtering in this task instead. As part of this change we are now able to remove the target prefix from the item spec of output items. This reduces string allocation, improves the chance of pooling and reduces string manipulation by the consumer.
This metadata always has 'true' as its value. We can infer this in the project system.
This metadata always has 'Package' as its value. We can infer this in the project system.
Since VS 16.7, design-time builds no longer consume assets file diagnostics as items. This commit removes their generation and supporting code.
From VS 16.7 onwards, the DTB no longer requires items of type `TargetDefinitions`, `FileDefinitions`, `FileDependencies`. This commit stops producing them by default. To restore the previous behaviour, set the `EmitLegacyAssetsFileItems` property to `true`.
17c60d0
to
28e7900
Compare
Fixed test failures and believe this is good to merge. Please review f868606, 28e7900 and dotnet/toolset#4542. |
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.PackageDependencyResolution.targets
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniel Plaisted <[email protected]>
After dotnet/sdk#11358, EmitLegacyAssetsFileItems needs to be set to true in order to generate FileDefinitions items.
* Update dependencies from https://github.com/dotnet/sdk build 20200513.9 Microsoft.NET.Sdk From Version 3.1.400-preview.20263.1 -> To Version 3.1.400-preview.20263.9 * Update stage 0 * Stage 0 update for LKG version * Bump MSBuild version to 16.7 * Update NuGet clien version to 6609 * Fix deployment of hostfxr for SDK Resolver After dotnet/sdk#11358, EmitLegacyAssetsFileItems needs to be set to true in order to generate FileDefinitions items. Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Jacques Eloff <[email protected]> Co-authored-by: Rainer Sigwald <[email protected]> Co-authored-by: Daniel Plaisted <[email protected]>
Historically the full graph of package references has been returned in design-time builds and used to populate the Dependencies node in Solution Explorer.
This graph can be very large. Many sessions won't expand the Dependencies node, so we would like to avoid this up-front cost during solution load. This will be achieved by lazily retrieving transitive dependency information from the assets file directly when needed.
This PR modifies
PreprocessPackageDependenciesDesignTime
in the following ways:Package
(exclude others like diagnostics, targets, assemblies)ItemMetadata
type hierarchy) to reduce allocationsThe corresponding Project System changes are able to identify when the SDK is operating with this new behaviour or the old (legacy) behaviour and adapt accordingly.
Questions:
In
Microsoft.PackageDependencyResolution.targets
:Can we remove the
ReportAssetsLogMessages
task? It no longer seems necessary for our purposes, but someone theoretically may depend upon it.In this task, outputs
TargetDefinitions
,FileDefinitions
andFileDependencies
appear to be no longer used. Again, is it safe to remove them and the code that allocates them?