fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 520 forks source link

`dotnet paket restore` fails on M1 #4146

Open auduchinok opened 2 years ago

auduchinok commented 2 years ago

I'm trying to open Fantomas solution on a Mac with M1 processor, but restore fails like this:

eugene@Eugenes-Air:fantomas$ dotnet paket restore
Failed to load /usr/local/share/dotnet/shared/Microsoft.NETCore.App/5.0.5/libhostpolicy.dylib, error:
  dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/5.0.5/libhostpolicy.dylib, 0x0001):
    tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/5.0.5/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
An error occurred while loading required library libhostpolicy.dylib from [/usr/local/share/dotnet/shared/Microsoft.NETCore.App/5.0.5]

Fantomas uses Paket 7.0.2 and I've tried updating it to 7.1.5 locally. .NET info:

eugene@Eugenes-Air:fantomas$ dotnet --version
6.0.202
auduchinok commented 2 years ago

Targeting net6.0 might fix it, as .NET 6 fixed a lot of issues related to M1/aarch64 on macOS.