Skip to content

Conversation

@bman46
Copy link

@bman46 bman46 commented Nov 21, 2021

While the current version works well with Rosetta 2, it is beneficial to be able to compile natively for ARM/Apple Silicon.

One issue that I would like input on is the switch from dotnet 5 to 6 for the CLI tools. Dotnet 6 is the minimum version to be able to target osx-arm64 and switching the CLI tools to 6 allows for the tools to be compiled and run natively on arm. The changes that I made should still work fine with dotnet 5 and be able to compile for osx-arm64 as long as dotnet 6 is also installed. It may also make more sense for this upgrade to be a separate pull request and upgrade all of the projects together to dotnet 6.

The 'osx-arm64' RID is only supported on .net versions greater than 6.0.
https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
Updates the GetTargetPlatformInformationResult() function to add 'osx-arm64' target. 
Updates the 'default' case to automatically detect M1 mac.
Add notes about osx-arm64.
@bman46 bman46 marked this pull request as ready for review November 27, 2021 03:52
Ensure that dotnet 6 is installed when compiling for MacOS ARM.
Checks to see if the dotnet 6 or greater is running.
@danatcofo
Copy link
Contributor

This looks good. I think it helps us later down the road as well. I'd like to eventually have electronize support both 5 and 6 that we we aren't always forcing the users forward before they are ready.

@schaveyt
Copy link

schaveyt commented Dec 8, 2021

This will be an amazing addition! Does this not lay the groundwork for supporting RIDs win-arm64 and linux-x64?

@bman46
Copy link
Author

bman46 commented Dec 8, 2021

This will be an amazing addition! Does this not lay the groundwork for supporting RIDs win-arm64 and linux-x64?

Linux arm and x64 is already supported. However, make sure you set the electron arch to arm64 as it will default to x64. Windows arm is not supported but can be targeted manually. The changes in this PR could certainly be used to support ARM for all Operating Systems, but i'm just targeting MacOS for now as I can test it.

@danatcofo
Copy link
Contributor

.NET6 support #636

@danatcofo
Copy link
Contributor

As a side note.. even intel based macos target will run on silicone with rosetta installed, tested on my m1 air

softwareupdate --install-rosetta prior to installation of the app.

@bman46
Copy link
Author

bman46 commented Jan 25, 2022

As a side note.. even intel based macos target will run on silicone with rosetta installed, tested on my m1 air

It's a bit faster when run native, even when run with the basic hello world app it seems to be noticeable. I haven't timed it though. I also noted this on the PR comment.

While the current version works well with Rosetta 2, it is beneficial to be able to compile natively for ARM/Apple Silicon.

@robertmuehsig
Copy link
Collaborator

I think we should switch to .NET 6 before, because otherwise it would feel "weird". I will look into this PR here and then we come back to this, ok? #636

@bman46
Copy link
Author

bman46 commented Feb 21, 2022

Thats fine with me @robertmuehsig.

@GregorBiswanger GregorBiswanger self-assigned this Apr 6, 2022
@GregorBiswanger GregorBiswanger added this to the 18.6.1 milestone Apr 6, 2022
@GregorBiswanger GregorBiswanger merged commit 0de9699 into ElectronNET:master Apr 6, 2022
theolivenbaum added a commit to theolivenbaum/Electron.NET that referenced this pull request Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants