unoplatform / uno.check

CLI tool to setup your environment to build Uno Platform apps
https://platform.uno
29 stars 17 forks source link

Uno-check should report an accurate error when running under macOS Rosetta #229

Open randomroxks opened 7 months ago

randomroxks commented 7 months ago

Title says it all:

⚠ Installation failed for .NET SDK 8.0.101. Fix failed - '/usr/bin/sudo' with arguments '/usr/sbin/installer -verbose -dumplog -pkg "/var/folders/tg/72zl10b10ks2z1gw2c3vmnqm0000gn/T/j2l0vqyc.v01.pkg" -target /' exited with code 1

πŸ”Ž GTK3+ Checkup...

πŸ”Ž dotnet new Uno Project Templates Checkup...

❌ Skipped: .NET SDK - Workloads (8.0.101) ────────────────────────────────────────────────────────────────────────────────

πŸ”” There were one or more problems detected. Please review the errors and correct them and run uno-check again.

jeromelaban commented 7 months ago

Thanks for the report. We're not able to reproduce this on an arm64 device.

Could you attach the full log of the tool running with --verbose? Thanks!

randomroxks commented 6 months ago

Here it is: _ | |_ _ | | _ | | | | | ' \ / _ \ ___ / | | ' \ / \ / | | |/ / | || | | | | | | () | || | ( | | | | | / | ( | < _,| || || \/ _| || || _| __| ||_\

πŸš‘ Uno Platform Check v1.20.0.0 πŸ’‰ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── This tool will check your Uno Platform development environment. If problems are detected, it will offer the option to try and fix them for you, or suggest a way to fix them yourself. ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏳ Synchronizing configuration...Loading Manifest from: https://raw.githubusercontent.com/unoplatform/uno.check/cb74c45d871e416469bac56f228f0d514e0db3c3/manifests/uno.ui.manifest.json Required Version: 1.14.0 Current Version: 1.20.0.0 ok ⏳ Scheduling appointments...SetEnvironmentVariable: DOTNET_ROOT=/usr/local/share/dotnet SetEnvironmentVariable: DOTNET_ROOT=/usr/local/share/dotnet ok

πŸ”Ž OpenJDK 11.0 Checkup... ValidateAndroidSdkLocation: , result=False ValidateAndroidSdkLocation: `/Users/{home}/Library/Android/sdk`, result=True ValidateAndroidSdkLocation: `/Users/{home}/Library/Android/sdk`, result=True ValidateJavaSdkLocation:, result=False ValidateJavaSdkLocation: /Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home, result=True ValidateJavaSdkLocation: /Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home, result=True ValidateAndroidNdkLocation: `, result=False Best NDK selected: v22.1.7171670 in /Users/{home}/Library/Android/sdk/ndk-bundle ValidateAndroidNdkLocation:/Users/{home}/Library/Android/sdk/ndk-bundle`, result=True SHELL: /bin/zsh /tmp/tmpGDMtmF.tmp javac 11.0.16.1 SHELL: /bin/zsh /tmp/tmp9Z3iyx.tmp javac 11.0.16.1 βœ” 11.0.16.1 (/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/..) SetEnvironmentVariable: JAVA_HOME=/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home

πŸ”Ž Android SDK Checkup... ValidateAndroidSdkLocation: , result=False ValidateAndroidSdkLocation: `/Users/{home}/Library/Android/sdk`, result=True ValidateAndroidSdkLocation: `/Users/{home}/Library/Android/sdk`, result=True ValidateJavaSdkLocation: `/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home`, result=True ValidateAndroidNdkLocation:, result=False Best NDK selected: v22.1.7171670 in /Users/{home}/Library/Android/sdk/ndk-bundle ValidateAndroidNdkLocation: /Users/{home}/Library/Android/sdk/ndk-bundle, result=True SetEnvironmentVariable: ANDROID_SDK_ROOT=/Users/{home}/Library/Android/sdk SetEnvironmentVariable: ANDROID_HOME=/Users/{home}/Library/Android/sdk βœ” emulator (34.2.5) βœ” build-tools;34.0.0 (34.0.0) βœ” platforms;android-34 (2) βœ” system-images;android-34;google_apis;arm64-v8a (12) βœ” platform-tools (34.0.5) βœ” cmdline-tools;5.0 (5.0)

πŸ”Ž Android Emulator Checkup... βœ” Emulator: Pixel_6_Pro_API_33 found.

πŸ”Ž XCode 15.0.1 Checkup... SHELL: /bin/zsh /tmp/tmpBI6dHe.tmp /Applications/Xcode.app/Contents/Developer SHELL: /bin/zsh /tmp/tmpKBFExl.tmp Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild

User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES

2024-02-16 08:04:12.822 xcodebuild[21393:3221260] Writing error result bundle to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/ResultBundle_2024-16-02_08-04-0012.xcresult xcodebuild: error: The directory /Users/{home}/Projects/Private does not contain an Xcode project.

βœ” Xcode.app (15.2 15C500b)

πŸ”Ž .NET SDK Checkup... SetEnvironmentVariable: DOTNET_ROOT=/usr/local/share/dotnet SHELL: /bin/zsh /tmp/tmpK2QjPc.tmp 6.0.414 [/usr/local/share/dotnet/sdk] 6.0.417 [/usr/local/share/dotnet/sdk] 6.0.418 [/usr/local/share/dotnet/sdk] 7.0.308 [/usr/local/share/dotnet/sdk] 7.0.401 [/usr/local/share/dotnet/sdk] 7.0.402 [/usr/local/share/dotnet/sdk] 8.0.100 [/usr/local/share/dotnet/sdk] 8.0.101 [/usr/local/share/dotnet/sdk] – 6.0.414 - /usr/local/share/dotnet/sdk/6.0.414 – 6.0.417 - /usr/local/share/dotnet/sdk/6.0.417 – 6.0.418 - /usr/local/share/dotnet/sdk/6.0.418 – 7.0.308 - /usr/local/share/dotnet/sdk/7.0.308 – 7.0.401 - /usr/local/share/dotnet/sdk/7.0.401 – 7.0.402 - /usr/local/share/dotnet/sdk/7.0.402 – 8.0.100 - /usr/local/share/dotnet/sdk/8.0.100 – 8.0.101 - /usr/local/share/dotnet/sdk/8.0.101 SetEnvironmentVariable: DOTNET_SDK=/usr/local/share/dotnet/sdk/8.0.101 SetEnvironmentVariable: DOTNET_SDK_VERSION=8.0.101

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── πŸ’‰ Recommendation: Download .NET SDK (8.0.200) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” Attempt to fix? [y/n] (y): y ⏳ Attempting to fix: .NET SDK Installing .NET SDK 8.0.200... System.Exception: '/usr/bin/sudo' with arguments '/usr/sbin/installer -verbose -dumplog -pkg "/tmp/hfpdqjy5.voy.pkg" -target /' exited with code 1 at void Boots.Core.AsyncProcess.ThrowForExitCode(int exitCode)
at async Task Boots.Core.AsyncProcess.RunAsync(CancellationToken token, bool throwOnError)
at async Task Boots.Core.PkgInstaller.Install(string file, CancellationToken token)
at async Task Boots.Core.Bootstrapper.Install(CancellationToken token)
at async Task DotNetCheck.Solutions.BootsSolution.Implement(SharedState sharedState, CancellationToken cancellationToken) in //UnoCheck/Solutions/BootsSolution.cs:32 ⚠ Installation failed for .NET SDK 8.0.200. System.Exception: '/usr/bin/sudo' with arguments '/usr/sbin/installer -verbose -dumplog -pkg "/tmp/hfpdqjy5.voy.pkg" -target /' exited with code 1 at void Boots.Core.AsyncProcess.ThrowForExitCode(int exitCode)
at async Task Boots.Core.AsyncProcess.RunAsync(CancellationToken token, bool throwOnError)
at async Task Boots.Core.PkgInstaller.Install(string file, CancellationToken token)
at async Task Boots.Core.Bootstrapper.Install(CancellationToken token)
at async Task DotNetCheck.Solutions.BootsSolution.Implement(SharedState sharedState, CancellationToken cancellationToken) in /
/UnoCheck/Solutions/BootsSolution.cs:32 at async Task DotNetCheck.Cli.CheckCommand.ExecuteAsync(CommandContext context, CheckSettings settings) in /_/UnoCheck/CheckCommand.cs:236
Fix failed - '/usr/bin/sudo' with arguments '/usr/sbin/installer -verbose -dumplog -pkg "/tmp/hfpdqjy5.voy.pkg" -target /' exited with code 1

πŸ”Ž GTK3+ Checkup...

πŸ”Ž dotnet new Uno Project Templates Checkup...

❌ Skipped: .NET SDK - Workloads (8.0.200) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Checkup had Error status: dotnet

dotnet: .NET SDK (8.0.200) not installed. πŸ”” There were one or more problems detected. Please review the errors and correct them and run uno-check again.

Press Enter to finish...

randomroxks commented 6 months ago

Here is another log:

Learn about SDK resolution: https://aka.ms/dotnet/sdk-not-found 6.0.414 [/usr/local/share/dotnet/sdk] 6.0.417 [/usr/local/share/dotnet/sdk] 6.0.418 [/usr/local/share/dotnet/sdk] 7.0.308 [/usr/local/share/dotnet/sdk] 7.0.401 [/usr/local/share/dotnet/sdk] 7.0.402 [/usr/local/share/dotnet/sdk] 8.0.100 [/usr/local/share/dotnet/sdk] 8.0.101 [/usr/local/share/dotnet/sdk] 8.0.201 [/usr/local/share/dotnet/sdk] System.Exception: Workload command failed: dotnet workload update --print-rollback at async (ValueTuple<string, string, string>[[]] id) DotNetCheck.DotNet.DotNetWorkloadManager.GetInstalledWorkloads() in //UnoCheck/DotNet/DotNetWorkloadManager.cs:102 at async Task DotNetCheck.Checkups.DotNetWorkloadsCheckup.Examine(SharedState history) in //UnoCheck/Checkups/DotNetWorkloadsCheckup.cs:72
at async Task DotNetCheck.Cli.CheckCommand.ExecuteAsync(CommandContext context, CheckSettings settings) in /_/UnoCheck/CheckCommand.cs:175
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Checkup had Error status: dotnetworkloads-8.0.200

dotnetworkloads-8.0.200: Workload command failed: dotnet workload update --print-rollback πŸ”” There were one or more problems detected. Please review the errors and correct them and run uno-check again.

jeromelaban commented 6 months ago

Thanks. There is unfortunately not enough information to troubleshoot this issue with this log.

Let's try something else. Can you run this:

wget https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.200/dotnet-sdk-8.0.200-osx-arm64.pkg
sudo /usr/sbin/installer -verbose -dumplog -pkg "dotnet-sdk-8.0.200-osx-arm64.pkg" -target /

and paste the logs here?

randomroxks commented 6 months ago

Thanks. There is unfortunately not enough information to troubleshoot this issue with this log.

Let's try something else. Can you run this:

wget https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.200/dotnet-sdk-8.0.200-osx-arm64.pkg
sudo /usr/sbin/installer -verbose -dumplog -pkg "dotnet-sdk-8.0.200-osx-arm64.pkg" -target /

and paste the logs here?

% wget https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.200/dotnet-sdk-8.0.200-osx-arm64.pkg sudo /usr/sbin/installer -verbose -dumplog -pkg "dotnet-sdk-8.0.200-osx-arm64.pkg" -target / --2024-02-16 08:13:12-- https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.200/dotnet-sdk-8.0.200-osx-arm64.pkg Resolving dotnetcli.azureedge.net (dotnetcli.azureedge.net)... 72.21.81.200 Connecting to dotnetcli.azureedge.net (dotnetcli.azureedge.net)|72.21.81.200|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 218511165 (208M) [application/octet-stream] Saving to: β€˜dotnet-sdk-8.0.200-osx-arm64.pkg’

dotnet-sdk-8.0.200-osx-arm64.pkg 100%[======================================================================================================================================================================>] 208.39M 14.1MB/s in 21s

2024-02-16 08:13:34 (9.89 MB/s) - β€˜dotnet-sdk-8.0.200-osx-arm64.pkg’ saved [218511165/218511165]

installer: Error - Microsoft .NET SDK 8.0.200 (arm64) can’t be installed on this computer. Private %

jeromelaban commented 6 months ago

This is a curious error:

installer: Error - Microsoft .NET SDK 8.0.200 (arm64) can’t be installed on this computer.

Which would indicate a specific configuration for your machine.

Could you run this:

/usr/bin/arch
/usr/sbin/sysctl -n machdep.cpu.brand_string

and post the results

randomroxks commented 6 months ago

/usr/bin/arch /usr/sbin/sysctl -n machdep.cpu.brand_string

% /usr/bin/arch /usr/sbin/sysctl -n machdep.cpu.brand_string i386 Apple M1 Max

jeromelaban commented 6 months ago

Thanks, this explains a lot about the behavior. Would you have configured your shell to execute under rosetta?

@spouliot is it something that rings a bell?

randomroxks commented 6 months ago

Thats weird, I downloaded another terminal warp, and ran the same command and got this: /usr/bin/arch /usr/sbin/sysctl -n machdep.cpu.brand_string arm64 Apple M1 Max

randomroxks commented 6 months ago

Thanks, this explains a lot about the behavior. Would you have configured your shell to execute under rosetta?

@spouliot is it something that rings a bell?

SHEEAT. You are right. I'm so sorry, dang it.

randomroxks commented 6 months ago

User error.

jeromelaban commented 6 months ago

Thanks, let me keep this one opened so uno-check can provide more accurate errors when this scenario happens.

spouliot commented 6 months ago

You can detect rosetta translation using this code https://github.com/xamarin/xamarin-macios/pull/9972/files#diff-ace43dcd3a57b49dc3ac34fae417ce7a5c57941dd75e4601f3a2a2e6f2d8e2b9R111