Closed moreal closed 2 years ago
I think that we may have to deal with it after #2161.
I had the same problem and solved it by installing another dotnet sdk version 3.1.x. My m1 mac has two versions of dotnet sdk.
Workaround: Install .NET SDK 3.1, and install it by dotnet tool install -g Libplanet.Tools
Although this issue (#2280) and #2161 are apparently duplicated, I'm going to distinguish two by their ways to reproduce their problems.
dotnet build --project Libplanet.Tools
or dotnet tool install Libplanet.Tools
— it's about building Libplanet.Tools on arm64.This issue (#2280), on the other hand, deals with the problem faced when you try the planet
program from GitHub Releases or npm install @planetarium/cli
— it's about how we provide official executable binaries of planet
.
The key blocker of this as of September 2022 is that:
dotnet build
does not support crosscompile osx-arm64 binaries from other hosts than osx-arm64.dotnet build does not support crosscompile osx-arm64 binaries from other hosts than osx-arm64.
I guess it's possible. The below log is from another .NET executable project built with the osx-arm64
on my linux-x64 machine.
[longfin@longfin-desktop-arch .Libplanet]$ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.109
Commit: 58a93139d8
Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/6.0.109/
global.json file:
/home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/global.json
Host:
Version: 6.0.9
Architecture: x64
Commit: 163a63591c
.NET SDKs installed:
3.1.120 [/usr/share/dotnet/sdk]
6.0.109 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Download .NET:
https://aka.ms/dotnet-download
Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info
[longfin@longfin-desktop-arch .Lib9c.Tools]$ dotnet publish -r osx-arm64 --self-contained
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
Libplanet.Stun -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet.Stun/bin/Debug/netstandard2.0/Libplanet.Stun.dll
Libplanet -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet/bin/Debug/netstandard2.0/Libplanet.dll
Libplanet.RocksDBStore -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet.RocksDBStore/bin/Debug/netstandard2.0/Libplanet.RocksDBStore.dll
Libplanet.Net -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet.Net/bin/Debug/netstandard2.0/Libplanet.Net.dll
Libplanet.Analyzers -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet.Analyzers/bin/Debug/netstandard2.0/Libplanet.Analyzers.dll
Lib9c -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/Lib9c/.bin/netstandard2.0/Lib9c.dll
Lib9c.DevExtensions -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/Lib9c.DevExtensions/.bin/netstandard2.0/Lib9c.DevExtensions.dll
Libplanet.Stun -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet.Stun/bin/Debug/netcoreapp3.1/Libplanet.Stun.dll
Libplanet -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet/bin/Debug/netcoreapp3.1/Libplanet.dll
Libplanet.Net -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet.Net/bin/Debug/netcoreapp3.1/Libplanet.Net.dll
Libplanet.Analyzers -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Libplanet/Libplanet.Analyzers/bin/Debug/netcoreapp3.1/Libplanet.Analyzers.dll
Lib9c.Tools -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Lib9c.Tools/bin/Debug/net6.0/osx-arm64/9c-tools.dll
Lib9c.Tools -> /home/longfin/9c-launcher/NineChronicles.Headless/Lib9c/.Lib9c.Tools/bin/Debug/net6.0/osx-arm64/publish/
It seems that main blocker is the pinning netcoreapp3.1
on the csproj.
https://github.com/planetarium/libplanet/blob/1a41a33750ab306c4b67346d52415f72b222b444/Libplanet.Tools/Libplanet.Tools.csproj#L23
Currently, it shows the below error message when I ran
npm install -g @planetarium/cli
: