Skip to content

[NativeAOT] Extend the runtime pack approach to all supported platforms #87060

Open
@ivanpovazan

Description

@ivanpovazan

Description

Currently when targeting iOS-like platforms with NativeAOT, the build process will also download the host's runtime package (osx), even though it is unused.
Apart from that, workloads that want to integrate with NativeAOT need to take into account the opt-in property: PublishAotUsingRuntimePack introduced here: dotnet/sdk#32100

To improve the cross-compilation and integration experience further, all host/target platforms should be supported in the same fashion producing two nuget packages:

  • [host] Microsoft.DotNet.ILCompiler - carrying only the tools and build integration targets
  • [target] Microsoft.NETCore.App.Runtime.NativeAOT.<os>-<arch> - carrying target runtime and framework libraries
    The need for PublishAotUsingRuntimePack would become redundant.

This should be an extension to: #85047 where NativeAOT runtime packs are initially supported only for iOS/tvOS/Catalyst target platforms.

Note

This should also simplify and improve the way packages are built.
For example, in order to build all the required packages to build an ios application with NativeAOT:

  1. The following subsets are required to build Microsoft.DotNet.ILCompiler package for the host - osx
./build.sh clr+clr.aot+libs+packs
  1. The following subsets are required Microsoft.NETCore.App.Runtime.NativeAOT.ios-arm64 package for the target - ios:
./build.sh clr.nativeaotlibs+clr.nativeaotruntime+libs+packs /p:BuildNativeAOTRuntimePack=true

which involves long build times and building unnecessary components.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions