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

Mono: the runtime packages for .NET 6+ do not contain the runtime as a .framework for iOS/tvOS/watchOS #42846

Closed
Tracked by #8901
rolfbjarne opened this issue Sep 29, 2020 · 6 comments · Fixed by #53370
Assignees
Milestone

Comments

@rolfbjarne
Copy link
Member

Description

The mono runtime packages (for instance Microsoft.NETCore.App.Runtime.ios-x64) only contain the native libraries as static libraries (.a) and dynamic libraries (.dylib). We also need a .framework version of the native libraries, because this is crucial to keep app size down for apps that contains app extensions, otherwise the mono runtime will end up duplicated in the main app + every app extension (because Apple doesn't allow .dylibs in the App Store, only .frameworks).

$ ls -la  ~/.nuget/packages/microsoft.netcore.app.runtime.ios-x64/5.0.0-preview.6.20264.1/runtimes/ios-x64/native             
total 76456
drwxr-xr-x  15 rolf  staff       480 May 19 16:19 .
drwxr-xr-x   4 rolf  staff       128 May 19 16:19 ..
-rwxr--r--   1 rolf  staff   3084160 May 14 09:27 System.Private.CoreLib.dll
drwxr-xr-x   5 rolf  staff       160 May 19 16:19 cross
drwxr-xr-x   3 rolf  staff        96 May 19 16:19 include
-rwxr--r--   1 rolf  staff   2894936 May 14 09:38 libSystem.IO.Compression.Native.a
-rwxr--r--   1 rolf  staff    917376 May 14 09:38 libSystem.IO.Compression.Native.dylib
-rwxr--r--   1 rolf  staff    363120 May 14 09:38 libSystem.Native.a
-rwxr--r--   1 rolf  staff     69380 May 14 09:38 libSystem.Native.dylib
-rwxr--r--   1 rolf  staff     26936 May 14 09:38 libSystem.Net.Security.Native.a
-rwxr--r--   1 rolf  staff     15784 May 14 09:38 libSystem.Net.Security.Native.dylib
-rwxr--r--   1 rolf  staff    150008 May 14 09:38 libSystem.Security.Cryptography.Native.Apple.a
-rwxr--r--   1 rolf  staff     32164 May 14 09:38 libSystem.Security.Cryptography.Native.Apple.dylib
-rwxr--r--   1 rolf  staff  26937688 May 14 09:22 libmono.a
-rwxr--r--   1 rolf  staff   4642932 May 14 09:26 libmono.dylib

For the record, this is what Mono currently provides:

$ curl -LO https://xamjenkinsartifact.azureedge.net/mono-sdks/xcode-11C29/ios-release-Darwin-be2226b5a1c57df065efc4c1cf008d581e5cec7d.7z
$ $ 7z l *7z | grep [.]framework
2020-09-16 15:09:44 D....            0            0  ios-frameworks/ios-sim/Mono.framework
2020-09-16 15:09:27 D....            0            0  ios-frameworks/ios-sim/Mono.framework.dSYM
2020-09-16 15:09:27 D....            0            0  ios-frameworks/ios-sim/Mono.framework.dSYM/Contents
2020-09-16 15:09:27 D....            0            0  ios-frameworks/ios-sim/Mono.framework.dSYM/Contents/Resources
2020-09-16 15:09:38 D....            0            0  ios-frameworks/ios-sim/Mono.framework.dSYM/Contents/Resources/DWARF
2020-09-16 15:09:27 D....            0            0  ios-frameworks/ios/Mono.framework
2020-09-16 15:09:19 D....            0            0  ios-frameworks/ios/Mono.framework.dSYM
2020-09-16 15:09:19 D....            0            0  ios-frameworks/ios/Mono.framework.dSYM/Contents
2020-09-16 15:09:19 D....            0            0  ios-frameworks/ios/Mono.framework.dSYM/Contents/Resources
2020-09-16 15:09:22 D....            0            0  ios-frameworks/ios/Mono.framework.dSYM/Contents/Resources/DWARF
2020-09-16 15:09:44 D....            0            0  ios-frameworks/tvos-sim/Mono.framework
2020-09-16 15:09:38 D....            0            0  ios-frameworks/tvos-sim/Mono.framework.dSYM
2020-09-16 15:09:38 D....            0            0  ios-frameworks/tvos-sim/Mono.framework.dSYM/Contents
2020-09-16 15:09:38 D....            0            0  ios-frameworks/tvos-sim/Mono.framework.dSYM/Contents/Resources
2020-09-16 15:09:38 D....            0            0  ios-frameworks/tvos-sim/Mono.framework.dSYM/Contents/Resources/DWARF
2020-09-16 15:09:27 D....            0            0  ios-frameworks/tvos/Mono.framework
2020-09-16 15:09:22 D....            0            0  ios-frameworks/tvos/Mono.framework.dSYM
2020-09-16 15:09:22 D....            0            0  ios-frameworks/tvos/Mono.framework.dSYM/Contents
2020-09-16 15:09:22 D....            0            0  ios-frameworks/tvos/Mono.framework.dSYM/Contents/Resources
2020-09-16 15:09:22 D....            0            0  ios-frameworks/tvos/Mono.framework.dSYM/Contents/Resources/DWARF
2020-09-16 15:09:44 D....            0            0  ios-frameworks/watchos-sim/Mono.framework
2020-09-16 15:09:41 D....            0            0  ios-frameworks/watchos-sim/Mono.framework.dSYM
2020-09-16 15:09:41 D....            0            0  ios-frameworks/watchos-sim/Mono.framework.dSYM/Contents
2020-09-16 15:09:41 D....            0            0  ios-frameworks/watchos-sim/Mono.framework.dSYM/Contents/Resources
2020-09-16 15:09:41 D....            0            0  ios-frameworks/watchos-sim/Mono.framework.dSYM/Contents/Resources/DWARF
2020-09-16 15:09:27 D....            0            0  ios-frameworks/watchos/Mono.framework
2020-09-16 15:09:23 D....            0            0  ios-frameworks/watchos/Mono.framework.dSYM
2020-09-16 15:09:23 D....            0            0  ios-frameworks/watchos/Mono.framework.dSYM/Contents
2020-09-16 15:09:23 D....            0            0  ios-frameworks/watchos/Mono.framework.dSYM/Contents/Resources
2020-09-16 15:09:27 D....            0            0  ios-frameworks/watchos/Mono.framework.dSYM/Contents/Resources/DWARF
2020-09-16 15:09:38 ....A          643               ios-frameworks/ios-sim/Mono.framework.dSYM/Contents/Info.plist
2020-09-16 15:09:38 ....A     28972956               ios-frameworks/ios-sim/Mono.framework.dSYM/Contents/Resources/DWARF/Mono
2020-09-16 15:09:44 ....A         1908               ios-frameworks/ios-sim/Mono.framework/Info.plist
2020-09-16 15:09:27 ....A     10532656               ios-frameworks/ios-sim/Mono.framework/Mono
2020-09-16 15:09:22 ....A          643               ios-frameworks/ios/Mono.framework.dSYM/Contents/Info.plist
2020-09-16 15:09:22 ....A     33142227               ios-frameworks/ios/Mono.framework.dSYM/Contents/Resources/DWARF/Mono
2020-09-16 15:09:27 ....A         1908               ios-frameworks/ios/Mono.framework/Info.plist
2020-09-16 15:09:19 ....A     10540152               ios-frameworks/ios/Mono.framework/Mono
2020-09-16 15:09:38 ....A          643               ios-frameworks/tvos-sim/Mono.framework.dSYM/Contents/Info.plist
2020-09-16 15:09:41 ....A     15960352               ios-frameworks/tvos-sim/Mono.framework.dSYM/Contents/Resources/DWARF/Mono
2020-09-16 15:09:44 ....A         1874               ios-frameworks/tvos-sim/Mono.framework/Info.plist
2020-09-16 15:09:27 ....A      5365408               ios-frameworks/tvos-sim/Mono.framework/Mono
2020-09-16 15:09:22 ....A          643               ios-frameworks/tvos/Mono.framework.dSYM/Contents/Info.plist
2020-09-16 15:09:23 ....A     12138651               ios-frameworks/tvos/Mono.framework.dSYM/Contents/Resources/DWARF/Mono
2020-09-16 15:09:27 ....A         1874               ios-frameworks/tvos/Mono.framework/Info.plist
2020-09-16 15:09:19 ....A     29800816               ios-frameworks/tvos/Mono.framework/Mono
2020-09-16 15:09:41 ....A          643               ios-frameworks/watchos-sim/Mono.framework.dSYM/Contents/Info.plist
2020-09-16 15:09:44 ....A     12545190               ios-frameworks/watchos-sim/Mono.framework.dSYM/Contents/Resources/DWARF/Mono
2020-09-16 15:09:44 ....A         1871               ios-frameworks/watchos-sim/Mono.framework/Info.plist
2020-09-16 15:09:27 ....A      5342572               ios-frameworks/watchos-sim/Mono.framework/Mono
2020-09-16 15:09:27 ....A          643               ios-frameworks/watchos/Mono.framework.dSYM/Contents/Info.plist
2020-09-16 15:09:27 ....A     20102394               ios-frameworks/watchos/Mono.framework.dSYM/Contents/Resources/DWARF/Mono
2020-09-16 15:09:27 ....A         1871               ios-frameworks/watchos/Mono.framework/Info.plist
2020-09-16 15:09:19 ....A     58716912               ios-frameworks/watchos/Mono.framework/Mono
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Sep 29, 2020
@ghost
Copy link

ghost commented Sep 29, 2020

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

@EgorBo
Copy link
Member

EgorBo commented Sep 29, 2020

@rolfbjarne isn't .framework just a folder with dylib + plist inside? (+install_name_tool)

@marek-safar marek-safar added area-Infrastructure-mono and removed area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Sep 29, 2020
@ghost
Copy link

ghost commented Sep 29, 2020

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

@marek-safar marek-safar added this to the 6.0.0 milestone Sep 29, 2020
@rolfbjarne
Copy link
Member Author

@rolfbjarne isn't .framework just a folder with dylib + plist inside? (+install_name_tool)

Yes, pretty much, you can create the .framework from the .dylib from the command line (it's a bit more than just cp, but it can be done).

@spouliot
Copy link
Contributor

Here's some (work-in-progress) docs about what we had (legacy), what we have now (for dotnet) and what we need (for dotnet) in order to complete features (like app extensions).

https://paper.dropbox.com/doc/Binary-Code-Sharing-BKep8SE0rebrstXGdUu5LtsVAg-qcp79iqZZzQnGwRZ85y7a

@steveisok steveisok assigned directhex and unassigned steveisok May 19, 2021
@rolfbjarne
Copy link
Member Author

This might not be as urgent as we thought, it might be enough to fix #52989 for now (we'll still need this fix, but it's possible that fixing #52989 will unblock our bump to P5 at least).

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 27, 2021
directhex added a commit that referenced this issue Jul 8, 2021
Additionally ship Mono on iOS/tvOS/MacCatalyst as a .framework bundle

Fixes #42846
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants