Skip to content
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

Stop harvesting old frameworks in some libraries #51689

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Apr 22, 2021

The removed configurations (few netstandard1.x, portable*, netcore50, net46)
of the touched packages aren't built anymore. Instead
the already built matching binaries from the latest available packages
are redistributed when packaging these libraries.

Dropping these assets as the minimum supported set of platforms are ones
that support netstandard2.0. For .NET Framework, there's still a net461
configuration present to avoid binding redirect issues.

Contributes to #47530

The removed configurations (few netstandard1.x, portable*, netcore50)
of the touched packages aren't built anymore. Instead
the already built matching binaries from the latest available packages
are redistributed when packaging these libraries.

Dropping these assets as the minimum supported set of platforms are ones
that support netstandard2.0. For .NET Framework, there's still a net461
configuration present to avoid binding redirect issues.

Contributes to dotnet#47530
@ghost
Copy link

ghost commented Apr 22, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

The removed configurations (few netstandard1.x, portable*, netcore50)
of the touched packages aren't built anymore. Instead
the already built matching binaries from the latest available packages
are redistributed when packaging these libraries.

Dropping these assets as the minimum supported set of platforms are ones
that support netstandard2.0. For .NET Framework, there's still a net461
configuration present to avoid binding redirect issues.

Contributes to #47530

Author: ViktorHofer
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@ViktorHofer
Copy link
Member Author

System.Security.AccessControl needs to be delayed until System.IO.Pipes.AccessControl is completed.

@ericstj ericstj added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Apr 22, 2021
@ghost ghost added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Apr 22, 2021
</ItemGroup>
<!-- TODO: Re-enable support check after the 6.0 version of the package is released. -->
Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate? What was going wrong here?

Copy link
Member Author

Choose a reason for hiding this comment

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

These were the errors that I wasn't sure how to deal with them:

Errors
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETCore,Version=v4.5 should support System.Reflection.Context inbox but contained a reference assemblies: ref/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="netcore45" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETCore,Version=v4.5 should support System.Reflection.Context inbox but contained a implementation assemblies: lib/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="netcore45" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETCore,Version=v4.5.1 should support System.Reflection.Context inbox but contained a reference assemblies: ref/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="netcore451" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETCore,Version=v4.5.1 should support System.Reflection.Context inbox but contained a implementation assemblies: lib/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="netcore451" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETPortable,Version=v4.6,Profile=Profile44 should support System.Reflection.Context inbox but contained a reference assemblies: ref/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="portable46-net451+win81" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETPortable,Version=v4.6,Profile=Profile44 should support System.Reflection.Context inbox but contained a implementation assemblies: lib/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="portable46-net451+win81" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETPortable,Version=v4.5,Profile=Profile7 should support System.Reflection.Context inbox but contained a reference assemblies: ref/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="portable45-net45+win8" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework .NETPortable,Version=v4.5,Profile=Profile7 should support System.Reflection.Context inbox but contained a implementation assemblies: lib/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="portable45-net45+win8" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework Windows,Version=v8.0 should support System.Reflection.Context inbox but contained a reference assemblies: ref/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="win8" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
    C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): Framework Windows,Version=v8.0 should support System.Reflection.Context inbox but contained a implementation assemblies: lib/netstandard1.1/System.Reflection.Context.dll.  You may need to add <InboxOnTargetFramework Include="win8" /> to your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]

I made sure that the generated nupkg has the expected state, that's why I disabled the support check.

Copy link
Member

Choose a reason for hiding this comment

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

This is because S.R.C is marked as inbox in the package index. The inbox validation doesn't understand that you can decide to not represent an assembly that's inbox (here it would just get a placeholder).

I think you can make this go away by adding <InboxOnTargetFramework Include="portable-net45+win8" /> It looks like that Harvesting was only harvesting the placeholder files.

Copy link
Member Author

@ViktorHofer ViktorHofer Apr 22, 2021

Choose a reason for hiding this comment

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

I can't get this working. After adding the InboxOnTargetFramework items for both portables and win8, I now get the following errors:

C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on .NETCore,Version=v5.0/win10-x86 but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="netcore50" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on .NETCore,Version=v5.0/win10-x86-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="netcore50" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on .NETCore,Version=v5.0/win10-x64 but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="netcore50" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on .NETCore,Version=v5.0/win10-x64-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="netcore50" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on .NETCore,Version=v5.0/win10-arm but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="netcore50" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on .NETCore,Version=v5.0/win10-arm-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="netcore50" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0/win10-x86 but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0/win10-x86-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0/win10-x64 but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0/win10-x64-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0/win10-arm but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0/win10-arm-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0.16299/win10-x86 but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0.16299" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0.16299/win10-x86-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0.16299" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0.16299/win10-x64 but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0.16299" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0.16299/win10-x64-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0.16299" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0.16299/win10-arm but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0.16299" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]
C:\Users\vihofer\.nuget\packages\microsoft.dotnet.build.tasks.packaging\6.0.0-beta.21221.6\build\Packaging.targets(1119,5): error : System.Reflection.Context should be supported on UAP,Version=v10.0.16299/win10-arm-aot but has a compile placeholder.  You may need to remove InboxOnTargetFramework Include="uap10.0.16299" /> from your project. [C:\git\runtime2\src\libraries\System.Reflection.Context\pkg\System.Reflection.Context.pkgproj]

If there isn't an easy solution to it I'd be fine to keep the support check for this package disabled.

Copy link
Member

Choose a reason for hiding this comment

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

I see, because those are OOB frameworks, so the package has to provide an asset. One solution would be to remove the inbox entries from the index just for this package. That would avoid the original issue you mentioned.

"InboxOn": {
"net45": "4.0.0.0",
"portable46-net451+win81": "4.0.0.0",
"portable45-net45+win8": "4.0.0.0",
"uap10.0.16299": "4.0.3.0",
"win8": "4.0.0.0"

Remove the portable entries and win8 (effectively "lying" about what's in those targeting packs). Alternatively you could plumb a suppression that told validation to not check for support for some frameworks (take the existing hook you added and consider using it in more places) and consume that near here: https://github.com/dotnet/arcade/blob/e7ede87875f41a9b3df898ae08da5ebc96e24f56/src/Microsoft.DotNet.Build.Tasks.Packaging/src/ValidatePackage.cs#L585

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks a lot for the suggestion Eric. I decided to trim the packageIndex graph as I wouldn't want to spend much on a solution for obsolete frameworks. Either the deprecation of the packageIndex or the removal of old netstandard1.x assets will happen at some point which will hopefully make the consideration of these old framework unnecessary.

@GrabYourPitchforks
Copy link
Member

The removed configurations (few netstandard1.x, portable*, netcore50, net46) of the touched packages aren't built anymore. Instead the already built matching binaries from the latest available packages are redistributed when packaging these libraries.

Can you clarify what is meant by this statement? Does this mean that System.Whatever.6.0.0.0.nupkg will no longer carry netstandard1.0 assets, so anybody who targets netstandard1.0 will instead need to pull in System.Whatever.5.0.0.0.nupkg? (And that such packages are no longer supported as of 8 months from now, when the .NET 5 wave all-up goes out of support?)

@ViktorHofer
Copy link
Member Author

Can you clarify what is meant by this statement? Does this mean that System.Whatever.6.0.0.0.nupkg will no longer carry netstandard1.0 assets, so anybody who targets netstandard1.0 will instead need to pull in System.Whatever.5.0.0.0.nupkg? (And that such packages are no longer supported as of 8 months from now, when the .NET 5 wave all-up goes out of support?)

Sent you more information about this offline.

@ViktorHofer
Copy link
Member Author

Test failing leg was a networking hiccup when cloning the docker image. The other legs were canceled when I pushed a new commit (probably a GH race condition).

@ViktorHofer ViktorHofer merged commit 8970941 into dotnet:main Apr 23, 2021
@ViktorHofer ViktorHofer deleted the HarvestingLibs branch April 23, 2021 18:32
@ghost ghost locked as resolved and limited conversation to collaborators May 23, 2021
@ViktorHofer ViktorHofer removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-libraries breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants