Closed cho-m closed 1 year ago
Hi @cho-m, Thanks for the issue. The logs you shared seems to be installing the 2.1.0 runtime, then try to access the 6.0 one. Can you check to see if you can find any lines related to installation of 6.0?
Looking at the error line, install script seems to be doing the right thing. It just doesn't look like what the build infra needs:
(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
I'm not sure yet, but the fix may end up explicitly asking for a x64 build from the script using --architecture
option in build.sh
.
Hi @cho-m,
I close the issue since you haven't provided the requested info. If the problem persists and you can help us to investigate your case, feel free to reopen the ticket.
Thank you!
Those are all the logs related to runtime installation (after 6.0 SDK download) and it kills the run as shown by exit return. There is nothing related to 6.0 runtime because the script is killed at that point.
In Homebrew, we have manually downloaded previous version of script, which has successful run that can be downloaded from GitHub action https://github.com/Homebrew/homebrew-core/suites/8497554681/artifacts/378393537 (logs-12-arm64
from https://github.com/Homebrew/homebrew-core/actions/runs/3137887110)
A snippet of successful run using previous version of dotnet-install (https://github.com/dotnet/install-scripts/blob/dac53157fcb7e02638507144bf5f8f019c1d23a8/src/dotnet-install.sh) is:
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Runtime/2.1.0/dotnet-runtime-2.1.0-osx-arm64.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at primary link 'https://dotnetcli.azureedge.net/dotnet/Runtime/2.1.0/dotnet-runtime-2.1.0-osx-arm64.tar.gz' is not available.
dotnet-install: Attempting to download using legacy link https://dotnetcli.azureedge.net/dotnet/Runtime/2.1.0/dotnet-osx-arm64.2.1.0.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at legacy link 'https://dotnetcli.azureedge.net/dotnet/Runtime/2.1.0/dotnet-osx-arm64.2.1.0.tar.gz' is not available.
dotnet-install: Attempting to download using primary link https://dotnetbuilds.azureedge.net/public/Runtime/2.1.0/dotnet-runtime-2.1.0-osx-arm64.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at primary link 'https://dotnetbuilds.azureedge.net/public/Runtime/2.1.0/dotnet-runtime-2.1.0-osx-arm64.tar.gz' is not available.
dotnet-install: Attempting to download using legacy link https://dotnetbuilds.azureedge.net/public/Runtime/2.1.0/dotnet-osx-arm64.2.1.0.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at legacy link 'https://dotnetbuilds.azureedge.net/public/Runtime/2.1.0/dotnet-osx-arm64.2.1.0.tar.gz' is not available.
dotnet_install: Error: Could not find `.NET Core Runtime` with version = 2.1.0
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support
Determining projects to restore...
Restored /private/tmp/dotnet-20220927-44322-bqggns/.nuget/packages/microsoft.dotnet.arcade.sdk/6.0.0-beta.22412.2/tools/Tools.proj (in 2.41 sec).
Unknown CPU arm64 detected, treating it as x64
Attempting to install dotnet from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Runtime/6.0.9-servicing.22419.5/dotnet-runtime-6.0.9-osx-arm64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Runtime/6.0.9-servicing.22419.5/dotnet-runtime-6.0.9-osx-arm64.tar.gz
dotnet-install: Installed version is 6.0.9
dotnet-install: Adding to current process PATH: `/private/tmp/dotnet-20220927-44322-bqggns/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
Determining projects to restore...
Restored /private/tmp/dotnet-20220927-44322-bqggns/src/SourceBuild/Arcade/src/SourceBuild.Tasks.csproj (in 4.2 sec).
SourceBuild.Tasks -> /private/tmp/dotnet-20220927-44322-bqggns/artifacts/bin/SourceBuild.Tasks/Debug/net5.0/SourceBuild.Tasks.dll
58a93139d80490d0724b4d862ba8ee00ceae45d3
https://github.com/dotnet/installer.git
58a93139d80490d0724b4d862ba8ee00ceae45d3
22649
--> Start Cloning Repo installer
Cloning into '/private/tmp/d20220927-44322-1wy5t2i/src/installer'...
done.
Note: switching to '58a93139d80490d0724b4d862ba8ee00ceae45d3'.
Hi @cho-m,
Thank you for attaching this log. As I can see, it was installing net5.0 before and a post step
dotnet-install: Installation finished successfully.
Determining projects to restore...
Restored /private/tmp/dotnet-20220927-44322-bqggns/src/SourceBuild/Arcade/src/SourceBuild.Tasks.csproj (in 4.2 sec).
SourceBuild.Tasks -> /private/tmp/dotnet-20220927-44322-bqggns/artifacts/bin/SourceBuild.Tasks/Debug/net5.0/SourceBuild.Tasks.dll
and now it attempts to install sdk v6.0.8
dotnet-install: Installation finished successfully.
Failed to load a, error: dlopen(/private/tmp/dotnet-20220927-10960-2i9o0m/.dotnet/host/fxr/6.0.8/libhostfxr.dylib, 0x0001): tried: '/private/tmp/dotnet-20220927-10960-2i9o0m/.dotnet/host/fxr/6.0.8/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
The library libhostfxr.dylib was found, but loading it from /private/tmp/dotnet-20220927-10960-2i9o0m/.dotnet/host/fxr/6.0.8/libhostfxr.dylib failed
The mentioned PR#314 is aimed to process a corner case for MacOS on arm64 machines - when any sdk version >= 6.0 is requested, sdk package with arm64 arcitecture has to be installed.
You can see this information in your logs:
Failed to load a, error: dlopen(/private/tmp/dotnet-20220927-10960-2i9o0m/.dotnet/host/fxr/6.0.8/libhostfxr.dylib, 0x0001): tried: '/private/tmp/dotnet-20220927-10960-2i9o0m/.dotnet/host/fxr/6.0.8/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
For previous sdk versions, the x64 packages may be used (if Rosetta is presented on the machine).
So the package with x64 architecture was used before because it was installing net5.0 as a post step. From the install-scripts perspective, everything works as expected.
I would recommend you check the parameters for the command that is executed after sdk installation.
All logs are for M1 (arm64) macOS machines building a copy of .NET 6.0.1xx as documented in https://github.com/dotnet/installer#building
Not sure where the dotnet-install script is called right now as the build is wrapped around the source-build script:
./build.sh /p:ArcadeBuildTarball=true /p:TarballDir=<dir>
Both before and after, the same 6.0.108 SDK osx-arm64 was downloaded (same behavior across both scripts):
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.108/dotnet-sdk-6.0.108-osx-arm64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.108/dotnet-sdk-6.0.108-osx-arm64.tar.gz
dotnet-install: Installed version is 6.0.108
dotnet-install: Adding to current process PATH: `/private/tmp/dotnet-20220927-44322-bqggns/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
The main difference in output of scripts is:
Full log for successful build with old script: 01.build.sh.txt
@baronfel please advice.
Also, I've added the full logs for each dotnet-install
script when executed via source build script (https://github.com/dotnet/installer/blob/v6.0.109/build.sh)
Run with script commit: https://github.com/dotnet/install-scripts/commit/740d99560080b61ce537c6b4e78956d78ea60ac4
Run with script commit: https://github.com/dotnet/install-scripts/commit/dac53157fcb7e02638507144bf5f8f019c1d23a8
@cho-m I understand that this looks like a regression, but in the case where your install was successful the Runtime that was requested (2.1) was never installed - do you know why the 2.1 runtime is requested in this build script? As that runtime is out of support I would definitely recommend that it be removed if possible. As it stands, we are now doing 'The Right Thing' - giving the user the version of the component they requested that can actually run on their system.
do you know why the 2.1 runtime is requested in this build script?
@baronfel Sorry, I don't know. May need to get someone working on https://github.com/dotnet/installer to comment. I've only dealt with the downstream packaging.
Hi @cho-m ,
Could you check if this issue still exists? I was driving its resolution in a different repo, so I hope it is resolved now.
Close this issue since the corresponding changes were merged to the installer repo https://github.com/dotnet/arcade/issues/11418. Please go to this comment for getting some details on how to work with the introduced changes https://github.com/dotnet/arcade/issues/11418#issuecomment-1314101641
Checking this in this PR
@YuliiaKovalova still have the same issue.
@chenrui333, could you please take a look at this comment? I believe it should resolve your issue.
While working on Homebrew packaging of
dotnet
v6.0.109 (https://github.com/Homebrew/homebrew-core/pull/111751), I noticed that M1 builds were failing on initial./build.sh /p:ArcadeBuildTarball=true /p:TarballDir=...
. It looked like the build was trying to use x64 runtime and failing:I identified failure occurs after #314 as I am able to successfully build by overriding latest
dotnet-build.sh
with the previous commit https://github.com/dotnet/install-scripts/commit/dac53157fcb7e02638507144bf5f8f019c1d23a8