fix(quic): statically link MsQuic for Alpine nodes [CI]

This commit is contained in:
justme committed 2026-10-11 01:00:37 +08:00
1 parent 0d08e90dab
commit a44895d860
17 files changed
+363 -65

No files matched your search

@@ -0,0 +1,32 @@
<Project>
<PropertyGroup>
<_MoShiroStaticMsQuicLibrary>$(MSBuildThisFileDirectory)../../../packaging/native/msquic/$(RuntimeIdentifier)/libmsquic.a</_MoShiroStaticMsQuicLibrary>
</PropertyGroup>
<PropertyGroup Condition="$(RuntimeIdentifier.StartsWith('linux-musl-'))">
<StaticExecutable>true</StaticExecutable>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<NativeLibrary Include="$(_MoShiroStaticMsQuicLibrary)" />
<DirectPInvoke Include="__Internal" />
<DirectPInvoke Include="System.Security.Cryptography.Native.OpenSsl" />
</ItemGroup>
<!-- The archive includes MsQuic, OpenSSL, and the .NET OpenSSL shim. -->
<Target Name="StaticMsQuicFixLinker" AfterTargets="SetupOSSpecificProps" BeforeTargets="AotAnywhereDirectLinkNative">
<ItemGroup>
<LinkerArg Remove="-Wl,--defsym,__xmknod=mknod" />
<NativeLibrary Remove="$(IlcFrameworkNativePath)libSystem.Security.Cryptography.Native.OpenSsl.a" />
<LinkerArg Remove="$(IlcFrameworkNativePath)libSystem.Security.Cryptography.Native.OpenSsl.a" />
</ItemGroup>
</Target>
<Target Name="ValidateStaticMsQuicArchive" BeforeTargets="AotAnywhereDirectLinkNative">
<Error Condition="!Exists('$(_MoShiroStaticMsQuicLibrary)')"
Text="Static MsQuic archive is missing for $(RuntimeIdentifier)." />
<Error Condition="'$(RuntimeFrameworkVersion)' != '10.0.12'"
Text="The vendored static MsQuic and crypto archive is validated with .NET runtime 10.0.12." />
</Target>
</Project>