Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure finalizer only runs when no matching SDK feature bands are installed #14836

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

joeloff
Copy link
Member

@joeloff joeloff commented Oct 27, 2022

Description

When a user updates an SDK after installing a workload, the workload is expected to remain installed.

Repro Steps

  1. Install the 6.0.400 SDK
  2. Install an optional workload, e.g., dotnet workload install wasm-tools
  3. Install the 6.0.401 SDK
  4. Execute dotnet workload list

Expected: wasm-tools should be listed as installed
Actual: No installed workloads are reported.

Fix

The finalizer in the SDK bundle is used to remove optional workloads installed through the CLI when the SDK is removed. When an SDK bundle is upgraded, the new SDK is installed before the previous bundle is removed. No properties are available to distinguish between an uninstall and an uninstall due to a major upgrade and the finalizer ends up removing workloads.

The package chain in the bundle is executed in reverse order when it is uninstalled. During an install, the finalizer will be first in the chain, but skipped due to its install condition. When the bundle is removed, the old SDK toolset MSI is removedbefore the finalizer runs. This allows the finalizer to detect the absence of matching SDK feature bands and remove any remaining workloads.

During an upgrade, the new SDK toolset MSI is present then the finalizer executes, allowing it to detect the presence of an SDK with a feature band matching the SDK being removed. In this case the finalizer will terminate and leave the previously installed workloads installed.

Testing

Manual testing required since we need a build with the fix and another build of the SDK bundle that can be upgraded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants