Skip to content

Commit dc5ea71

Browse files
authored
[QUIC] Consume manually built MsQuic package for OSX (#119273)
* Consume manually built MsQuic package for OSX * Fix bin place package variable name * Remove reference to transport package * New version
1 parent 0d15233 commit dc5ea71

File tree

3 files changed

+23
-42
lines changed

3 files changed

+23
-42
lines changed

eng/Versions.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@
150150
<MicrosoftPrivateIntellisenseVersion>9.0.0-preview-20241010.1</MicrosoftPrivateIntellisenseVersion>
151151
<!-- MsQuic -->
152152
<MicrosoftNativeQuicMsQuicSchannelVersion>2.4.8</MicrosoftNativeQuicMsQuicSchannelVersion>
153-
<SystemNetMsQuicTransportVersion>9.0.0-alpha.1.24167.3</SystemNetMsQuicTransportVersion>
154153
<!-- emscripten / Node
155154
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
156155
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-10_0_100_Transport

src/libraries/System.Net.Quic/readme.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,19 @@ Testing on Linux is done with the help of docker images whose definition can be
7777

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

9094
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:
9195
```docker
@@ -94,13 +98,13 @@ RUN apt-get update -y && \
9498
apt-get upgrade -y && \
9599
apt-get install -y cmake clang ruby-dev gem lttng-tools libssl-dev && \
96100
gem install fpm
97-
RUN git clone --recursive https://github.com/dotnet/msquic
98-
RUN cd msquic/src/msquic && \
101+
RUN git clone --depth 1 --single-branch --branch main --recursive https://github.com/microsoft/msquic
102+
RUN cd msquic/ && \
99103
mkdir build && \
100-
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 && \
104+
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 && \
101105
cd build && \
102-
cmake --build . --config Release
103-
RUN cd msquic/src/msquic/build/bin/Release && \
106+
cmake --build . --config Debug
107+
RUN cd msquic/build/bin/Debug && \
104108
rm libmsquic.so && \
105109
fpm -f -s dir -t deb -n libmsquic -v $( find -type f | cut -d "." -f 4- ) \
106110
--license MIT --url https://github.com/microsoft/msquic --log error \
@@ -109,15 +113,10 @@ RUN cd msquic/src/msquic/build/bin/Release && \
109113
```
110114

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

114118
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.
115119

116120
### Windows
117121

118-
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).
119-
120-
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.
121-
122-
123-
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).
122+
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).

src/libraries/System.Net.Quic/src/System.Net.Quic.csproj

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'windows'">$(DefineConstants);TARGET_WINDOWS</DefineConstants>
1616
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.SystemNetQuic_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
1717
<ApiExclusionListPath Condition="'$(TargetPlatformIdentifier)' == ''">ExcludeApiList.PNSE.txt</ApiExclusionListPath>
18-
<!-- This controls if we consume official binaries from MsQuic or if we use binaries published from dotnet/msquic repo.
19-
Release branches should generally consume MsQuic release code, transport allows us to consume and test pre-released versions -->
20-
<UseQuicTransportPackage Condition="'$(UseQuicTransportPackage)' == ''">false</UseQuicTransportPackage>
2118
</PropertyGroup>
2219

2320
<!-- Source files -->
@@ -162,26 +159,12 @@
162159
('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'arm64') and
163160
'$(DotNetBuildSourceOnly)' != 'true'">
164161

165-
<PackageReference Include="runtime.win-$(TargetArchitecture).runtime.native.System.Net.MsQuic.Transport"
166-
Version="$(SystemNetMsQuicTransportVersion)"
167-
PrivateAssets="all"
168-
Condition="'$(UseQuicTransportPackage)' == 'true'"
169-
GeneratePathProperty="true" />
170-
171162
<PackageReference Include="Microsoft.Native.Quic.MsQuic.Schannel"
172163
Version="$(MicrosoftNativeQuicMsQuicSchannelVersion)"
173164
PrivateAssets="all"
174-
Condition="'$(UseQuicTransportPackage)' != 'true'"
175165
GeneratePathProperty="true" />
176166

177-
<NativeBinPlaceItem Include="$(PkgMicrosoft_Native_Quic_MsQuic_Schannel)\build\native\bin\$(TargetArchitecture)\*"
178-
Condition="'$(UseQuicTransportPackage)' != 'true'" />
179-
<NativeBinPlaceItem Include="$(PkgRuntime_win-x64_runtime_native_System_Net_MsQuic_Transport)\runtimes\win-$(TargetArchitecture)\native\*"
180-
Condition="'$(UseQuicTransportPackage)' == 'true'" />
181-
<NativeBinPlaceItem Include="$(PkgRuntime_win-x86_runtime_native_System_Net_MsQuic_Transport)\runtimes\win-$(TargetArchitecture)\native\*"
182-
Condition="'$(UseQuicTransportPackage)' == 'true'" />
183-
<NativeBinPlaceItem Include="$(PkgRuntime_win-arm64_runtime_native_System_Net_MsQuic_Transport)\runtimes\win-$(TargetArchitecture)\native\*"
184-
Condition="'$(UseQuicTransportPackage)' == 'true'" />
167+
<NativeBinPlaceItem Include="$(PkgMicrosoft_Native_Quic_MsQuic_Schannel)\build\native\bin\$(TargetArchitecture)\*" />
185168
</ItemGroup>
186169

187170
<!-- Include msquic in debug version for macOS so we can test it without packages. -->
@@ -191,11 +174,11 @@
191174
'$(Configuration)' == 'Debug' and
192175
'$(DotNetBuildSourceOnly)' != 'true'">
193176
<!-- MsQuic packages do not have macOS binaries. Our transport package is only one source. -->
194-
<PackageReference Include="runtime.osx-$(TargetArchitecture).runtime.native.System.Net.MsQuic.Transport"
195-
Version="$(SystemNetMsQuicTransportVersion)"
177+
<PackageReference Include="MsQuic.Native"
178+
Version="2.5.6"
196179
PrivateAssets="all"
197180
GeneratePathProperty="true" />
198-
<NativeBinPlaceItem Include="$(PkgRuntime_osx-x64_runtime_native_System_Net_MsQuic_Transport)\runtimes\osx-$(TargetArchitecture)\native\*" />
181+
<NativeBinPlaceItem Include="$(PkgMsQuic_Native)\runtimes\osx-$(TargetArchitecture)\native\*" />
199182
</ItemGroup>
200183

201184
<ItemGroup Condition="'@(NativeBinplaceItem)' != ''">

0 commit comments

Comments
 (0)