Skip to content

Commit ea111fb

Browse files
committed
build: don't use AOT publishing on unsupported RIDs
.NET 8 only supports AOT compilation on a subset of .NET runtimes, namely: - win-x64 - win-arm64 - osx-x64 - osx-arm64 - linux-x64 - linux-arm64 This means we need to do something else of our win-x86 and linux-arm (32-bit) targets. For these two, let's use the combo of SingleFile+Trimmed+ReadyToRun publishing options instead to keep both file sizes down, and reduce runtime performance hits from JIT. .NET 9 and later support AOT for win-x86 and linux-arm (32-bit) targets, but since we only prefer to target LTS releases of .NET, we'll have to wait for .NET 10 (the next LTS release) to do AOT on _all_ our platforms. Given that .NET 10 GA is just around the corner, this shouldn't be too long to wait.
1 parent 4c31883 commit ea111fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
<InvariantGlobalization>true</InvariantGlobalization>
1515
</PropertyGroup>
1616

17+
<PropertyGroup Condition="'$(RuntimeIdentifier.StartsWith('win-x86')' or '$(RuntimeIdentifier.StartsWith('linux-arm')'">
18+
<!--
19+
AOT compilation is not supported for these RIDs, so disable it and
20+
instead rely on the trimming and single-file publishing options to
21+
reduce file size, and ReadyToRun to improve startup performance.
22+
-->
23+
<PublishAot>false</PublishAot>
24+
<PublishSingleFile>true</PublishSingleFile>
25+
<PublishTrimmed>true</PublishTrimmed>
26+
<PublishReadyToRun>true</PublishReadyToRun>
27+
</PropertyGroup>
28+
1729
<PropertyGroup Condition="$(RuntimeIdentifier.StartsWith('win-'))">
1830
<!--
1931
Prefer to reduce the size of the single file by compressing the containing

0 commit comments

Comments
 (0)