Aldaviva / RaspberryPiDotnetRepository

🥧 APT repo of .NET runtime and SDK binary ARM DEB packages for Raspberry Pi OS
Apache License 2.0
2 stars 0 forks source link

Automatically update workloads on SDK installation to avoid warning message #17

Open Aldaviva opened 2 weeks ago

Aldaviva commented 2 weeks ago
  1. Install a package like dotnet-sdk-8.0 version 8.0.401-0 from this repo. This happens both on initial installation and recurs on each minor/patch upgrade.
  2. Run a dotnet command like dotnet build in a project directory
ben@pi3:~/HelloWorld $ dotnet build

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

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux

----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
An issue was encountered verifying workloads. For more information, run "dotnet workload update".
  Determining projects to restore...
  Restored /home/ben/HelloWorld/HelloWorld.csproj (in 951 ms).
  HelloWorld -> /home/ben/HelloWorld/bin/Debug/net8.0/HelloWorld.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:29.61

This does not break the build, and only really matters if you're trying to build a .NET app for Android, iOS, or Mac OS. Normal CLI programs build fine without this.

Note that the dotnet workload update command requires an Internet connection and superuser permissions to run.

Maybe dotnet workload update could be added to a post-installation script in the SDK .deb files?

Aldaviva commented 2 weeks ago

Trying to actually update the zero workloads I have installed results in the following failure:

Warning: Workload garbage collection failed with error: Workload version 8.0.401-baseline.24412.2 was not found..
$ sudo dotnet workload update --from-previous-sdk

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

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux

----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------

Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Updated advertising manifest microsoft.net.sdk.android.
Updated advertising manifest microsoft.net.workload.emscripten.net6.
Updated advertising manifest microsoft.net.sdk.maui.
Updated advertising manifest microsoft.net.workload.mono.toolchain.current.
Updated advertising manifest microsoft.net.sdk.ios.
Updated advertising manifest microsoft.net.sdk.macos.
Updated advertising manifest microsoft.net.workload.emscripten.current.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net7.
Updated advertising manifest microsoft.net.sdk.aspire.
Updated advertising manifest microsoft.net.sdk.tvos.
Updated advertising manifest microsoft.net.sdk.maccatalyst.
Updated advertising manifest microsoft.net.workload.emscripten.net7.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net6.
No workloads installed for this feature band. To update workloads installed with earlier SDK versions, include the --from-previous-sdk option.
Warning: Workload garbage collection failed with error: Workload version 8.0.401-baseline.24412.2 was not found..

Successfully updated workload(s): .

The same result is output if the --from-previous-sdk argument is passed.

Aldaviva commented 6 days ago

Related: the manifests leave files behind after the SDK package is uninstalled.

Removing dotnet-sdk-8.0 (8.0.401-0) ...
dpkg: warning: while removing dotnet-sdk-8.0, directory '/usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui' not empty so not removed
dpkg: warning: while removing dotnet-sdk-8.0, directory '/usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.aspire' not empty so not removed
dpkg: warning: while removing dotnet-sdk-8.0, directory '/usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.macos' not empty so not removed
dpkg: warning: while removing dotnet-sdk-8.0, directory '/usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.ios' not empty so not removed
dpkg: warning: while removing dotnet-sdk-8.0, directory '/usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maccatalyst' not empty so not removed
dpkg: warning: while removing dotnet-sdk-8.0, directory '/usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.tvos' not empty so not removed
dpkg: warning: while removing dotnet-sdk-8.0, directory '/usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.android' not empty so not removed