Skip to content

Ingest updated packages from dotnet/runtime #20300

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

Merged
merged 13 commits into from
Apr 6, 2020
Merged

Conversation

JunTaoLuo
Copy link
Contributor

@JunTaoLuo JunTaoLuo commented Mar 29, 2020

  • Ingest transport package from dotnet/runtime.
  • Ingest extensions packages from dotnet/runtime

@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 30, 2020
@ericstj ericstj requested a review from a team March 31, 2020 17:21
@JunTaoLuo JunTaoLuo force-pushed the johluo/ingest-runtime branch from a8bf675 to 2ef5d0a Compare April 2, 2020 07:27
@@ -28,6 +28,9 @@ Microsoft.Extensions.Diagnostics.HealthChecks.IHealthChecksBuilder
<Reference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" />
<Reference Include="Microsoft.Extensions.Hosting.Abstractions" />
<Reference Include="Microsoft.Extensions.Options" />

<!-- TODO: Remove this workaround -->
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericstj @maryamariyan Here's an interesting change. The package M.E.Hosting.Abstractions built in Extensions has a dependency on M.E.Logging.Abstractions:

      <group targetFramework=".NETCoreApp5.0">
        <dependency id="Microsoft.Extensions.Configuration.Abstractions" version="5.0.0-preview.4.20201.2" exclude="Build,Analyzers" />
        <dependency id="Microsoft.Extensions.DependencyInjection.Abstractions" version="5.0.0-preview.4.20201.2" exclude="Build,Analyzers" />
        <dependency id="Microsoft.Extensions.FileProviders.Abstractions" version="5.0.0-preview.4.20201.2" exclude="Build,Analyzers" />
        <dependency id="Microsoft.Extensions.Logging.Abstractions" version="5.0.0-preview.4.20201.2" exclude="Build,Analyzers" />
      </group>

however, the one built from runtimes does not:

      <group targetFramework=".NETCoreApp5.0">
        <dependency id="Microsoft.Extensions.Configuration.Abstractions" version="5.0.0-preview.4-runtime.20201.16" />
        <dependency id="Microsoft.Extensions.DependencyInjection.Abstractions" version="5.0.0-preview.4-runtime.20201.16" />
        <dependency id="Microsoft.Extensions.FileProviders.Abstractions" version="5.0.0-preview.4-runtime.20201.16" />
      </group>

I'm able to work around this by adding an explicit reference in projects like this but I'm curious why this is happening. Is dotnet/runtime doing some smart trimming of unused references? I took a look at Hosting.Abstractions and it seems like it doesn't actually use anything from Logging.Abstractions. Is that why that reference is removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The packaging system in dotnet/runtime only includes PackageReferences based on assembly references in the final assembly. So if a reference is never used it won't end up in the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be a breaking change? If we are okay with making the breaking change, we should post an announcement.

Copy link
Member

@ericstj ericstj Apr 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We typically never make this type of breaking change as our packages only ever expose types which are part of the reference surface area and we never remove types, so it's not something we really do. ASP.NET must make changes to package dependencies all the time: do you document any time you remove a PackageReference from your implementation? The fix is for people to simply add a reference to the package they are already using.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would need to document it but I can't find an example of when we did it in the past. @anurse do we need to announce that we're removing a package dependency from a package? For example, M.E.Hosting.Abstractions no longer depends on M.E.Logging.Abstractions so the user will need to add an explicit reference to it in their csproj.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anurse @Pilchie any thoughts on how we should respond to this "breaking"ish change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JunTaoLuo if you've added all "lost" Microsoft.Extensions.Logging.Abstractions references, this dependency removal is not a breaking change in the shared framework nor in any package shipped from dotnat/aspnetcore. Have you confirmed that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I didn't address the other packages/assemblies that are affected, for example https://github.com/dotnet/aspnetcore/blob/master/src/HealthChecks/HealthChecks/src/Microsoft.Extensions.Diagnostics.HealthChecks.csproj#L30 is now missing a transitive dependency on System.ComponentModel.Annotations. However, I want to address this separately. After another look at the runtime/ref packs, I'd like to get this in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say we can make an announcement in aspnet/Announcments and call it good. It's a pretty minor breaking change in a major version.

@JunTaoLuo JunTaoLuo marked this pull request as ready for review April 3, 2020 23:49
@JunTaoLuo
Copy link
Contributor Author

@dotnet/aspnet-build @dotnet/extensions-migration This PR is ready for another look. I've fixed up all the remaining failing tests.

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: but we may need to react to resolution of "breaking change" conversation

@@ -28,6 +28,9 @@ Microsoft.Extensions.Diagnostics.HealthChecks.IHealthChecksBuilder
<Reference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" />
<Reference Include="Microsoft.Extensions.Hosting.Abstractions" />
<Reference Include="Microsoft.Extensions.Options" />

<!-- TODO: Remove this workaround -->
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JunTaoLuo if you've added all "lost" Microsoft.Extensions.Logging.Abstractions references, this dependency removal is not a breaking change in the shared framework nor in any package shipped from dotnat/aspnetcore. Have you confirmed that?

@JunTaoLuo
Copy link
Contributor Author

I checked the ref pack and the runtime packs for Windows-x64 and LInux-x64. All seems correct.

@JunTaoLuo JunTaoLuo merged commit 3ec1676 into master Apr 6, 2020
@JunTaoLuo JunTaoLuo deleted the johluo/ingest-runtime branch April 6, 2020 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants