Skip to content

Enable packaging of dotnet-aot#54056

Merged
NikolaMilosavljevic merged 5 commits intodotnet:mainfrom
NikolaMilosavljevic:dotnet-aot.pkg
Apr 24, 2026
Merged

Enable packaging of dotnet-aot#54056
NikolaMilosavljevic merged 5 commits intodotnet:mainfrom
NikolaMilosavljevic:dotnet-aot.pkg

Conversation

@NikolaMilosavljevic
Copy link
Copy Markdown
Member

This PR adds the dotnet-aot NativeAOT shared library to the SDK packaging pipeline.

Changes

  • Added PublishDotnetAot target in GenerateLayout.targets that:

    • Restores and publishes dotnet-aot.csproj as a NativeAOT shared library
    • Handles platform-specific naming (Windows: dotnet-aot.dll, Linux: libdotnet-aot.so, macOS:
      libdotnet-aot.dylib)
    • Copies the output to the SDK layout directory alongside dotnet.dll
  • Updated ChmodPublishDir target to set executable permissions on the native library for Linux/macOS

  • Added PublishDotnetAot to the GenerateSdkLayout target dependency chain

Result

The dotnet-aot native library is now packaged with the SDK and will be included in Windows MSI, Linux deb/rpm, and macOS pkg installers.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the SDK layout/packaging pipeline to build and include the dotnet-aot NativeAOT shared library alongside dotnet.dll, and adjusts permission-setting behavior so the native library is runnable on Unix-like platforms.

Changes:

  • Added a new PublishDotnetAot target to restore/publish src/Cli/dotnet-aot/dotnet-aot.csproj and copy the native library into $(OutputPath).
  • Updated ChmodPublishDir to include the dotnet-aot native library in its chmod set on non-Windows platforms.
  • Wired PublishDotnetAot into the GenerateSdkLayout dependency chain.

Comment thread src/Layout/redist/targets/GenerateLayout.targets Outdated
Comment thread src/Layout/redist/targets/GenerateLayout.targets Outdated
Comment thread src/Layout/redist/targets/GenerateLayout.targets
Comment thread src/Layout/redist/targets/GenerateLayout.targets Outdated
@JeremyKuhne
Copy link
Copy Markdown
Member

This should go in after #54047 which disables the AOT command run by default.

Comment thread src/Layout/redist/targets/GenerateLayout.targets Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore PublishDotnetAot dependency so the _DotnetAotNativeLibName property
is available without recomputation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
NikolaMilosavljevic and others added 2 commits April 23, 2026 14:47
NativeAOT cross-compilation requires native toolchain for the target platform,
which is not available in CI cross-compilation scenarios. Restrict the
PublishDotnetAot target to only run when TargetRid matches HostRid.

Fixes CI failures in:
- TestBuild: linux (arm64) - cross-compiling from x64
- AoT: windows (x64) - restore/RID mismatch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NikolaMilosavljevic
Copy link
Copy Markdown
Member Author

Pushed a fix for a failure in AOT job.

This avoids restore conflicts when the main build restore creates
an assets file without RID-specific settings, then the dotnet-aot
restore fails because it requires a RID-specific configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NikolaMilosavljevic
Copy link
Copy Markdown
Member Author

NikolaMilosavljevic commented Apr 24, 2026

Remaining failures are unrelated.

@NikolaMilosavljevic NikolaMilosavljevic merged commit ab5c1ee into dotnet:main Apr 24, 2026
17 of 24 checks passed
PureWeen pushed a commit to dotnet/maui that referenced this pull request Apr 28, 2026
SDK build 26224.122 has a workload manifest layout bug caused by
dotnet/sdk#54056 (Enable packaging of dotnet-aot). The emscripten.net6
bundled manifest is missing from the SDK layout. The fix is already
merged upstream (Condition=false) but hasn't produced a new build yet.

Pin to 26215.121 (same version used by dotnet/android and dotnet/macios)
until a fixed SDK build is available.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants