dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.66k stars 1.06k forks source link

SDK 8.0.401: `dotnet workload install wasm-tools ` does not install correctly #42919

Open JCKortlang opened 3 weeks ago

JCKortlang commented 3 weeks ago

Describe the bug

dotnet workload install wasm-tools supposedly succeeds but there is a warning indicating a failure. The tool is listed as installed but attempting to compile a wasm project fails

sudo dotnet workload install wasm-tools

Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.401

Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.osx-x64 version 8.0.8...
Warning: Workload garbage collection failed with error: Workload version 8.0.401-baseline.24412.2 was not found..
dotnet workload list

Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
wasm-tools                 8.0.8/8.0.100         SDK 8.0.400
sudo dotnet workload uninstall wasm-tools

Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.401

Removing workload installation record for wasm-tools...
Workload uninstallation failed: Workload version 8.0.401-baseline.24412.2 was not found.

To Reproduce

  1. On OSX 13.6.9 (22G830)
  2. Download / Install .NET 8.0.401 SDK -- https://dotnet.microsoft.com/en-us/download/dotnet/8.0
  3. Run, sudo dotnet workload install wasm-tools
  4. Attempt to compile a wasm project that depends on wasm-tools.

Exceptions (if any)

Warning: Workload garbage collection failed with error: Workload version 8.0.401-baseline.24412.2 was not found
Workload uninstallation failed: Workload version 8.0.401-baseline.24412.2 was not found
/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.8/Sdk/WasmApp.Native.targets(366,5): error :   File "/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.osx-x64/8.0.8/tools/emscripten/tools/cache.py", line 151, in get [redacted.csproj]
/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.8/Sdk/WasmApp.Native.targets(366,5): error :     raise Exception(f'FROZEN_CACHE is set, but cache file is missing: "{shortname}" (in cache root path "{cachedir}")') [redacted.csproj]
/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.8/Sdk/WasmApp.Native.targets(366,5): error : Exception: FROZEN_CACHE is set, but cache file is missing: "sysroot_install.stamp" 

Further technical details

Mitigation

  1. Rollback SDK version (I rolled back to 8.0.1)
  2. Run sudo dotnet workload clean
  3. Reinstall wasm-tools via sudo dotnet workload install wasm-tools
davishoang96 commented 2 weeks ago

Confirmed. Can't build blazor wasm project after install wasm-tools.

Robbware commented 2 weeks ago

Just ran into this issue too.

borag commented 2 weeks ago

I have the same, macOS.

rbev commented 2 weeks ago

confirmed, but i don't think it's related to wasm-tools

==> Downloading https://download.visualstudio.microsoft.com/download/pr/1764cd94-29ac-46b2-b308-77d02b47486d/8397cdc3d842a60f062f1a08199a4974/dotnet-sdk-8.0.401-osx-arm64.pkg Already downloaded: /Users/rhysbevilaqua/Library/Caches/Homebrew/downloads/35166c11939a7f64ea8a5edc012c5684672ddfa3e45de43e00e828e9ff9a6920--dotnet-sdk-8.0.401-osx-arm64.pkg ==> Installing Cask dotnet-sdk8-0-400 ==> Running installer for dotnet-sdk8-0-400 with sudo; the password may be necessary. Password: installer: Package name is Microsoft .NET SDK 8.0.401 (arm64) installer: Upgrading at base path / installer: The upgrade was successful. 🍺 dotnet-sdk8-0-400 was successfully installed! ==> Installing Cask dotnet-sdk8 🍺 dotnet-sdk8 was successfully installed! ==> Caveats ==> dotnet-sdk8-0-400 Uninstalling the offical dotnet-sdk casks will remove the shared runtime dependencies, so you'll need to reinstall the particular version cask you want from this tap again for the dotnet command to work again.


* run `sudo dotnet workload clean`

**Output:**

Unhandled exception: System.IO.FileNotFoundException: Workload version 8.0.401-baseline.24412.2 was not found. at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.RefreshWorkloadManifests() at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider..ctor(String sdkRootPath, String sdkVersion, Func2 getEnvironmentVariable, String userProfileDir, String globalJsonPath, String workloadSetVersion) at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.ForWorkloadSet(String sdkRootPath, String sdkVersion, String userProfileDir, String workloadSetVersion) at Microsoft.DotNet.Workloads.Workload.Install.WorkloadResolverFactory.CreateForWorkloadSet(String dotnetPath, String sdkVersion, String userProfileDir, String workloadSetVersion) at Microsoft.DotNet.Workloads.Workload.Install.WorkloadGarbageCollector.GarbageCollectWorkloadManifestsAndPacks() at Microsoft.DotNet.Workloads.Workload.Install.FileBasedInstaller.GarbageCollect(Func2 getResolverForWorkloadSet, Nullable`1 offlineCache, Boolean cleanAllPacks) at Microsoft.DotNet.Workloads.Workload.Clean.WorkloadCleanCommand.ExecuteGarbageCollection() at Microsoft.DotNet.Cli.WorkloadCleanCommandParser.<>c.b__3_0(ParseResult parseResult) at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

seanlin816 commented 1 week ago

having the same issue too. on macOs

marcpopMSFT commented 1 week ago

@lewing is there an issue with the wasm workload in 8.0.8? For all others, those warnings in the CLI will go away in 8.0.403 and they should not impact the behavior of install (other than it looks like clean is impacted)

/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.8/Sdk/WasmApp.Native.targets(366,5): error :   File "/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.osx-x64/8.0.8/tools/emscripten/tools/cache.py", line 151, in get [redacted.csproj]
/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.8/Sdk/WasmApp.Native.targets(366,5): error :     raise Exception(f'FROZEN_CACHE is set, but cache file is missing: "{shortname}" (in cache root path "{cachedir}")') [redacted.csproj]
/usr/local/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.8/Sdk/WasmApp.Native.targets(366,5): error : Exception: FROZEN_CACHE is set, but cache file is missing: "sysroot_install.stamp" 
esrahat commented 1 week ago

I fixed the problem by downloading .net 9 preview version of the .net sdk , uninstalled the 8.0.402 version and installed the new one.