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 library mode on iOS-like platforms #88737

Closed
Tracked by #80905
filipnavara opened this issue Jul 12, 2023 · 6 comments · Fixed by #93658
Closed
Tracked by #80905

NativeAOT library mode on iOS-like platforms #88737

filipnavara opened this issue Jul 12, 2023 · 6 comments · Fixed by #93658
Assignees
Milestone

Comments

@filipnavara
Copy link
Member

As documented in royalapplications/beyondnet#34 (comment) there's a demand to get NativeAOT library mode working on iOS-like platforms. This is specifically for net8.0 TFM and NOT the Xamarin net8.0-ios TFM which may run into similar issues but requires fixes in the Xamarin SDK. It currently requires a couple of workaround and we should look into fixing the underlying issues:

  • Linking step doesn't use correct -sysroot/-target. We currently bundle the apps through AppleAppBuilder in dotnet/runtime, and a custom bundler in Xamarin. However, for dylib builds the NativeAOT linker step on its own is mostly sufficient. We just need to specify proper -target (eg. apple-arm64-ios11.0 or similar) and sysroot. The sysroot can be obtained through xcrun, or we can simply execute the whole linker using xcrun -sdk iphoneos clang <options> command to achieve the same result.
  • There's a conflict with the new mobile-librarybuilder-experimental workload which currently needs to be disabled with _IsAppleMobileLibraryMode=false. We should disable it automatically for NativeAOT publishing.
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 12, 2023
@ghost
Copy link

ghost commented Jul 12, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

As documented in royalapplications/beyondnet#34 (comment) there's a demand to get NativeAOT library mode working on iOS-like platforms. This is specifically for net8.0 TFM and NOT the Xamarin net8.0-ios TFM which may run into similar issues but requires fixes in the Xamarin SDK. It currently requires a couple of workaround and we should look into fixing the underlying issues:

  • Linking step doesn't use correct -sysroot/-target. We currently bundle the apps through AppleAppBuilder in dotnet/runtime, and a custom bundler in Xamarin. However, for dylib builds the NativeAOT linker step on its own is mostly sufficient. We just need to specify proper -target (eg. apple-arm64-ios11.0 or similar) and sysroot. The sysroot can be obtained through xcrun, or we can simply execute the whole linker using xcrun -sdk iphoneos clang <options> command to achieve the same result.
  • There's a conflict with the new mobile-librarybuilder-experimental workload which currently needs to be disabled with _IsAppleMobileLibraryMode=false. We should disable it automatically for NativeAOT publishing.
Author: filipnavara
Assignees: -
Labels:

untriaged, area-NativeAOT-coreclr

Milestone: -

@akoeplinger akoeplinger added this to the 8.0.0 milestone Jul 12, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 12, 2023
@akoeplinger akoeplinger added untriaged New issue has not been triaged by the area owner os-ios Apple iOS and removed untriaged New issue has not been triaged by the area owner labels Jul 12, 2023
@akoeplinger
Copy link
Member

/cc @steveisok

@ghost
Copy link

ghost commented Jul 12, 2023

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

As documented in royalapplications/beyondnet#34 (comment) there's a demand to get NativeAOT library mode working on iOS-like platforms. This is specifically for net8.0 TFM and NOT the Xamarin net8.0-ios TFM which may run into similar issues but requires fixes in the Xamarin SDK. It currently requires a couple of workaround and we should look into fixing the underlying issues:

  • Linking step doesn't use correct -sysroot/-target. We currently bundle the apps through AppleAppBuilder in dotnet/runtime, and a custom bundler in Xamarin. However, for dylib builds the NativeAOT linker step on its own is mostly sufficient. We just need to specify proper -target (eg. apple-arm64-ios11.0 or similar) and sysroot. The sysroot can be obtained through xcrun, or we can simply execute the whole linker using xcrun -sdk iphoneos clang <options> command to achieve the same result.
  • There's a conflict with the new mobile-librarybuilder-experimental workload which currently needs to be disabled with _IsAppleMobileLibraryMode=false. We should disable it automatically for NativeAOT publishing.
Author: filipnavara
Assignees: -
Labels:

untriaged, os-ios, area-NativeAOT-coreclr

Milestone: 8.0.0

@ivanpovazan
Copy link
Member

/cc: @curia-damiano you might be interested

@shana
Copy link
Contributor

shana commented Oct 4, 2023

+10 for not having to hardcode the sysroot path to get this to work. Everything else in the build system seems to be working great (as seen in godotengine/godot#82729), this is the only stumbling block that's making it slightly awkward.

@shana
Copy link
Contributor

shana commented Oct 4, 2023

@MichalStrehovsky BTW, looks like the workaround mentioned in #91997 is only for the -lc++ linker argument, and not for the -isysroot path, so there's no current (easy) workarounds for this. I'm doing xcode location detection with a target running xcode-select right now, so it's not too horrible :)

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 18, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jan 10, 2024
@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
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants