dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.18k stars 4.72k forks source link

Blazor AOT Workload Installation not working on MacOS #54010

Closed ar0311 closed 3 years ago

ar0311 commented 3 years ago

Describe the bug

When trying to install AOT workload per preview 4 blog post (on MacOS) the following is returned:

System.Exception: Workload not found at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.GetPacksInWorkload(String workloadId) in Microsoft.DotNet.TemplateLocator.dll:token 0x6000069+0x3a at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>cDisplayClass14_0.b0(WorkloadId workloadId) in dotnet.dll:token 0x6000b1c+0x0 at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() in System.Linq.dll:token 0x6000219+0x51 at System.Linq.Enumerable.DistinctIterator1.MoveNext() in System.Linq.dll:token 0x6000177+0x28 at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() in System.Linq.dll:token 0x60001c1+0x29 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>cDisplayClass14_1.b3() in dotnet.dll:token 0x6000b20+0x2c at Microsoft.DotNet.Cli.TransactionalAction.EnlistmentNotification.Rollback(Enlistment enlistment) in dotnet.dll:token 0x6000ced+0x8 at System.Transactions.VolatileEnlistmentAborting.EnterState(InternalEnlistment enlistment) in System.Transactions.Local.dll:token 0x6000404+0x0 at System.Transactions.VolatileEnlistmentActive.InternalAborted(InternalEnlistment enlistment) in System.Transactions.Local.dll:token 0x60003e9+0x0 at System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx) in System.Transactions.Local.dll:token 0x6000259+0x4c at System.Transactions.TransactionStateActive.Rollback(InternalTransaction tx, Exception e) in System.Transactions.Local.dll:token 0x6000224+0x8 at System.Transactions.Transaction.Rollback() in System.Transactions.Local.dll:token 0x600010b+0x4b at System.Transactions.TransactionScope.InternalDispose() in System.Transactions.Local.dll:token 0x600019c+0x95 at System.Transactions.TransactionScope.Dispose() in System.Transactions.Local.dll:token 0x600019b+0x34b at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func1 action, Action commit, Action rollback) in dotnet.dll:token 0x6000922+0x47 at Microsoft.DotNet.Cli.TransactionalAction.Run(Action action, Action commit, Action rollback) in dotnet.dll:token 0x6000923+0x19 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloadsWithInstallRecord(IEnumerable1 workloadIds, SdkFeatureBand sdkFeatureBand) in dotnet.dll:token 0x60001cf+0xb5 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloads(IEnumerable`1 workloadIds, Boolean skipManifestUpdate) in dotnet.dll:token 0x60001ce+0x58 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.Execute() in dotnet.dll:token 0x60001cb+0x216 at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args) in dotnet.dll:token 0x60008af+0x5e at Microsoft.DotNet.Workloads.Workload.WorkloadCommand.Run(String[] args) in dotnet.dll:token 0x6000145+0x6 at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in dotnet.dll:token 0x6000918+0x2e8 at Microsoft.DotNet.Cli.Program.Main(String[] args) in dotnet.dll:token 0x6000916+0x6f

To Reproduce

dotnet workload install microsoft-net-sdk-blazorwebassembly-aot

Exceptions (if any)

See above.

Further technical details

dotnet-issue-labeler[bot] commented 3 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

pranavkm commented 3 years ago

@ar0311 are you still seeing this? There was an issue where some workload packages weren't initially available on NuGet.org, but that was remedied a few days ago.

ar0311 commented 3 years ago

Yes

sfoslund commented 3 years ago

I'm not able to repro this, what happens when you add the --skip-manifest-update option? Can you please provide the build number of the preview you're using (dotnet --info output)? Does dotnet\sdk-manifests\6.0.100\Microsoft.NET.Workload.BlazorWebAssembly\WorkloadManifest.json exist in your installation?

ar0311 commented 3 years ago

dotnet\sdk-manifests directory does not exist.

dotnet --info output:

.NET SDK (reflecting any global.json): Version: 6.0.100-preview.4.21255.9 Commit: 950e4949a7

Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/6.0.100-preview.4.21255.9/

Host (useful for support): Version: 6.0.0-preview.4.21253.7 Commit: bfd6048a60

.NET SDKs installed: 5.0.202 [/usr/local/share/dotnet/sdk] 6.0.100-preview.4.21255.9 [/usr/local/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 5.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0-preview.4.21253.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-preview.4.21253.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download

dotnet workload install microsoft-net-sdk-blazorwebassembly-aot --skip-manifest-update

System.Exception: Workload not found at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.GetPacksInWorkload(String workloadId) in Microsoft.DotNet.TemplateLocator.dll:token 0x6000069+0x3a at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>cDisplayClass14_0.b0(WorkloadId workloadId) in dotnet.dll:token 0x6000b1c+0x0 at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() in System.Linq.dll:token 0x6000219+0x51 at System.Linq.Enumerable.DistinctIterator1.MoveNext() in System.Linq.dll:token 0x6000177+0x28 at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() in System.Linq.dll:token 0x60001c1+0x29 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>cDisplayClass14_1.b3() in dotnet.dll:token 0x6000b20+0x2c at Microsoft.DotNet.Cli.TransactionalAction.EnlistmentNotification.Rollback(Enlistment enlistment) in dotnet.dll:token 0x6000ced+0x8 at System.Transactions.VolatileEnlistmentAborting.EnterState(InternalEnlistment enlistment) in System.Transactions.Local.dll:token 0x6000404+0x0 at System.Transactions.VolatileEnlistmentActive.InternalAborted(InternalEnlistment enlistment) in System.Transactions.Local.dll:token 0x60003e9+0x0 at System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx) in System.Transactions.Local.dll:token 0x6000259+0x4c at System.Transactions.TransactionStateActive.Rollback(InternalTransaction tx, Exception e) in System.Transactions.Local.dll:token 0x6000224+0x8 at System.Transactions.Transaction.Rollback() in System.Transactions.Local.dll:token 0x600010b+0x4b at System.Transactions.TransactionScope.InternalDispose() in System.Transactions.Local.dll:token 0x600019c+0x95 at System.Transactions.TransactionScope.Dispose() in System.Transactions.Local.dll:token 0x600019b+0x34b at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func1 action, Action commit, Action rollback) in dotnet.dll:token 0x6000922+0x47 at Microsoft.DotNet.Cli.TransactionalAction.Run(Action action, Action commit, Action rollback) in dotnet.dll:token 0x6000923+0x19 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloadsWithInstallRecord(IEnumerable1 workloadIds, SdkFeatureBand sdkFeatureBand) in dotnet.dll:token 0x60001cf+0xb5 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloads(IEnumerable`1 workloadIds, Boolean skipManifestUpdate) in dotnet.dll:token 0x60001ce+0x58 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.Execute() in dotnet.dll:token 0x60001cb+0x216 at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args) in dotnet.dll:token 0x60008af+0x5e at Microsoft.DotNet.Workloads.Workload.WorkloadCommand.Run(String[] args) in dotnet.dll:token 0x6000145+0x6 at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in dotnet.dll:token 0x6000918+0x2e8 at Microsoft.DotNet.Cli.Program.Main(String[] args) in dotnet.dll:token 0x6000916+0x6f

sfoslund commented 3 years ago

dotnet\sdk-manifests directory does not exist.

Okay, that's definitely the cause then. I've just double checked and the manifests dir is included in the mac zips for that build. How did you install the SDK? Can you try re-installing?

ar0311 commented 3 years ago

OK, tried re-installing and am now seeing the following:

Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.0-preview.4.21253.7... [NuGet Manager] [Info] GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.net.runtime.monoaotcompiler.task/index.json [NuGet Manager] [Info] OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.net.runtime.monoaotcompiler.task/index.json 246ms System.AggregateException: One or more errors occurred. (Access to the path '/usr/local/share/dotnet/metadata/temp/microsoft.net.runtime.monoaotcompiler.task/6.0.0-preview.4.21253.7' is denied.) ---> System.UnauthorizedAccessException: Access to the path '/usr/local/share/dotnet/metadata/temp/microsoft.net.runtime.monoaotcompiler.task/6.0.0-preview.4.21253.7' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at System.IO.FileSystem.CreateDirectory(String fullPath) in System.IO.FileSystem.dll:token 0x60001a7+0x18a at System.IO.Directory.CreateDirectory(String path) in System.IO.FileSystem.dll:token 0x6000071+0x2d at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.DownloadPackageAsync(PackageId packageId, NuGetVersion packageVersion, PackageSourceLocation packageSourceLocation, Boolean includePreview) in dotnet.dll:token 0x6000a14+0x2ae --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) in System.Private.CoreLib.dll:token 0x6002c8a+0x11 at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) in System.Private.CoreLib.dll:token 0x6002b9e+0x2b at System.Threading.Tasks.Task1.get_Result() in System.Private.CoreLib.dll:token 0x6002b9c+0x8 at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.<>cDisplayClass14_0.b0() in dotnet.dll:token 0x6000b0e+0x41 at Microsoft.DotNet.Cli.TransactionalAction.<>cDisplayClass2_0.b0() in dotnet.dll:token 0x6000cef+0x0 at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func1 action, Action commit, Action rollback) in dotnet.dll:token 0x6000922+0x35 at Microsoft.DotNet.Cli.TransactionalAction.Run(Action action, Action commit, Action rollback) in dotnet.dll:token 0x6000923+0x19 at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.InstallWorkloadPack(PackInfo packInfo, SdkFeatureBand sdkFeatureBand, Boolean useOfflineCache) in dotnet.dll:token 0x60001bc+0x7e at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>c__DisplayClass14_1.<InstallWorkloadsWithInstallRecord>b__2() in dotnet.dll:token 0x6000b1f+0x15 at Microsoft.DotNet.Cli.TransactionalAction.<>c__DisplayClass2_0.<Run>b__0() in dotnet.dll:token 0x6000cef+0x0 at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func1 action, Action commit, Action rollback) in dotnet.dll:token 0x6000922+0x35 at Microsoft.DotNet.Cli.TransactionalAction.Run(Action action, Action commit, Action rollback) in dotnet.dll:token 0x6000923+0x19 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloadsWithInstallRecord(IEnumerable1 workloadIds, SdkFeatureBand sdkFeatureBand) in dotnet.dll:token 0x60001cf+0xb5 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloads(IEnumerable1 workloadIds, Boolean skipManifestUpdate) in dotnet.dll:token 0x60001ce+0x58 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.Execute() in dotnet.dll:token 0x60001cb+0x216 at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args) in dotnet.dll:token 0x60008af+0x5e at Microsoft.DotNet.Workloads.Workload.WorkloadCommand.Run(String[] args) in dotnet.dll:token 0x6000145+0x6 at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in dotnet.dll:token 0x6000918+0x2e8 at Microsoft.DotNet.Cli.Program.Main(String[] args) in dotnet.dll:token 0x6000916+0x6f

sfoslund commented 3 years ago

Did you install to an admin location? And if so, are you running the command with sudo?

ar0311 commented 3 years ago

I installed normally using the x64.dmg download from Microsoft. It asks via a prompt (as does every SDK install) for permissions to install as im installing as a normal user.

I am not running the command with sudo.

sfoslund commented 3 years ago

What happens when you run with sudo? Based on the error message it sounds like the SDK was installed to an elevated location, meaning you'll have to elevate to run the workload install command. Alternatively, if you don't have permission to elevate, you can install a local copy of the SDK to a non-elevated location and install the workload to that SDK.

ar0311 commented 3 years ago

OK, when I try to install using sudo it appears to succeed:

...... [NuGet Manager] [Info] GET https://api.nuget.org/v3-flatcontainer/microsoft.net.runtime.emscripten.2.0.12.node.osx-x64/6.0.0-preview.4.21220.1/microsoft.net.runtime.emscripten.2.0.12.node.osx-x64.6.0.0-preview.4.21220.1.nupkg [NuGet Manager] [Info] OK https://api.nuget.org/v3-flatcontainer/microsoft.net.runtime.emscripten.2.0.12.node.osx-x64/6.0.0-preview.4.21220.1/microsoft.net.runtime.emscripten.2.0.12.node.osx-x64.6.0.0-preview.4.21220.1.nupkg 99ms Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node version 6.0.0-preview.4.21220.1... Installing pack Microsoft.NET.Runtime.Emscripten.Python version 6.0.0-preview.4.21220.1... Pack Microsoft.NET.Runtime.Emscripten.Python version 6.0.0-preview.4.21220.1 is already installed. Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Python version 6.0.0-preview.4.21220.1... Installing pack Microsoft.NET.Runtime.Emscripten.Sdk version 6.0.0-preview.4.21220.1... Pack Microsoft.NET.Runtime.Emscripten.Sdk version 6.0.0-preview.4.21220.1 is already installed. Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk version 6.0.0-preview.4.21220.1... Garbage collecting for SDK feature bands 6.0.100...

Successfully installed workload(s) microsoft-net-sdk-blazorwebassembly-aot.

But then if I try to perform dotnet publish -c Release on a project:

Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink AOT'ing 30 assemblies /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : Precompiling failed for /Users/adam/Repos/blazorwasm60/obj/Release/net6.0/linked/Microsoft.AspNetCore.Components.dll: Permission denied [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj]

So, I try using sudo dotnet publish -c Release

Determining projects to restore... All projects are up-to-date for restore. You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview blazorwasm60 -> /Users/adam/Repos/blazorwasm60/bin/Release/net6.0/blazorwasm60.dll blazorwasm60 (Blazor output) -> /Users/adam/Repos/blazorwasm60/bin/Release/net6.0/wwwroot Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink AOT'ing 30 assemblies /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : dyld: lazy symbol binding failed: Symbol not found: chkstk_darwin [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : Referenced from: /usr/local/share/dotnet/packs/microsoft.netcore.app.runtime.aot.osx-x64.cross.browser-wasm/6.0.0-preview.4.21253.7/Sdk/../tools/mono-aot-cross (which was built for Mac OS X 10.15) [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : Expected in: /usr/lib/libSystem.B.dylib [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : dyld: Symbol not found: ____chkstk_darwin [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : Referenced from: /usr/local/share/dotnet/packs/microsoft.netcore.app.runtime.aot.osx-x64.cross.browser-wasm/6.0.0-preview.4.21253.7/Sdk/../tools/mono-aot-cross (which was built for Mac OS X 10.15) [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : Expected in: /usr/lib/libSystem.B.dylib [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): warning : [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : Precompiling failed for /Users/adam/Repos/blazorwasm60/obj/Release/net6.0/linked/Microsoft.AspNetCore.Components.dll: Error: dyld: lazy symbol binding failed: Symbol not found: chkstk_darwin [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : Referenced from: /usr/local/share/dotnet/packs/microsoft.netcore.app.runtime.aot.osx-x64.cross.browser-wasm/6.0.0-preview.4.21253.7/Sdk/../tools/mono-aot-cross (which was built for Mac OS X 10.15) [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : Expected in: /usr/lib/libSystem.B.dylib [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : dyld: Symbol not found: ____chkstk_darwin [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : Referenced from: /usr/local/share/dotnet/packs/microsoft.netcore.app.runtime.aot.osx-x64.cross.browser-wasm/6.0.0-preview.4.21253.7/Sdk/../tools/mono-aot-cross (which was built for Mac OS X 10.15) [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : Expected in: /usr/lib/libSystem.B.dylib [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj]

sfoslund commented 3 years ago

@captainsafia @pranavkm this looks like a blazor compilation issue

mkArtakMSFT commented 3 years ago

@radical FYI

radical commented 3 years ago

@ar0311 The first issue I see is:

Precompiling failed for /Users/adam/Repos/blazorwasm60/obj/Release/net6.0/linked/Microsoft.AspNetCore.Components.dll: Permission denied

ar0311 commented 3 years ago

Adams-MacBook-Pro:blazorwasm60 adam$ find /Users/adam/Repos/blazorwasm60/ -user root Adams-MacBook-Pro:blazorwasm60 adam$ rm -rf bin Adams-MacBook-Pro:blazorwasm60 adam$ rm -rf obj Adams-MacBook-Pro:blazorwasm60 adam$ dotnet publish -c Release -bl Microsoft (R) Build Engine version 16.11.0-preview-21254-21+e73d08c28 for .NET Copyright (C) Microsoft Corporation. All rights reserved.

/usr/local/share/dotnet/sdk/6.0.100-preview.4.21255.9/MSBuild.dll -bl -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/local/share/dotnet/sdk/6.0.100-preview.4.21255.9/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/local/share/dotnet/sdk/6.0.100-preview.4.21255.9/dotnet.dll -maxcpucount -property:Configuration=Release -restore -target:Publish -verbosity:m ./blazorwasm60.csproj Determining projects to restore... Restored /Users/adam/Repos/blazorwasm60/blazorwasm60.csproj (in 475 ms). You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview blazorwasm60 -> /Users/adam/Repos/blazorwasm60/bin/Release/net6.0/blazorwasm60.dll blazorwasm60 (Blazor output) -> /Users/adam/Repos/blazorwasm60/bin/Release/net6.0/wwwroot Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink AOT'ing 30 assemblies /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.4.21253.7/Sdk/WasmApp.targets(137,5): error : Precompiling failed for /Users/adam/Repos/blazorwasm60/obj/Release/net6.0/linked/Microsoft.AspNetCore.Components.dll: Permission denied [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj] Adams-MacBook-Pro:blazorwasm60 adam$

msbuild.binlog.zip

ghost commented 3 years ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details
### Describe the bug When trying to install AOT workload per preview 4 blog post (on MacOS) the following is returned: System.Exception: Workload not found at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.GetPacksInWorkload(String workloadId) in Microsoft.DotNet.TemplateLocator.dll:token 0x6000069+0x3a at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>c__DisplayClass14_0.b__0(WorkloadId workloadId) in dotnet.dll:token 0x6000b1c+0x0 at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext() in System.Linq.dll:token 0x6000219+0x51 at System.Linq.Enumerable.DistinctIterator`1.MoveNext() in System.Linq.dll:token 0x6000177+0x28 at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() in System.Linq.dll:token 0x60001c1+0x29 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>c__DisplayClass14_1.b__3() in dotnet.dll:token 0x6000b20+0x2c at Microsoft.DotNet.Cli.TransactionalAction.EnlistmentNotification.Rollback(Enlistment enlistment) in dotnet.dll:token 0x6000ced+0x8 at System.Transactions.VolatileEnlistmentAborting.EnterState(InternalEnlistment enlistment) in System.Transactions.Local.dll:token 0x6000404+0x0 at System.Transactions.VolatileEnlistmentActive.InternalAborted(InternalEnlistment enlistment) in System.Transactions.Local.dll:token 0x60003e9+0x0 at System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx) in System.Transactions.Local.dll:token 0x6000259+0x4c at System.Transactions.TransactionStateActive.Rollback(InternalTransaction tx, Exception e) in System.Transactions.Local.dll:token 0x6000224+0x8 at System.Transactions.Transaction.Rollback() in System.Transactions.Local.dll:token 0x600010b+0x4b at System.Transactions.TransactionScope.InternalDispose() in System.Transactions.Local.dll:token 0x600019c+0x95 at System.Transactions.TransactionScope.Dispose() in System.Transactions.Local.dll:token 0x600019b+0x34b at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback) in dotnet.dll:token 0x6000922+0x47 at Microsoft.DotNet.Cli.TransactionalAction.Run(Action action, Action commit, Action rollback) in dotnet.dll:token 0x6000923+0x19 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloadsWithInstallRecord(IEnumerable`1 workloadIds, SdkFeatureBand sdkFeatureBand) in dotnet.dll:token 0x60001cf+0xb5 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloads(IEnumerable`1 workloadIds, Boolean skipManifestUpdate) in dotnet.dll:token 0x60001ce+0x58 at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.Execute() in dotnet.dll:token 0x60001cb+0x216 at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args) in dotnet.dll:token 0x60008af+0x5e at Microsoft.DotNet.Workloads.Workload.WorkloadCommand.Run(String[] args) in dotnet.dll:token 0x6000145+0x6 at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in dotnet.dll:token 0x6000918+0x2e8 at Microsoft.DotNet.Cli.Program.Main(String[] args) in dotnet.dll:token 0x6000916+0x6f ### To Reproduce dotnet workload install microsoft-net-sdk-blazorwebassembly-aot ### Exceptions (if any) See above. ### Further technical details - ASP.NET Core version 6.0.100-preview.4 - Include the output of `dotnet --info` - The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: MacOS 10.13.6, cmd line
Author: ar0311
Assignees: radical
Labels: `arch-wasm`, `area-System.Transactions`, `untriaged`
Milestone: 6.0.0
ar0311 commented 3 years ago

Have tried entirely removing /usr/local/share/dotnet directory, and re-installing 6.0preview5

Then installed AOT workload using sudo

Attempted to dotnet publish -c Release a fresh new blazorwasm type project

AOT'ing 30 assemblies /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-preview.5.21301.5/Sdk/WasmApp.targets(145,5): error : Precompiling failed for /Users/adam/Repos/blazorwasm60/obj/Release/net6.0/linked/Microsoft.AspNetCore.Components.dll: Permission denied [/Users/adam/Repos/blazorwasm60/blazorwasm60.csproj]

lewing commented 3 years ago

mono-aot-cross (among others) isn't installed by nuget with the correct permissions in /user/local/share/dotnet (it needs to be executable by the user). This is fixed in preview7.