Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Move System.Net.Sockets to netstandard 1.7#12249

Merged
ericeil merged 10 commits into
dotnet:masterfrom
ericeil:socket_17_2
Oct 3, 2016
Merged

Move System.Net.Sockets to netstandard 1.7#12249
ericeil merged 10 commits into
dotnet:masterfrom
ericeil:socket_17_2

Conversation

@ericeil
Copy link
Copy Markdown
Contributor

@ericeil ericeil commented Sep 30, 2016

Moves System.Net.Sockets to netstandard 1.7. Thanks to @ericstj for the help with this!

Fixes #11812.

cc: @stephentoub, @CIPop, @davidsh, @karelz, @weshaggard

@ericeil
Copy link
Copy Markdown
Contributor Author

ericeil commented Sep 30, 2016

@dotnet-bot test Innerloop CentOS7.1 Debug Build and Test please Another CentOS segfault

@ericeil
Copy link
Copy Markdown
Contributor Author

ericeil commented Sep 30, 2016

@dotnet-bot Test Outerloop Windows_NT Debug please
@dotnet-bot Test Outerloop Ubuntu14.04 Debug please
@dotnet-bot Test Outerloop OSX Debug please

<ItemGroup Condition="'$(TargetGroup)'=='netcore50'">
<Compile Include="$(CommonPath)\Microsoft\Win32\SafeHandles\SafeHandleZeroOrMinusOneIsInvalid.cs">
<Link>Common\Microsoft\Win32\SafeHandles\SafeHandleZeroOrMinusOneIsInvalid.cs</Link>
</Compile>
Copy link
Copy Markdown
Contributor

@davidsh davidsh Oct 1, 2016

Choose a reason for hiding this comment

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

Should we even this Common code anymore? I thought SafeHandleZeroOrMinusOneIsInvalid and friends was being added back to the public API surface (i.e. part of .NET Standard 2.0). So, shouldn't these references just be coming from Microsoft.Win32.SafeHandles contract via a project.json reference?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

They have already been added back, but netcore50 doesn't support netstandard1.7(aka 2.0), so the common source is still needed for that build.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When will netcore50 support .NET Standard 2.0? Or perhaps the real question is when will the "UWP" version of this support these APIs? Is there going to be a 'netcore51' for example? I did see uap10.1 vs. uap10.0 so I was wondering if there was a net platform definition for a revised version for UWP, similar to what is happening for 'netcoreapp10' vs. 'netcoreapp11'.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

netcore50 will never support .NET Standard 2.0. We do not plan to version the netcore tfm for this as netcore50 has special meaning to various systems and so it is essentially a dead end. However UWP with uap10.1 tfm is currently the target to support .NET Standard 2.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, are we changing our source code where we use "if netcore50". And we use that term in our folder names and partial class names. The documentation needs to be updated if we don't use "netcore50" TFM anymore. We have separate implementations for some of the networking libraries, so need good guidelines to keep this organized and building correctly.

// An IASyncResult, representing the read.
#if !netcore50
override
#endif
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we doing this special if block for !netcore50?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When we build for netcore50, we're building against the older contract where these don't exist on Stream, so there's nothing to override.

Copy link
Copy Markdown
Member

@weshaggard weshaggard Oct 3, 2016

Choose a reason for hiding this comment

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

Instead of doing this #ifdef'ing can we just remove the netcore50 build now? If you remove the build configuration we will essentially pick-up and reship the version for the last stable package.

We we do go that route and remove the netcore50 configuration from the live build then we will have the accept that we aren't going to be making in bug fixes in that configuration any longer and if we do need to fix something for it we will have to do it from the release/servicing branch or add back the configuration at that time.

For that reason I will leave it up to you guys to decide whether or not to remove the live build or not.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think that's wise given it'll just need to come back for UAP10.1?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Scratch that, I see what you're saying. This won't need to come back for UAP10.1 since UAP10.1 will have this version of stream. I had recommended that @ericeil keep the netcore50 config around and building so that it would be eaiser to add the UAP10.1 config when that work is done, however here it's making the current work harder. Another option would be to bring up a UAP10.1 config now, but I suspect that'd require some more hacks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand why we would drop 'netcore50' suport. I don't really care what moniker we call it. But we need to have UWP working at all times. Will I still be able to build a UWP app and use System.Net.Sockets (or any other networking library). And when/how will UWP be updated in order to use the newly added contract API surface. I've heard it is when "uap10.1" gets working. But I don't understand exactly when that is and how it works.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've logged issue #12331 to track this potential extra work. I don't think we should hold this PR for that decision.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@davidsh removing the live netcore50 build doesn't break UWP. It just implies that we are going to pull the netcore50 version of the library from the last stable shipped package and reship that in the current package. It just allows us to eliminate a bunch of the extra live build configurations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@weshaggard Ok. So, then when can be start to have UWP working with this expanded API set? Is this "uap10.1"? If so, does that live build work? Or is there work to do in this library to make that happen. I need to get this working in UWP for the expanded (a.k.a netstandard17.....a.k.a NET Standard 2.0).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes most of the .NET Standard 2.0 work is targeting "uap10.1", however that ties to a new tool chain that is also under development in TFS.

For some things we could add them to the netcore50 version of the library assuming it isn't part of the SharedLibrary and doesn't require any new dependent APIs that are in contracts that are part of the SharedLibrary. My expectation is that most of the .NET Standard 2.0 will require newer versions of things like System.Runtime which means we won't really be able to support them in netcore50 and we will need to use uap10.1 instead.

<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'net463'">true</IsPartialFacadeAssembly>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.7</NuGetTargetMoniker>
<AssemblyVersion Condition="'$(TargetGroup)' == 'netcore50'">4.1.1.0</AssemblyVersion>
<DefineConstants Condition="'$(TargetGroup)'=='netcore50'">$(DefineConstants);netcore50</DefineConstants>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: can you make the spacing around the == consistent in these conditions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

[OuterLoop] // TODO: Issue #11345
[Fact]
[PlatformSpecific(PlatformID.Windows)]
[PlatformSpecific(Xunit.PlatformID.Windows)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now that #12284 has been merged, fully qualifying the enum is no longer necessary as it has been renamed PlatformID -> TestPlatforms. Sorry for the merge conflicts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved the merge conflicts. :)

@ericeil
Copy link
Copy Markdown
Contributor Author

ericeil commented Oct 3, 2016

@dotnet-bot test Innerloop CentOS7.1 Debug Build and Test please
@dotnet-bot test Innerloop CentOS7.1 Release Build and Test please
(previous build hit dotnet/dotnet-ci#307)

@ericeil
Copy link
Copy Markdown
Contributor Author

ericeil commented Oct 3, 2016

@dotnet-bot Test Outerloop Windows_NT Debug please
@dotnet-bot Test Outerloop Ubuntu14.04 Debug please
@dotnet-bot Test Outerloop OSX Debug please

@ericeil
Copy link
Copy Markdown
Contributor Author

ericeil commented Oct 3, 2016

Ubuntu outerloop leg failed due to #5660. Not caused by this change.

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Make Sockets target ns1.7, maintaining old configs

* Remove netstandard1.3 implementations.

* Fix NetworkStream overrides

* Fix serialization attributes

* Move tests to netstandard1.7




Commit migrated from dotnet/corefx@3b71aec
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants