Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Remove dependencies on WindowsIdentity from Unix binaries #5576

Merged
merged 1 commit into from
Jan 21, 2016

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Jan 21, 2016

It looks like a couple libraries were using
System.Security.Principal.Windows unintentionally in their
Unix implementations. @dagood discovered this when
trying to restore our tools-runtime project for unix RIDs.

This fix removes the dependencies from those libs
in the CoreFx repro.
/cc @CIPop @saurabh500

It looks like WCF also has this problem as well,
since it hasn't split System.Private.ServiceModel
into windows specific packages.
/cc @StephenBonikowsky

It looks like a couple libraries were using
System.Security.Principal.Windows unintentionally in their
Unix implementations.  @dagood discovered this when
trying to restore our tools-runtime project for unix RIDs.

This fix removes the dependencies from those libs
in the CoreFx repro.
/cc @CIPop @saurabh500

It looks like WCF also has this problem as well,
since it hasn't split System.Private.ServiceModel
into windows specific packages.
/cc @StephenBonikowsky
@@ -2,7 +2,12 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="System.Data.SqlClient.csproj" />
<Project Include="System.Data.SqlClient.csproj">
Copy link
Contributor

Choose a reason for hiding this comment

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

@ericstj What do these changes do ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Those are specifying that you actually have 2 distinct builds of the library: one for windows and one for linux (actually, unix but we don't have a unix only convention /cc @weshaggard)
This makes it consistent with the package.
The way it was structured before was as if the library only had a single cross-platform build.

@saurabh500
Copy link
Contributor

@ericstj The code changes look good to me. I want to understand the changes in System.Data.SqlClient.builds

@ericstj
Copy link
Member Author

ericstj commented Jan 21, 2016

This change is just disabling/throwing on the code path that was hitting WindowsIdentity. You might need to instead replace with an appropriate impl on UNIX.

@@ -0,0 +1,18 @@
// Copyright (c) Microsoft. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should have a single file ContextAwareResult.WindowsIdentityNop.cs, or something like that, which we use for both the unix and netcore50 builds, rather than duplicating the same contents.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thought about that. My imppression was the networking team would want to fill in the real implementation for unix.

Copy link
Member

Choose a reason for hiding this comment

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

My guess is these will remain nops, but ok.

@stephentoub
Copy link
Member

LGTM. Thanks for fixing this, Eric.

@dagood
Copy link
Member

dagood commented Jan 21, 2016

Awesome, thanks Eric!

@CIPop
Copy link
Member

CIPop commented Jan 21, 2016

Thanks @ericstj!

For the changes for ContextAwareResults: LGTM

ericstj added a commit that referenced this pull request Jan 21, 2016
Remove dependencies on WindowsIdentity from Unix binaries
@ericstj ericstj merged commit c8818d1 into dotnet:master Jan 21, 2016
@ericstj
Copy link
Member Author

ericstj commented Jan 21, 2016

The reason this is even possible is that we cannot represent dependencies that differ based on RID, so we share the same project.json for Windows and Unix. We need NuGet/Home#1660 and https://github.com/dotnet/cli/issues/465

@ericstj ericstj deleted the removeWindowsDependencies branch January 27, 2016 20:08
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…dencies

Remove dependencies on WindowsIdentity from Unix binaries

Commit migrated from dotnet/corefx@c8818d1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants