You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aspire cli: Add AOT builds for Linux, and macOS (#10275)
Add AOT builds for Linux, and macOS
## What?
This PR adds AOT builds for Linux, and macOS on the internal builds. On macOS the binaries are appropriately signed, and notarized making them usable after downloading.
## How?
This is done by having separate OS-specific jobs just to build the AOTed aspire cli. And these upload the archives for use by a "joining" Windows job which builds windows binaries, and publishes all the archives. Checksum (`sha512`) files are also generated for the archives which can be used to verify the archive when downloading.
This is the current supported matrix:
| Runtime Identifier | AOTed |
|-------------------|-------------|
| `win-x64` | ✅ |
| `win-arm64` | ✅ |
| `win-x86` | ❌ |
| `linux-x64` | ✅ |
| `linux-arm64` | ❌ |
| `linux-musl-x64` | ❌ |
| `osx-x64` | ✅ |
| `osx-arm64` | ✅ |
- `win-x86` - Native AOT is not supported for this
- `linux-arm64`, `linux-musl-x64` - will be added in a follow up PR
For the non-aot cases a self-contained executable is generated.
## Tests
To catch missing archives due to any reason on the CI build
--
* Addresses review feedback from @ eerhardt
* Addresses review feedback from @ joperezr
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Copy file name to clipboardExpand all lines: docs/contributing.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,14 @@ Or, if you are using Visual Studio:
31
31
32
32
Make sure you [build the repo](#build-the-repo) from command line at least once. Then use `./start-code.sh` (macOS and Linux) or `.\start-code.cmd` to start VS Code.
33
33
34
+
## Native build
35
+
36
+
The default build includes native builds for `Aspire.Cli` which produces Native AOT binaries for some platforms. These projects are in `eng/clipack/Aspire.Cli.*`.
37
+
38
+
By default it builds the cli native project for the current Runtime Identifier. A specific RIDs can be specified too by setting `$(TargetRids)` to a colon separated list like `/p:TargetRids=osx-x64:osx-arm64`.
39
+
40
+
Native build can be disabled with `/p:SkipNativeBuild=true`. And to only the native bits use `/p:SkipManagedBuild=true`.
41
+
34
42
## View Dashboard
35
43
36
44
When you start the sample app in Visual Studio, it will automatically open your browser to show the dashboard.
<WarningCondition="@(_UnexpectedRids->Count()) > 0"Text="Found unexpected CLI archives for @(_UnexpectedRids, ',') . These are all the cli archives found - @(_ArchiveFiles, ', ')" />
46
+
<ErrorCondition="@(_MissingRids->Count()) > 0"Text="Missing CLI archive(s) for runtime identifiers: @(_MissingRids, ', '). These are all the cli archives found - @(_ArchiveFiles, ', ')" />
47
+
30
48
<!--
31
49
For blob items for the Dashboard, we want to make sure that the version we get back is not stable, even when the repo is producing stable versions.
32
50
This is because we want to be able to re-spin the build if necessary without hitting issues of blob items clashing with each other. For this reason,
<!-- Publish native AOT if running on the target platfrom -->
9
+
<!-- PublishNativeAot is explicitly set to false in the projects for cases where we don't want to AOT at all.
10
+
For the rest, publish native AOT if running on the target platfrom -->
10
11
<PublishNativeAot Condition="'$(PublishNativeAot)' == '' and $([System.OperatingSystem]::IsWindows()) and $(CliRuntime.StartsWith('win-'))">true</PublishNativeAot>
11
12
<PublishNativeAot Condition="'$(PublishNativeAot)' == '' and $([System.OperatingSystem]::IsLinux()) and $(CliRuntime.StartsWith('linux-'))">true</PublishNativeAot>
12
13
<PublishNativeAot Condition="'$(PublishNativeAot)' == '' and $([System.OperatingSystem]::IsMacOS()) and $(CliRuntime.StartsWith('osx-'))">true</PublishNativeAot>
0 commit comments