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

Bring back System.IO.Pipes.AccessControl package and make it available in .NET 5.0 #38177

Merged
merged 4 commits into from Jun 23, 2020

Conversation

carlossanlop
Copy link
Member

Fixes: #38123

Pending making sure we don't regress this: #30813

cc @joperezr @safern @ericstj @Jozkee

@ghost
Copy link

ghost commented Jun 19, 2020

Tagging subscribers to this area: @safern, @ViktorHofer
Notify danmosemsft if you want to be subscribed.

@carlossanlop carlossanlop added this to In progress in System.IO - Pipes via automation Jun 19, 2020
@carlossanlop carlossanlop added this to the 5.0.0 milestone Jun 19, 2020
Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

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

You need to add the new PackageVersion here and map it to the AssemblyVersion:
https://github.com/dotnet/runtime/blob/master/src/libraries/pkg/baseline/packageIndex.json#L3384

@carlossanlop
Copy link
Member Author

@ericstj What is it exactly that you want me to test to make sure we don't regress the wpf scenario? @joperezr and I did try running the commands specified on that issue using my new package and it does still flag a conflict on that assembly, but Joe and I believe that this problem is caused by the netcoreapp3.0 targeting pack desktop facades which still forward to specific versions (as opposed to just forwarding to 0.0.0.0). My new package is not fixing this as I am just harvesting for everything except .net5 but it is also not making it worse, we basically have the same behavior than the previous package except that we now have an extra .NET 5 asset.

@ericstj
Copy link
Member

ericstj commented Jun 22, 2020

@ericstj What is it exactly that you want me to test to make sure we don't regress the wpf scenario?

We should find where WindowsDesktop consumes the old package and make sure it is set up to subscribe to the new package we build. Here's what I found:
https://github.com/dotnet/windowsdesktop/blob/3285e1b58507eb88a1cd7be4ee03fe08cbbe6b12/pkg/windowsdesktop/src/windowsdesktop.depproj#L18

@ericstj
Copy link
Member

ericstj commented Jun 22, 2020

Also we should make sure we undo the stable version reference from Windows.Compatibility:

<!-- Packages we don't build in master anymore -->
<LibraryPackage Include="System.IO.Pipes.AccessControl">
<Version>4.5.1</Version>
</LibraryPackage>

<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<IncludeDefaultReferences Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">false</IncludeDefaultReferences>
<AssemblyVersion Condition="'$(TargetFramework)' == 'netcoreapp2.1'">4.0.3.0</AssemblyVersion>
Copy link
Member

Choose a reason for hiding this comment

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

@ericstj believes that we should be able to get away without setting this and using 5.0.0.0

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so, because we are still harvesting runtimes/win/lib/netcoreapp2.1 asset that is 4.0.3.0, so if we make lib/netcoreapp2.1 be 5.0.0.0 our packaging validation will fail saying that the compile time asset was found to support 5.0.0.0 but the runtime asset was found to support 4.0.3.0. If we wanted to do this, we would have to go and bring back the netcoreapp2.1-Windows_NT live build.

Copy link
Member

Choose a reason for hiding this comment

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

Ah that's right.

Copy link
Member

Choose a reason for hiding this comment

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

I thought we only needed to build net5.0 assets since that was the only place we could add surface area. @carlossanlop?

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 needed in order to avoid bringing the refs. This asset will only be used for compile time; but I guess that's a good point.

We would need to exclude this APIs for older targets so that they're not available there.

Copy link
Member

Choose a reason for hiding this comment

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

See here: #38177 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Actually, maybe the goal of avoiding using refs here might have been bad advice on my part. This is a full-facade in src, but contains typedefs in ref. By only shipping the src assembly we're shipping dangling type-forwards to the compiler 🤦‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

Ah that's right... dang it. No worries, none of use caught it either 😄

@carlossanlop
Copy link
Member Author

carlossanlop commented Jun 22, 2020

Also we should make sure we undo the stable version reference from Windows.Compatibility:

<!-- Packages we don't build in master anymore -->
<LibraryPackage Include="System.IO.Pipes.AccessControl">
<Version>4.5.1</Version>
</LibraryPackage>

Addressed in the latest commit, @ericstj. PTAL.

<IsPartialFacadeAssembly Condition="'$(TargetsWindows)' == 'true'">true</IsPartialFacadeAssembly>
<OmitResources Condition="'$(TargetsWindows)' == 'true'">true</OmitResources>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsWindows)' != 'true'">SR.PlatformNotSupported_AccessControl</GeneratePlatformNotSupportedAssemblyMessage>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;netcoreapp2.1;$(NetCoreAppCurrent)</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

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

@ericstj we needed to add the netcoreapp2.1 config in order to workaround the fact that we were missing two declared dependencies in NCA2.1 given that it would take now the NS2.0 assembly as the compile asset. This workaround is less than ideal, but likely preferable to add back the refs to the package, do you agree with that

Copy link
Member

Choose a reason for hiding this comment

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

I chatted with him on my 1:1 with regards on this, and he said that he prefers doing this than bringing back the ref assemblies and that seems like the best workaround.

He also suggested that we could exclude the compile asset from the package and so it would only be used to calculate dependencies but that either way was fine.

Copy link
Member

Choose a reason for hiding this comment

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

I'm a little surprised we didn't copy the PackageDependencies from netstandard2.0 to netcoreapp2.1 here: https://github.com/dotnet/arcade/blob/2fd7a99a9bc16b04312b816e3ff0aade830efbeb/src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.targets#L680

Barring that another hack we could use here would be to copy the netstandard2.0 harvested asset into lib/netcoreapp2.1 as well.

System.IO - Pipes automation moved this from In progress to Reviewer approved Jun 22, 2020
@carlossanlop
Copy link
Member Author

@carlossanlop carlossanlop merged commit 80a7935 into dotnet:master Jun 23, 2020
System.IO - Pipes automation moved this from Reviewer approved to Done Jun 23, 2020
@carlossanlop carlossanlop deleted the PipesAclAssemblyFix branch June 23, 2020 00:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

APIs in System.IO.Pipes.AccessControl are not being exposed
5 participants