dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.48k stars 4.76k forks source link

Remove the versionless netstandard alias #28569

Closed wtgodbe closed 4 years ago

wtgodbe commented 5 years ago

Based on conversations with @ericstj, this should involve (at least) the following:

  1. Move all package configurations to versioned TargetGroups
  2. Remap versionless netstandard to netstandard2.1

CC @danmosemsft @terrajobst @karelz @ViktorHofer

A couple TODOS: https://github.com/dotnet/corefx/commit/c05b1971dc2e554522218810f663f534b75934e6#diff-085f6f9ba6ffb73170783b85bbf23af8R78 https://github.com/dotnet/corefx/commit/c05b1971dc2e554522218810f663f534b75934e6#diff-c6fe2f196a3537701f13b5395886c069R20

ViktorHofer commented 5 years ago

nr 2 involves changing https://github.com/dotnet/corefx/blob/master/eng/configurations/targetgroups.props#L131 and additionally adding a dedicated targetgroup for netstandard2.1 in that file.

BrennanConroy commented 5 years ago

Does this change mean we'll get APIs like ChannelReader<T>.ReadAllAsync([EnumeratorCancellation] CancellationToken cancellationToken) when targeting netstandard2.1? Or do we need to request specific libraries to provide netstandard2.1 versions?

ericstj commented 5 years ago

This isn't a requirement for the infra for 3.0 and will only introduce more risk. Projects can compile against netstandard2.1 in corefx today. We'll decide what we want to do here for v.Next as well as how that plays into config system changes.

BrennanConroy commented 5 years ago

Are you open to moving individual projects to netstandard2.1? SignalR would like System.Text.Channels to have a netstandard2.1 target

wtgodbe commented 5 years ago

@BrennanConroy yes, feel free to do so - @ViktorHofer is already doing this with RefContext & CompRegistration: https://github.com/dotnet/corefx/pull/38196

ViktorHofer commented 5 years ago

Of course we don't want to do this for every project as it will result in more cross-compilation but for selected projects where it makes sense, sure.

ViktorHofer commented 5 years ago

I still believe we should do nr1 (top post) but I'm not convinced that nr2 brings much value. Instead I believe we should entirely remove the version-less "netstandard" alias.

ericstj commented 5 years ago

Yeah, previously the version-less one was an indication of the one that was "safe" to use during a vertical source build. Maybe we just say that all netstandard versions 2.0 and later should be safe to use from a source build and any of the cases where we need to restore additional packages to do so, need to be supported by reference packages.

terrajobst commented 5 years ago

So what is the work that is being tracked here? Is it a opportunistic "here is something to think about" or is there infra work that needs to happen? From what @wtgodbe said above, project can already compile for .NET Standard 2.1 in CoreFX.

ericstj commented 5 years ago

Let this track removal of netstandard without a version. It's not required for the n2.1 work.

terrajobst commented 5 years ago

Gotcha. Will remove it from the board then.