Skip to content

Enable AppleAppBuilder to bundle applications compiled with NativeAOT #80910

Closed

Description

@ivanpovazan

Description

AppleAppBuilder build task currently only supports Mono as the default AOT compiler and runtime when creating application bundles.

Proposal

Extend AppleAppBuilder to support NativeAOT, as a second AOT compiler and runtime, when creating iOS application bundles.
This would enable building and running sample applications built with NativeAOT on iOS platforms, but also size and performance monitoring.

Activity

  1. added this to the 8.0.0 milestone on Jan 20, 2023
  2. self-assigned this
    on Jan 20, 2023
  3. am11 commented on Jan 20, 2023

    @am11
    Member

    It gets enabled when TargetPlatformIdentifier is set (not to be confused with TargetFrameworkIdentifier / TFI).

    e.g. <TargetFramework>net7.0-macos</TargetFramework> is same as:

        <TargetFramework>net7.0</TargetFramework>
        <TargetPlatformIdentifier>macos</TargetPlatformIdentifier>

    By setting TPI, .NET SDK imports WorkloadManifestTargetsLocator, which resolves Microsoft.macos.Sdk.net7 SDK, which further resolves Microsoft.NET.Runtime.MonoTargets.Sdk.net7 and then Xamarin.Shared.Sdk etc. Somewhere there in the SDK, we can check if '$(PublishAot)' == 'true' then e.g. skip importing WorkloadManifestTargetsLocator or something down the chain. There maybe some more changes required but that would be the starting point to ninja in the NativeAOT bits. 🥷

  4. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 6, 2023
  5. ivanpovazan commented on Feb 7, 2023

    @ivanpovazan
    MemberAuthor

    It gets enabled when TargetPlatformIdentifier is set (not to be confused with TargetFrameworkIdentifier / TFI).

    e.g. <TargetFramework>net7.0-macos</TargetFramework> is same as:

        <TargetFramework>net7.0</TargetFramework>
        <TargetPlatformIdentifier>macos</TargetPlatformIdentifier>
    

    By setting TPI, .NET SDK imports WorkloadManifestTargetsLocator, which resolves Microsoft.macos.Sdk.net7 SDK, which further resolves Microsoft.NET.Runtime.MonoTargets.Sdk.net7 and then Xamarin.Shared.Sdk etc. Somewhere there in the SDK, we can check if '$(PublishAot)' == 'true' then e.g. skip importing WorkloadManifestTargetsLocator or something down the chain. There maybe some more changes required but that would be the starting point to ninja in the NativeAOT bits. 🥷

    ^ @kotlarmilos I believe this would contribute to your SDK integration work

  6. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 7, 2023
  7. ghost locked as resolved and limited conversation to collaborators on Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions