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 install does not create signed apphost on macOS Arm64 #21349

Closed
richlander opened this issue Sep 24, 2021 · 9 comments
Closed

dotnet install does not create signed apphost on macOS Arm64 #21349

richlander opened this issue Sep 24, 2021 · 9 comments
Assignees
Milestone

Comments

@richlander
Copy link
Member

richlander commented Sep 24, 2021

Here's my experience with dotnet-serve.

Problems:

  • I had to code sign the apphost.
  • An Arm64 apphost was generated. Should be x64, given that the best asset is net5.0, which can only ever be x64 on macOS Arm64.
rich@MacBook-Air-M1-2020 app % dotnet tool install -g dotnet-serve
You can invoke the tool using the following command: dotnet-serve
Tool 'dotnet-serve' (version '1.8.34') was successfully installed.
rich@MacBook-Air-M1-2020 app % dotnet-serve
zsh: killed     dotnet-serve
rich@MacBook-Air-M1-2020 app % codesign -s - ~/.dotnet/tools/dotnet-serve
rich@MacBook-Air-M1-2020 app % dotnet-serve                            
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '5.0.0' (arm64) was not found.
  - The following frameworks were found:
      6.0.0-rc.2.21470.37 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=5.0.0&arch=arm64&rid=osx.11.1-arm64

This is the same thing, but happens to work because the tool enable roll-forward. It demonstrates the same problem but slightly differently symptoms. Just like dotnet-serve, dotnet-runtimeinfo should be installed as x64 because it is pre .NET 6 (at least for macOS).

rich@MacBook-Air-M1-2020 dotnet-runtimeinfo % dotnet tool install -g dotnet-runtimeinfo  
You can invoke the tool using the following command: dotnet-runtimeinfo
Tool 'dotnet-runtimeinfo' (version '1.0.5') was successfully installed.
rich@MacBook-Air-M1-2020 dotnet-runtimeinfo % dotnet-runtimeinfo
zsh: killed     dotnet-runtimeinfo
rich@MacBook-Air-M1-2020 dotnet-runtimeinfo % codesign -s - ~/.dotnet/tools/dotnet-runtimeinfo 
rich@MacBook-Air-M1-2020 dotnet-runtimeinfo % dotnet-runtimeinfo
         42
         42              ,d                             ,d
         42              42                             42
 ,adPPYb,42  ,adPPYba, MM42MMM 8b,dPPYba,   ,adPPYba, MM42MMM
a8"    `Y42 a8"     "8a  42    42P'   `"8a a8P_____42   42
8b       42 8b       d8  42    42       42 8PP"""""""   42
"8a,   ,d42 "8a,   ,a8"  42,   42       42 "8b,   ,aa   42,
 `"8bbdP"Y8  `"YbbdP"'   "Y428 42       42  `"Ybbd8"'   "Y428

**.NET information
Version: 6.0.0
FrameworkDescription: .NET 6.0.0-rc.2.21470.23
Libraries version: 6.0.0-rc.2.21470.23
Libraries hash: 826f81a11ad17f415668fe1cb934bdaf00d36ea2

**Environment information
ProcessorCount: 8
OSArchitecture: Arm64
OSDescription: Darwin 21.1.0 Darwin Kernel Version 21.1.0: Sat Sep 11 12:27:45 PDT 2021; root:xnu-8019.40.67.171.4~1/RELEASE_ARM64_T8101
OSVersion: Unix 12.0.0

rich@MacBook-Air-M1-2020 dotnet-runtimeinfo % dotnet tool uninstall -g dotnet-runtimeinfo
Tool 'dotnet-runtimeinfo' (version '1.0.5') was successfully uninstalled.
rich@MacBook-Air-M1-2020 dotnet-runtimeinfo % dotnet tool install -g dotnet-runtimeinfo -a x64
Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
You can invoke the tool using the following command: dotnet-runtimeinfo
Tool 'dotnet-runtimeinfo' (version '1.0.5') was successfully installed.
rich@MacBook-Air-M1-2020 dotnet-runtimeinfo % dotnet-runtimeinfo
         42
         42              ,d                             ,d
         42              42                             42
 ,adPPYb,42  ,adPPYba, MM42MMM 8b,dPPYba,   ,adPPYba, MM42MMM
a8"    `Y42 a8"     "8a  42    42P'   `"8a a8P_____42   42
8b       42 8b       d8  42    42       42 8PP"""""""   42
"8a,   ,d42 "8a,   ,a8"  42,   42       42 "8b,   ,aa   42,
 `"8bbdP"Y8  `"YbbdP"'   "Y428 42       42  `"Ybbd8"'   "Y428

**.NET information
Version: 3.1.19
FrameworkDescription: .NET Core 3.1.19
Libraries version: 3.1.19-servicing.21411.1
Libraries hash: bb01933c496758887ca03572c8e2a16a82a1779a

**Environment information
ProcessorCount: 8
OSArchitecture: X64
OSDescription: Darwin 21.1.0 Darwin Kernel Version 21.1.0: Sat Sep 11 12:27:45 PDT 2021; root:xnu-8019.40.67.171.4~1/RELEASE_ARM64_T8101
OSVersion: Unix 21.1.0.0

Dupe of #17241.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Sep 24, 2021
@agocke
Copy link
Member

agocke commented Sep 24, 2021

@wli3 where's the call to create the apphost in dotnet tool install?

@wli3
Copy link

wli3 commented Sep 27, 2021

Here

HostWriter.CreateAppHost(appHostSourceFilePath: appHostSourcePath,

@agocke agocke changed the title dotnet-serve tool does not work on macOS Arm64 dotnet install does not create signed apphost on macOS Arm64 Oct 4, 2021
@agocke agocke removed the untriaged Request triage from a team member label Oct 4, 2021
@agocke agocke added this to the 6.0.1xx milestone Oct 4, 2021
@marcpopMSFT
Copy link
Member

@vitek-karas I recall you had a fix here: https://github.com/dotnet/sdk/compare/main...vitek-karas:FixToolSigning?expand=1 Did you ever sent that out as a PR and can we get that in for GA?

@vitek-karas
Copy link
Member

I sent out my change as #21894
It needs verification - I don't have the necessary hardware (I'm trying to get remove access to something, but not sure when/how will that happen)

@memoria-guy
Copy link

Hopefully I am on the correct issue since this has popped up in a few repos.

Does anyone know if this is fixed in .NET 7 builds? The workaround of installing the tool locally (in the project) does appear to work on M1 Mac's with macOS 12 so that is good.

@vitek-karas
Copy link
Member

It should be fixed in ,NET 6 GA as well as .NET 7 (this is the 6.0 port - #21958).
Closing this issue as it has been fixed.

@Nonary
Copy link

Nonary commented Nov 22, 2021

I ended up here following a series of closed tickets about dotnet ef not doing anything once I typed in the command. Installing the latest SDK at first did not appear to fix it. But once I reinstalled the global tool, the issue got resolved.

I am just posting my experience here in case someone else like me ended up to this issue when troubleshooting their issue as well.

@daninoontje
Copy link

I'm still running into the same issue on my end, the only fix I found was installing the x64 version of .NET 6. dotnet ef returns the unicorn ASCII. So if anybody ran into the same issue as I did, just uninstall dotnet by using the dotnet-uninstall-tool and then re-install the x64 version.

@vitek-karas
Copy link
Member

@TwisterTies unfortunately the fixes in .NET 6 arm64 SDK require the tool to be reinstalled. Can you try that?
If it still doesn't work, then could you please create a new issue?

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

9 participants