Skip to content

Commit

Permalink
add msquic to debug runtime on macOS (#84181)
Browse files Browse the repository at this point in the history
* add msquic to debug runtime on macOS

* update

* update

* PlatformManifestFileEntry

* update

* packaging

* feedback from review

* LibrariesConfiguration
  • Loading branch information
wfurt authored Apr 11, 2023
1 parent f8435f4 commit 356f8ff
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<MicrosoftNETCoreRuntimeICUTransportVersion>8.0.0-preview.4.23203.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
<MicrosoftNativeQuicMsQuicVersion>2.1.7</MicrosoftNativeQuicMsQuicVersion>
<SystemNetMsQuicTransportVersion>8.0.0-alpha.1.23166.1</SystemNetMsQuicTransportVersion>
<SystemNetMsQuicTransportVersion>8.0.0-alpha.1.23180.2</SystemNetMsQuicTransportVersion>
<!-- Mono LLVM -->
<runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>14.0.0-alpha.1.23179.1</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
<runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>14.0.0-alpha.1.23179.1</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<PlatformManifestFileEntry Include="API-MS-Win-core-xstate-l2-1-0.dll" IsNative="true" FallbackFileVersion="$(WindowsForwarderFileVersion)" />
<PlatformManifestFileEntry Include="ucrtbase.dll" IsNative="true" />
<PlatformManifestFileEntry Include="msquic.dll" IsNative="true" FallbackFileVersion="$(MsQuicFileVersion)" />
<PlatformManifestFileEntry Include="libmsquic.dylib" IsNative="true" FallbackFileVersion="$(MsQuicFileVersion)" Condition="'$(Configuration)' == 'Debug' or '$(LibrariesConfiguration)' == 'Debug'"/>
<PlatformManifestFileEntry Include="System.IO.Compression.Native.dll" IsNative="true" />
<PlatformManifestFileEntry Include="createdump.exe" IsNative="true" />
<PlatformManifestFileEntry Include="createdump" IsNative="true" />
Expand Down
58 changes: 40 additions & 18 deletions src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@
<Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs" Link="Common\Interop\OSX\Interop.Libraries.cs" />
</ItemGroup>

<!-- Project references -->
<ItemGroup>
<PackageReference Include="System.Net.MsQuic.Transport"
Version="$(SystemNetMsQuicTransportVersion)"
PrivateAssets="all"
GeneratePathProperty="true"
Condition="'$(DotNetBuildFromSource)' != 'true'" />
<PackageReference Include="Microsoft.Native.Quic.MsQuic.Schannel"
Version="$(MicrosoftNativeQuicMsQuicVersion)"
PrivateAssets="all"
GeneratePathProperty="true"
Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Security\src\System.Net.Security.csproj" SkipUseReferenceAssembly="true" />
<Reference Include="Microsoft.Win32.Primitives" />
Expand Down Expand Up @@ -142,17 +128,53 @@
<!-- Support for deploying msquic on Windows. We make msquic.dll part of runtime binaries: either from official releases or our transport feed. -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows' and
'$(TargetOS)' == 'windows' and
('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'arm64') and
'$(DotNetBuildFromSource)' != 'true'">

<!-- Project references -->
<PackageReference Include="runtime.win-$(TargetArchitecture).runtime.native.System.Net.MsQuic.Transport"
Version="$(SystemNetMsQuicTransportVersion)"
PrivateAssets="all"
Condition="'$(UseQuicTransportPackage)' == 'true'"
GeneratePathProperty="true" />

<PackageReference Include="Microsoft.Native.Quic.MsQuic.Schannel"
Version="$(MicrosoftNativeQuicMsQuicVersion)"
PrivateAssets="all"
Condition="'$(UseQuicTransportPackage)' != 'true'"
GeneratePathProperty="true" />

<NativeBinPlaceItem Include="$(PkgMicrosoft_Native_Quic_MsQuic_Schannel)\build\native\bin\$(TargetArchitecture)\*"
Condition="'$(UseQuicTransportPackage)' != 'true'" />
<NativeBinPlaceItem Include="$(PkgRuntime_win-x64_runtime_native_System_Net_MsQuic_Transport)\runtimes\win-$(TargetArchitecture)\native\*"
Condition="'$(UseQuicTransportPackage)' == 'true'" />
<NativeBinPlaceItem Include="$(PkgRuntime_win-x86_runtime_native_System_Net_MsQuic_Transport)\runtimes\win-$(TargetArchitecture)\native\*"
Condition="'$(UseQuicTransportPackage)' == 'true'" />
<NativeBinPlaceItem Include="$(PkgRuntime_win-arm64_runtime_native_System_Net_MsQuic_Transport)\runtimes\win-$(TargetArchitecture)\native\*"
Condition="'$(UseQuicTransportPackage)' == 'true'" />
</ItemGroup>

<!-- Include msquic in debug version for macOS so we can test it without packages. -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'osx' and
'$(TargetOS)' == 'osx' and
'$(TargetArchitecture)' == 'x64' and
'$(Configuration)' == 'Debug' and
'$(DotNetBuildFromSource)' != 'true'">
<!-- MsQuic packages do not have macOS binaries. Our transport package is only one source. -->
<PackageReference Include="runtime.osx-$(TargetArchitecture).runtime.native.System.Net.MsQuic.Transport"
Version="$(SystemNetMsQuicTransportVersion)"
PrivateAssets="all"
GeneratePathProperty="true" />
<NativeBinPlaceItem Include="$(PkgRuntime_osx-x64_runtime_native_System_Net_MsQuic_Transport)\runtimes\osx-$(TargetArchitecture)\native\*" />
</ItemGroup>
<ItemGroup Condition="'@(NativeBinplaceItem)' != ''">
<BinPlaceDir Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)" ItemName="NativeBinPlaceItem" />
<BinPlaceDir Include="$(NetCoreAppCurrentTestHostSharedFrameworkPath)" ItemName="NativeBinPlaceItem" />
<BinPlaceDir Include="$(LibrariesAllBinArtifactsPath)" ItemName="NativeBinPlaceItem" />
<BinPlaceDir Include="$(LibrariesNativeArtifactsPath)" ItemName="NativeBinPlaceItem" />
<NativeBinPlaceItem Include="$(PkgSystem_Net_MsQuic_Transport)\runtimes\win10-$(TargetArchitecture)\native\*"
Condition="'$(UseQuicTransportPackage)' == 'true'" />
<NativeBinPlaceItem Include="$(PkgMicrosoft_Native_Quic_MsQuic_Schannel)\build\native\bin\$(TargetArchitecture)\*"
Condition="'$(UseQuicTransportPackage)' != 'true'" />
</ItemGroup>

<!-- Local builds - developers only -->
<ItemGroup>
<Content Include="libmsquic.dylib" Condition="Exists('libmsquic.dylib')">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ public async Task AcceptConnectionAsync_ClientConnects_CancelIgnored()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/83012", TestPlatforms.OSX)]
public async Task ListenOnAlreadyUsedPort_Throws_AddressInUse()
{
// bind a UDP socket to block a port
Expand Down

0 comments on commit 356f8ff

Please sign in to comment.