move icon indicating copy to clipboard operation
move copied to clipboard

Installation fails on MacOS due to broken .NET dependency

Open awelc opened this issue 3 years ago • 5 comments

When running the dev_setup.sh script installation of .NET on MacOS (M1) fails with the following error:

dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.404/dotnet-sdk-5.0.404-osx-arm64.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at primary link 'https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.404/dotnet-sdk-5.0.404-osx-arm64.tar.gz' is not available.
dotnet-install: Attempting to download using legacy link https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.404/dotnet-dev-osx-arm64.5.0.404.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at legacy link 'https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.404/dotnet-dev-osx-arm64.5.0.404.tar.gz' is not available.
dotnet_install: Error: Could not find `.NET Core SDK` with version = 5.0.404
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support

It seems like the problem is related to .NET version 6 now being the default one which might have affected what's available for CI installations.

awelc avatar Jan 28 '22 01:01 awelc

As a quick follow-up, it seems like the dotnet-install.sh script downloaded and used by dev_setup.sh script no longer supports installing any 5.0 versions.

awelc avatar Jan 29 '22 01:01 awelc

Another quick folllow-up - it looks like if you are on a Mac with the M1 chip you are out of luck as there is no Arm64 binary for the 5.X versions (see here).

awelc avatar Jan 29 '22 01:01 awelc

@modocache do you have an idea what is happening here? I thought we upgraded to v6 because of M1, but maybe I remember this wrong.

wrwg avatar Jan 29 '22 02:01 wrwg

Actually, scratch my last comment, as all should be good with Rosetta emulation (sorry - pretty new to M1 Macs).

In any case, I may have a quick PR to fix this, but I will not file it today - the solution is basically to force downloading of the x64 version (as Arm64 version does not exist), though at this point I am not sure if the additional arch option below has to be predicated on the OS type.

diff --git a/scripts/dev_setup.sh b/scripts/dev_setup.sh
index f07a2cc3f..059330a97 100755
--- a/scripts/dev_setup.sh
+++ b/scripts/dev_setup.sh
@@ -451,7 +451,7 @@ function install_dotnet {
     # Below we need to (a) set TERM variable because the .net installer expects it and it is not set
     # in some environments (b) use bash not sh because the installer uses bash features.
     curl -sSL https://dot.net/v1/dotnet-install.sh \
-        | TERM=linux /bin/bash -s -- --channel $DOTNET_VERSION --install-dir "${DOTNET_INSTALL_DIR}" --version latest
+        | TERM=linux /bin/bash -s -- --channel $DOTNET_VERSION --install-dir "${DOTNET_INSTALL_DIR}" --version latest --architecture "x64"
   else
     echo Dotnet already installed.
   fi

awelc avatar Jan 29 '22 02:01 awelc

Did https://github.com/diem/move/commit/927c229cd8dfa6dcd50ba84811f80d10496c76d2 fix this?

sblackshear avatar Feb 10 '22 03:02 sblackshear

Closed per fix in https://github.com/diem/move/commit/927c229cd8dfa6dcd50ba84811f80d10496c76d2

jsladerman avatar Nov 16 '22 02:11 jsladerman