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

[Release 3.1] | Address Shim gss api on Linux to delay loading libgssapi_krb5.so while using Net6 #43133

Merged
merged 4 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pkg/Microsoft.Private.PackageBaseline/packageIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,10 @@
"3.0.0",
"3.1.0",
"3.1.1",
"3.1.2"
"3.1.2",
"3.1.3"
],
"BaselineVersion": "3.1.2",
"BaselineVersion": "3.1.3",
"InboxOn": {}
},
"Microsoft.Windows.Compatibility.Shims": {
Expand Down Expand Up @@ -1548,9 +1549,10 @@
"4.8.0",
"4.8.1",
"4.8.2",
"4.8.3"
"4.8.3",
"4.8.4"
],
"BaselineVersion": "4.8.3",
"BaselineVersion": "4.8.4",
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved
"InboxOn": {
"net461": "4.1.0.0",
"monoandroid10": "Any",
Expand All @@ -1574,7 +1576,8 @@
"4.6.1.0": "4.8.0",
"4.6.1.1": "4.8.1",
"4.6.1.2": "4.8.2",
"4.6.1.3": "4.8.3"
"4.6.1.3": "4.8.3",
"4.6.1.4": "4.8.4"
}
},
"System.Data.SqlXml": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<!-- We use the PackageVersion property defined in Packaging.props for the Prerelease packages which are using it to be built -->
<_PreReleasePackageVersion>$(PackageVersion)</_PreReleasePackageVersion>
<PackageVersion>3.1.2</PackageVersion>
<ServiceModelVersion>4.7.0</ServiceModelVersion>
<PackageVersion>3.1.3</PackageVersion>
<ServiceModelVersion>4.7.1</ServiceModelVersion>
<!-- We don't need to harvest the stable packages to build this -->
<HarvestStablePackage>false</HarvestStablePackage>
</PropertyGroup>
Expand All @@ -30,7 +30,7 @@
<PrereleaseLibraryPackage Include="System.Data.OleDb" />
<PrereleaseLibraryPackage Include="System.Data.SqlClient">
<!-- SQL client defines its own version, higher than rest of master -->
<Version>4.8.3</Version>
<Version>4.8.4</Version>
JRahnama marked this conversation as resolved.
Show resolved Hide resolved
</PrereleaseLibraryPackage>
<PrereleaseLibraryPackage Include="System.Drawing.Common" />
<PrereleaseLibraryPackage Include="System.Diagnostics.EventLog" />
Expand Down
4 changes: 2 additions & 2 deletions src/System.Data.SqlClient/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<!-- Must be kept in sync with pkg\Microsoft.Windows.Compatibility\Microsoft.Windows.Compatibility.pkgproj -->
<PackageVersion>4.8.3</PackageVersion>
<AssemblyVersion>4.6.1.3</AssemblyVersion>
<PackageVersion>4.8.4</PackageVersion>
<AssemblyVersion>4.6.1.4</AssemblyVersion>
<!-- Downgrade the Assembly Version to match RTM in order to have System.Data shim to still
typeforward to RTM version instead of servicing version -->
<AssemblyVersion Condition="'$(TargetGroup)' == 'netcoreapp'">4.6.1.0</AssemblyVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
{
internal static partial class NetSecurityNative
{
[DllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
David-Engel marked this conversation as resolved.
Show resolved Hide resolved
private static extern int EnsureGssInitialized();

// This constructor is added to address the issue with net6 regarding
// Shim gss api on Linux to delay loading libgssapi_krb5.so
// issue https://github.com/dotnet/SqlClient/issues/1390
// dotnet runtime issue https://github.com/dotnet/runtime/pull/55037
static NetSecurityNative()
{
if (Environment.Version.Major >= 6)
{
EnsureGssInitialized();
}
}
}
}
1 change: 1 addition & 0 deletions src/System.Data.SqlClient/src/System.Data.SqlClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
<Compile Include="$(CommonPath)\Microsoft\Win32\SafeHandles\GssSafeHandles.cs">
<Link>Common\Microsoft\Win32\SafeHandles\GssSafeHandles.cs</Link>
</Compile>
<Compile Include="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Extended.cs" />
<Compile Include="$(CommonPath)\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs">
<Link>Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs</Link>
</Compile>
Expand Down
6 changes: 6 additions & 0 deletions src/packages.builds
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<Project Include="*\pkg\**\*.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true' OR '$(DotNetBuildFromSource)' == 'true'">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="$(MSBuildThisFileDirectory)System.Data.SqlClient\pkg\System.Data.SqlClient.pkgproj">
Copy link
Member

Choose a reason for hiding this comment

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

These changes were made in the wrong ItemGroup, they should have instead been made in the one bellow which is the one used for servicing.

<ItemGroup Condition="'$(BuildAllPackages)' == 'false' AND '$(SkipManagedPackageBuild)' != 'true'" >
<Project Include="$(MSBuildThisFileDirectory)..\pkg\Microsoft.Private.PackageBaseline\Microsoft.Private.PackageBaseline.builds">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="$(MSBuildThisFileDirectory)..\pkg\Microsoft.Private.CoreFx.NETCoreApp\Microsoft.Private.CoreFx.NETCoreApp.builds">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<!-- add specific builds / pkgproj's here to include in servicing builds -->
</ItemGroup>

The result is that these two packages are not going to be built as part of the official build, so in order for the packages to get serviced that will need to be fixed.

<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="$(MSBuildThisFileDirectory)..\pkg\Microsoft.Windows.Compatibility\Microsoft.Windows.Compatibility.builds">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
</ItemGroup>

<ItemGroup Condition="'$(BuildAllPackages)' == 'false' AND '$(SkipManagedPackageBuild)' != 'true'" >
Expand Down