Skip to content

MGCB: Improve user experience when user tries to start mgcb-editor on macOS with Apple Silicon chip #27

@seclerp

Description

@seclerp

At the moment of creating this issue, the mgcb-editor is still not supported on Apple Silicon chips: MonoGame/MonoGame#8003 (comment)

More specifically, it doesn't work with ARM64-based .NET 8 Runtime.

The only known workaround is to launch it using an additional x64-based .NET 8 Runtime, which is supported by Rider:
image

So, when user is trying to launch MGCB Editor using our floating action in the code editor, we need:

  1. Check, if it's a macOS + Apple Silicon case
  2. If so, check if we have x64 .NET runtime installed
  3. If we don't have it installed, show a warning notification before trying to launch the tool
  4. If we have it installed, use it instead of ARM64-based runtime as a base for the mgcb-editor command

In some cases mgcb-editor is invoked without pretending dotnet - it means that we need to workaround a bit the way how it gonna be resolved.

.NET tools have different rules for running local and global tools.
For global tool, it should be executed as a stand-alone program, like that:
> mgcb-editor
For local tool, it should be executed as a sub-command for 'dotnet', like that:
> dotnet mgcb-editor
or in more explicit way:
> dotnet tool run mgcb-editor
Source: https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools#use-a-tool

As an option, we could introduce a custom DOTNET_ROOT env var.

A workaround from a user: https://www.reddit.com/r/monogame/comments/1bdbef6/developing_with_monogame_on_an_m1_apple_silicon/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions