Skip to content
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
1 change: 0 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
<MicrosoftPrivateIntellisenseVersion>9.0.0-preview-20241010.1</MicrosoftPrivateIntellisenseVersion>
<!-- MsQuic -->
<MicrosoftNativeQuicMsQuicSchannelVersion>2.4.8</MicrosoftNativeQuicMsQuicSchannelVersion>
<SystemNetMsQuicTransportVersion>9.0.0-alpha.1.24167.3</SystemNetMsQuicTransportVersion>
<!-- emscripten / Node
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-10_0_100_Transport
Expand Down
39 changes: 19 additions & 20 deletions src/libraries/System.Net.Quic/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,19 @@ Testing on Linux is done with the help of docker images whose definition can be

To consume a release version of the package, the docker image definition will contain:
```docker
RUN curl -LO https://packages.microsoft.com/keys/microsoft.asc && \
echo 2cfd20a306b2fa5e25522d78f2ef50a1f429d35fd30bd983e2ebffc2b80944fa microsoft.asc | sha256sum --check - && \
apt-key add microsoft.asc && \
rm microsoft.asc && \
apt-add-repository https://packages.microsoft.com/debian/11/prod && \
apt-get update && \
apt-get install -y libmsquic
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
apt-transport-https \
curl \
software-properties-common \
&& curl -sL https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -o packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y libmsquic
```
Source: https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/efbcd1079edef4698ada1676a5e33c4c9672f85a/src/debian/11/helix/amd64/Dockerfile#L44-L52
Source: https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/7f86167248bcbda898a6b7f17ed01dce3adff2dd/src/debian/12/helix/amd64/Dockerfile#L22-L31

To consume the current main branch of msquic, we pull code from [dotnet/msquic](https://github.com/dotnet/msquic) and build it locally in our docker image:
```docker
Expand All @@ -94,13 +98,13 @@ RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y cmake clang ruby-dev gem lttng-tools libssl-dev && \
gem install fpm
RUN git clone --recursive https://github.com/dotnet/msquic
RUN cd msquic/src/msquic && \
RUN git clone --depth 1 --single-branch --branch main --recursive https://github.com/microsoft/msquic
RUN cd msquic/ && \
mkdir build && \
cmake -B build -DCMAKE_BUILD_TYPE=Release -DQUIC_ENABLE_LOGGING=false -DQUIC_USE_SYSTEM_LIBCRYPTO=true -DQUIC_BUILD_TOOLS=off -DQUIC_BUILD_TEST=off -DQUIC_BUILD_PERF=off && \
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DQUIC_ENABLE_LOGGING=false -DQUIC_USE_SYSTEM_LIBCRYPTO=true -DQUIC_BUILD_TOOLS=off -DQUIC_BUILD_TEST=off -DQUIC_BUILD_PERF=off -DQUIC_TLS_LIB=quictls -DQUIC_ENABLE_SANITIZERS=on && \
cd build && \
cmake --build . --config Release
RUN cd msquic/src/msquic/build/bin/Release && \
cmake --build . --config Debug
RUN cd msquic/build/bin/Debug && \
rm libmsquic.so && \
fpm -f -s dir -t deb -n libmsquic -v $( find -type f | cut -d "." -f 4- ) \
--license MIT --url https://github.com/microsoft/msquic --log error \
Expand All @@ -109,15 +113,10 @@ RUN cd msquic/src/msquic/build/bin/Release && \
```

Source:
https://github.com/dotnet/runtime/blob/bd540938a4830ee91dec5ee2d39545b2f69a19d5/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile#L4-L21
https://github.com/dotnet/runtime/blob/c6566fb0bcc539c523be9796ba5af681bf65a904/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile#L4-L21

Note that to propagate newest sources / package to the docker image used for the test runs, it must be rebuilt by [dotnet-buildtools-prereqs-docker-all](https://dev.azure.com/dnceng/internal/_build?definitionId=1183&_a=summary) pipeline with `noCache = true` variable. And since [#76630](https://github.com/dotnet/runtime/pull/76630), the newest image will get automatically picked up by the dotnet/runtime infra.

### Windows

Officially released `msquic.dll` is published to NuGet.org, see [Microsoft.Native.Quic.MsQuic.Schannel](https://www.nuget.org/packages/Microsoft.Native.Quic.MsQuic.Schannel).

To consume MsQuic from the current main branch, we use [dotnet/msquic](https://github.com/dotnet/msquic) repository which will build and publish `msquic.dll` to the transport feed, e.g. [dotnet8-transport](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet8-transport). And from there, it'll get flown into this repository via [Darc subscription](https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md). See https://github.com/dotnet/runtime/blob/bd540938a4830ee91dec5ee2d39545b2f69a19d5/eng/Version.Details.xml#L7-L10 and maestro-bot PR: https://github.com/dotnet/runtime/pull/71900.


System.Net.Quic [project file](https://github.com/dotnet/runtime/blob/0304f1f5157a8280fa093bdfc7cfb8d9f62e016f/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj) allows switching between those two options with [`UseQuicTransportPackage` property](https://github.com/dotnet/runtime/blob/0304f1f5157a8280fa093bdfc7cfb8d9f62e016f/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj#L15).
Officially released `msquic.dll` is published to NuGet.org, see [Microsoft.Native.Quic.MsQuic.Schannel](https://www.nuget.org/packages/Microsoft.Native.Quic.MsQuic.Schannel).
25 changes: 4 additions & 21 deletions src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'windows'">$(DefineConstants);TARGET_WINDOWS</DefineConstants>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.SystemNetQuic_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<ApiExclusionListPath Condition="'$(TargetPlatformIdentifier)' == ''">ExcludeApiList.PNSE.txt</ApiExclusionListPath>
<!-- This controls if we consume official binaries from MsQuic or if we use binaries published from dotnet/msquic repo.
Release branches should generally consume MsQuic release code, transport allows us to consume and test pre-released versions -->
<UseQuicTransportPackage Condition="'$(UseQuicTransportPackage)' == ''">false</UseQuicTransportPackage>
</PropertyGroup>

<!-- Source files -->
Expand Down Expand Up @@ -162,26 +159,12 @@
('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'arm64') and
'$(DotNetBuildSourceOnly)' != 'true'">

<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="$(MicrosoftNativeQuicMsQuicSchannelVersion)"
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'" />
<NativeBinPlaceItem Include="$(PkgMicrosoft_Native_Quic_MsQuic_Schannel)\build\native\bin\$(TargetArchitecture)\*" />
</ItemGroup>

<!-- Include msquic in debug version for macOS so we can test it without packages. -->
Expand All @@ -191,11 +174,11 @@
'$(Configuration)' == 'Debug' and
'$(DotNetBuildSourceOnly)' != '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)"
<PackageReference Include="MsQuic.Native"
Version="2.5.6"
PrivateAssets="all"
GeneratePathProperty="true" />
<NativeBinPlaceItem Include="$(PkgRuntime_osx-x64_runtime_native_System_Net_MsQuic_Transport)\runtimes\osx-$(TargetArchitecture)\native\*" />
<NativeBinPlaceItem Include="$(PkgMsQuic_Native)\runtimes\osx-$(TargetArchitecture)\native\*" />
</ItemGroup>

<ItemGroup Condition="'@(NativeBinplaceItem)' != ''">
Expand Down
Loading