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

Consider default $(RuntimeIdentifier) for MacCatalyst apps? #15620

Closed
jonathanpeppers opened this issue Aug 3, 2022 · 6 comments
Closed

Consider default $(RuntimeIdentifier) for MacCatalyst apps? #15620

jonathanpeppers opened this issue Aug 3, 2022 · 6 comments
Labels
dotnet An issue or pull request related to .NET (6) enhancement The issue or pull request is an enhancement
Milestone

Comments

@jonathanpeppers
Copy link
Member

Steps to Reproduce

  1. dotnet new maccatalyst
  2. dotnet build or dotnet build -c Release

Even on an M1, I get a maccatalyst-x64 app.

Expected Behavior

I'm thinking it should do:

  1. Debug - pick the RID on the machine you're building with. So an M1 gets a maccatalyst-arm64 and Intel gets maccatalyst-x64, and this would help the developer loop? No Rosetta when your app launches for debugging/development?
  2. Release - defaults to RuntimeIdentifiers=maccatalyst-x64;maccatalyst-arm64 so Release builds get an app that supports both by default.

Users can override these defaults in their .csproj.

Actual Behavior

It seems like it just defaults to maccatalyst-x64? Always?

Environment

I was testing with the latest .NET 6 builds.

@jonathanpeppers jonathanpeppers added the dotnet An issue or pull request related to .NET (6) label Aug 3, 2022
@chamons
Copy link
Contributor

chamons commented Aug 4, 2022

This seems like a good idea, adding to NET7 for consideration.

FYI @dalexsoto @rolfbjarne

@chamons chamons added this to the .NET 7 milestone Aug 4, 2022
@chamons chamons added the enhancement The issue or pull request is an enhancement label Aug 4, 2022
@jonathanpeppers
Copy link
Member Author

This might also apply to net6.0-macos apps, but I didn't try one of those. I was testing MacCatalyst for a customer's MAUI app.

@spouliot
Copy link
Contributor

spouliot commented Aug 4, 2022

This might also apply to net6.0-macos apps,

Yes, I can confirm that this is the behaviour for net6.0-macos too.

IIRC @rolfbjarne wanted to ensure consistent output whatever the arch of the bots that build the app. The same logic would also apply to Catalyst apps.

@jonathanpeppers
Copy link
Member Author

For now (maybe for .NET 7), I would consider just changing the default for Release builds and leave Debug builds as-is.

@rolfbjarne
Copy link
Member

I agree, I'll make Release builds default to be universal (for both macOS and Mac Catalyst).

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Aug 25, 2022
…amarin#15620.

ARM64-based macOS machines are becoming more and more common, and as such it
makes sense to include ARM64 builds in the app bundle when building for
release.

Universal builds are much slower than single-architecture builds, which is why
we don't make debug builds universal.

Fixes xamarin#15620.
@rolfbjarne
Copy link
Member

This is fixed now.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 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) enhancement The issue or pull request is an enhancement
Projects
None yet
Development

No branches or pull requests

4 participants