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

.NET 6: add support for builds with multiple architectures (fat apps) #10294

Closed
rolfbjarne opened this issue Dec 15, 2020 · 0 comments · Fixed by #11983
Closed

.NET 6: add support for builds with multiple architectures (fat apps) #10294

rolfbjarne opened this issue Dec 15, 2020 · 0 comments · Fixed by #11983
Assignees
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release feature A feature to be implemented iOS Issues affecting Xamarin.iOS macOS Issues affecting Xamarin.Mac
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Dec 15, 2020

Android does an inner build per RID: https://github.com/xamarin/xamarin-android/blob/95a9c28d10827c61bdf04a050b9020c11d78966d/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets#L66-L71

See also: chat link

Ref: dotnet/sdk#14359


Time estimate: 4 weeks.

@rolfbjarne rolfbjarne added enhancement The issue or pull request is an enhancement macOS Issues affecting Xamarin.Mac iOS Issues affecting Xamarin.iOS dotnet An issue or pull request related to .NET (6) labels Dec 15, 2020
@rolfbjarne rolfbjarne added this to the .NET 6 milestone Dec 15, 2020
@rolfbjarne rolfbjarne added dotnet-pri0 .NET 6: required for stable release feature A feature to be implemented and removed enhancement The issue or pull request is an enhancement labels Feb 3, 2021
@rolfbjarne rolfbjarne self-assigned this Feb 9, 2021
rolfbjarne added a commit that referenced this issue Jun 29, 2021
Add support for universal / fat apps for iOS, macOS and Mac Catalyst.

We detect if we need to build a universal app by checking if `RuntimeIdentifiers` (plural) is set, and in that case we do a complete inner build for every `RuntimeIdentifier`, and then once those inner builds are done, we merge the resulting .app bundles together (using a new MSBuild task called `MergeAppBundles`).

When merging app bundles together, we'll run into files that exist in both apps. Depending on the file type, we do different things:

* MachO flies: lipo'ed together.
* Managed assemblies: we do a binary comparison, if the assemblies are different, we put them in a RID-specific subdirectory. At runtime we know to look for assemblies in this directory.
* runtimeconfig.bin, icudt.dat: put in a RID-specific subdirectory.
* Info.plist: computed in the outer (fat) build, the one from the inner build is ignored.
* Other files: for identical files we just copy one, otherwise we show an error.

If we run into files that are different between apps, but we should handle somehow, then we'll have to decide on a case-to-case basis what to do.

Some code shuffling was required to increase code sharing between the tools/ code, the msbuild/ code, and tests.

I've also added support for a default `RuntimeIdentifier`.

Fixes #10294.
Fixes #10861.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release feature A feature to be implemented iOS Issues affecting Xamarin.iOS macOS Issues affecting Xamarin.Mac
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant