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

dotnet-ef requires x64 SDK on macOS Monterey with Apple Silicon (M1) #25927

Closed
miguellira opened this issue Sep 8, 2021 · 12 comments
Closed

Comments

@miguellira
Copy link

miguellira commented Sep 8, 2021

When installing the Arm64 version of the latest .NET 6.0 SDK (SDK 6.0.100-preview.7) on an Apple M1 Mac running the latest beta OS (macOS Monterey), the dotnet ef tooling fails to run properly and no error is given.

Steps to reproduce

  1. Install the Arm64 version of the .NET 6.0 SDK dotnet-sdk-6.0.100-preview.7.21379.14-osx-arm64.pkg
  2. Install the latest .NET 6 preview EF Core tools by running the command dotnet tool install --global dotnet-ef --version 6.0.0-preview.7.21378.4
  3. Execute the command dotnet ef
  4. The console (zsh) immediately returns and no error is provided

Additional Info

I tried several things to see if I could get an underlying message to display or log. The most telling was when I cd ~/.dotnet/tools/ and ran sudo ./dotnet-ef. This produced the following output:

zsh: killed     dotnet-ef

which when googled led me to the following closed issue dotnet/runtime#48387

Current workarounds

1. Installing x64 version of SDK for global access to dotnet ef
After trying several things, I decided to uninstall the Arm64 SDK and install the x64 SDK (dotnet-sdk-6.0.100-preview.7.21379.14-osx-x64.pkg) and was able to successfully run dotnet ef.

2. Installing dotnet ef locally
As pointed out by @spahnke below #25927 (comment), you can install dotnet-ef locally with the arm64 version of the SDK installed. Simply go to the root of you project/solution and execute the following two commands:

dotnet new tool-manifest
dotnet tool install dotnet-ef --version 6.0.0-rc.1.21452.10

Environment info

Below is the result of a call to dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.100-preview.7.21379.14
 Commit:    22d70b47bc

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.0
 OS Platform: Darwin
 RID:         osx-x64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.100-preview.7.21379.14/

Host (useful for support):
  Version: 6.0.0-preview.7.21377.19
  Commit:  91ba01788d

.NET SDKs installed:
  6.0.100-preview.7.21379.14 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

EF Core version: 6.0.0-preview.7.21378.4
Database provider: n/a
Target framework: .NET 6.0
Operating system: macOS Monterey (version 12.0 beta 21A5506j)
IDE: n/a

@ajcvickers
Copy link
Member

Related to #24971

@ajcvickers
Copy link
Member

Note from triage: we will investigate for 6.0, but we may not be able to do anything until 7.0.

@miguellira
Copy link
Author

@ajcvickers That's unfortunate but understandable given how close your team is to the official .NET 6 release.

That said, I think it is important your documentation makes it clear to macOS developers on Apple Silicon that they will be forced to install the x64 SDK and any of its required dependencies, namely Rosetta in order to work with your tools.

@ajcvickers
Copy link
Member

@miguellira I filed dotnet/EntityFramework.Docs#3426 to make sure we document this.

@spahnke
Copy link

spahnke commented Sep 15, 2021

I encountered the same issue and for me installing the tool locally in the project folder works even with the arm64 build of the SDK (both preview 7 and RC 1). It's only the globally installed tool that fails.

Note: I'm currently only playing around with EF Core on my M1 Mac, so I can't speak for every scenario. But I thought I mention it at least.

@ghost
Copy link

ghost commented Sep 15, 2021

I encountered the same issue and for me installing the tool locally in the project folder works even with the arm64 build of the SDK (both preview 7 and RC 1). It's only the globally installed tool that fails.

Note: I'm currently only playing around with EF Core on my M1 Mac, so I can't speak for every scenario. But I thought I mention it at least.

Thanks for tip, confirming dotnet-ef works as local tool only for single framework arm64 (M1) installation

@miguellira
Copy link
Author

@spahnke Thanks for the update. I will update the original post with this workaround.

@bricelam
Copy link
Contributor

@wli3 Are you aware of this? I'm still seeing it on RC1. Running the shim directly yields the following:

zsh: killed     dotnet-ef

@bricelam
Copy link
Contributor

Closing since it looks like dotnet/runtime#52335 is tracking the work that needs to happen for this.

@miguellira
Copy link
Author

miguellira commented Oct 12, 2021

@bricelam Today I decided to give RC2 a try with this issue since the bug you referenced was also marked closed. Unfortunately, this is not resolved and I would consider re-opening this issue and/or tagging another issue that would truly provide a fix.

For the record, this is what I did:

  1. I ran dotnet-uninstall-pkgs.sh located in the SDK repo to completely remove all SDKs (even though I only had one installed - RC1)
  2. I then installed the Arm64 version of RC2
  3. And attempted to run dotnet ef

Global installation still fails. Local install is my current workaround.

@spahnke
Copy link

spahnke commented Oct 13, 2021

I think this is now tracked by dotnet/sdk#21349 which is still open. That issue also shows yet another workaround by signing the global tool yourself.

codesign -s - ~/.dotnet/tools/dotnet-ef

@miguellira
Copy link
Author

Thanks @spahnke Looks like that work has already been done and merged but didn't make that RC2 cut. Hopefully it's resolved with the next release.

@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants