Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NativeAOT] Support library mode with NativeAOT on iOS-like platforms #93658

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

ivanpovazan
Copy link
Member

@ivanpovazan ivanpovazan commented Oct 18, 2023

This PR enables support for building libraries for iOS-like platforms with NativeAOT.

Changes

  • Extended NativeAOT build integration targets to support building libraries for iOS-like platforms
  • Adapted AppleAppBuilder to support bundling in library mode for both MonoAOT and NativeAOT
  • Adapted AppleAppBuilder to support bundling in library mode when targeting iOS-like devices
  • Adapted src/tests/FunctionalTests/iOS/Simulator/LibraryMode for testing the library mode on iossimulators-arm64/x64 with NativeAOT - currently this only works locally please see comments in the project file for more info
  • Added src/tests/FunctionalTests/iOS/Device/LibraryMode for testing the library mode on ios-arm64 for both MonoAOT and NativeAOT

Additional notes

To test locally one can execute the following from the repo root directory:

  • Test MonoAOT library mode on ios-arm64:

    ./dotnet.sh build /t:Test -c Debug /p:TargetOS=ios /p:TargetArchitecture=arm64 src/tests/FunctionalTests/iOS/Device/LibraryMode/iOS.Device.LibraryMode.Test.csproj /p:RuntimeFlavor=Mono
    
  • Test NativeAOT library mode on ios-arm64:

    ./dotnet.sh build /t:Test -c Debug /p:TargetOS=ios /p:TargetArchitecture=arm64 src/tests/FunctionalTests/iOS/Device/LibraryMode/iOS.Device.LibraryMode.Test.csproj /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:RuntimeFlavor=CoreCLR
    

Documentation


Fixes #88737

@ghost
Copy link

ghost commented Oct 18, 2023

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

This PR enables support for building libraries for iOS-like platforms with NativeAOT.

Changes

  • Extended NativeAOT build integration targets to support building libraries for iOS-like platforms
  • Adapted AppleAppBuilder to support bundling in library mode for both MonoAOT and NativeAOT
  • Adapted AppleAppBuilder to support bundling in library mode when targeting iOS-like devices
  • Adapted src/tests/FunctionalTests/iOS/Simulator/LibraryMode for testing the library mode on iossimulators-arm64/x64 with NativeAOT - currently this only works locally please see comments in the project file for more info
  • Added src/tests/FunctionalTests/iOS/Device/LibraryMode for testing the library mode on ios-arm64 for both MonoAOT and NativeAOT

Additional notes

To test locally one can execute the following from the repo root directory:

  • Test MonoAOT library mode on ios-arm64:

    ./dotnet.sh build /t:Test -c Debug /p:TargetOS=ios /p:TargetArchitecture=arm64 src/tests/FunctionalTests/iOS/Device/LibraryMode/iOS.Device.LibraryMode.Test.csproj /p:RuntimeFlavor=Mono
    
  • Test NativeAOT library mode on ios-arm64:

    ./dotnet.sh build /t:Test -c Debug /p:TargetOS=ios /p:TargetArchitecture=arm64 src/tests/FunctionalTests/iOS/Device/LibraryMode/iOS.Device.LibraryMode.Test.csproj /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:RuntimeFlavor=CoreCLR
    

Fixes #88737

Author: ivanpovazan
Assignees: ivanpovazan
Labels:

area-Infrastructure-mono

Milestone: -

@ivanpovazan
Copy link
Member Author

ivanpovazan commented Oct 18, 2023

Failures are related:
1. Since I introduced VerifyOSSpecificTooling target, it seems I broke some dependency with tooling in the build
2. Building on Helix for the library mode tests seem to be broken

@ivanpovazan
Copy link
Member Author

/azp run runtime-ioslikesimulator

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

global.json Outdated Show resolved Hide resolved
@ivanpovazan
Copy link
Member Author

/azp run runtime-ioslikesimulator

@ivanpovazan
Copy link
Member Author

/azp run runtime-ioslike

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ivanpovazan
Copy link
Member Author

/azp run runtime-ioslikesimulator

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@am11 am11 left a comment

Choose a reason for hiding this comment

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

Two optional nits, otherwise looks great! 👍

@ivanpovazan
Copy link
Member Author

/azp run runtime-extra-platforms

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ivanpovazan
Copy link
Member Author

/azp run runtime-extra-platforms

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ivanpovazan
Copy link
Member Author

The CI failures are unrelated.

@steveisok @rolfbjarne @jkotas could you please take another look as we would like to get this in for net9.0-p1?

Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

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

LGTM

@jkotas
Copy link
Member

jkotas commented Jan 9, 2024

@jkotas could you please take another look as we would like to get this in for net9.0-p1?

The changes in the shared native AOT files LGTM.

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

nativeaot/BuildIntegration looks good to me too!

@ivanpovazan ivanpovazan merged commit 3f3af5e into dotnet:main Jan 10, 2024
238 of 250 checks passed
@ivanpovazan ivanpovazan deleted the naot-ios-libmode branch January 10, 2024 08:57
@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NativeAOT library mode on iOS-like platforms
8 participants