dotnet-maui-check icon indicating copy to clipboard operation
dotnet-maui-check copied to clipboard

zsh on macOS leads to 'zsh:1: command not found: PACKAGE_SOURCE_NUGET_ORG'

Open flennic opened this issue 2 years ago • 12 comments

Hey,

when trying to execute maui-check on macOS (intel) within a zsh, the installation raises the following issue:

⏳ Attempting to fix: .NET SDK - Workloads (6.0.301)
SHELL: /bin/zsh /var/folders/jr/jj_6h9hd76q6kp3szcd3zjjw0000gn/T/tmpzUAKsP.tmp
zsh:1: command not found: PACKAGE_SOURCE_NUGET_ORG
Password:

which is due to the issue that within the *manifest.json files $() (command substitution) is used instead of ${} (parameter substitution) which works in bash but not within zsh, see:

MYDIR=.
ls $(MYDIR)

does not work in zsh, but

MYDIR=.
ls ${MYDIR}

works fine in both.

This is the root cause, however, to show the actual error, here the stack trace when continuing:

Unhandled exception: System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at Microsoft.DotNet.Cli.NuGetPackageDownloader.PackageSourceLocation.ExpandLocalFeed(String[] sourceFeedOverrides)
   at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand..ctor(ParseResult parseResult, IReporter reporter, IWorkloadResolver workloadResolver, IInstaller workloadInstaller, INuGetPackageDownloader nugetPackageDownloader, IWorkloadManifestUpdater workloadManifestUpdater, String dotnetDir, String userProfileDir, String tempDirPath, String version, IReadOnlyCollection`1 workloadIds)
   at Microsoft.DotNet.Cli.WorkloadInstallCommandParser.<>c.<ConstructCommand>b__14_0(ParseResult parseResult)
   at Microsoft.DotNet.Cli.ParseResultCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
Fix failed - Workload Install failed: `dotnet workload install --from-rollback-file 
"/var/folders/jr/jj_6h9hd76q6kp3szcd3zjjw0000gn/T/maui-check-cbd22571/workload.json" android ios maccatalyst tvos macos maui --source
"$(PACKAGE_SOURCE_NUGET_ORG)"`
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────


🔔 There were one or more problems detected.
Please review the errors and correct them and run maui-check again.

I tried to fix the issue by replacing the parentheses locally with curly braces and hard-coding the file path instead of the given manifest url to enforce the program to read in the new values. However, I run into all sorts of problems, the latest occurring at BootsSolution.cs:32 which fails with

⏳ Attempting to fix: .NET SDK
  Installing .NET SDK 6.0.400-rtm.22371.2...
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()                                     
  at Boots.Core.HttpClientWithPolicy.DoDownloadAsync(Uri uri, String tempFile, CancellationToken token)
  at Polly.AsyncPolicy.<>c__DisplayClass40_0.<<ImplementationAsync>b__0>d.MoveNext()                   
  ⚠ Installation failed for .NET SDK 6.0.400-rtm.22371.2.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()                                     
  at Boots.Core.HttpClientWithPolicy.DoDownloadAsync(Uri uri, String tempFile, CancellationToken token)
  at Polly.AsyncPolicy.<>c__DisplayClass40_0.<<ImplementationAsync>b__0>d.MoveNext()                   
Fix failed - Response status code does not indicate success: 404 (Not Found).

❌ Skipped: .NET SDK - Workload Deduplication

❌ Skipped: .NET SDK - Workloads (6.0.400-rtm.22371.2)
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Checkup had Error status: xcode
Checkup had Error status: dotnet

xcode: Found invalid data while decoding.
dotnet: .NET SDK (6.0.400-rtm.22371.2) not installed.
🔔 There were one or more problems detected.
Please review the errors and correct them and run maui-check again.

I already spent some time with the code base and would rather ask for some help before spending more time on a thing I assume should be presumably easy to fix. I am willing to create a PR, but would like to have some feedback on the planned changes and the error shown above.

Regards, flennic

flennic avatar Aug 09 '22 23:08 flennic