Skip to content

Commit 4214861

Browse files
authored
Find baseline workload set in 8.0.100 folder (#42435)
Summary This effectively contains one commit that went into main previously but never made it into 8.0.4xx despite needing it. This was missed for multiple reasons: The commit is already in main/9.0-previews, and the change that led to the user-visible issue was only merged in 8.0.4xx, which limits its impact. It does not reproduce until sdk and installer are put together, which means it wasn't even testable with the 8.0.4xx SDK unless it was inserted into the installer repo. It does not reproduce with MSI-based installs, as their layout is different. Fixes #42357 and #42358 Customer Impact The impact of the bug is that any operation involving workload garbage collection will fail. More specifically, all workload sets are always considered 'workload sets to keep,' including the baseline workload set, during garbage collection. That baseline workload set is not in the correct folder, however, which means that although we can 'discover' it when we do an initial 'find all workload sets' step, when we move to resolve it, we can't find it. This then throws an exception. This PR enables us to find it. Though a workaround, this should work for 8.0.4xx in the long term; main has both this workaround and a better long-term fix. Regression? This is a fix for a regression in 8.0.4xx. Testing I built this change, overlaid it on an SDK with the baseline workload set, verified that that workload set was discovered during garbage collection and resolved as intended, and verified that the remainder of the operation completed successfully. Risk The risk of this fix is low. It permits a code path that otherwise was not otherwise available.
1 parent df50690 commit 4214861

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public void RefreshWorkloadManifests()
123123
_installStateFilePath = null;
124124
_useManifestsFromInstallState = true;
125125
var availableWorkloadSets = GetAvailableWorkloadSets(_sdkVersionBand);
126+
var workloadSets80100 = GetAvailableWorkloadSets(new SdkFeatureBand("8.0.100"));
126127

127128
bool TryGetWorkloadSet(string workloadSetVersion, out WorkloadSet? workloadSet)
128129
{
@@ -142,6 +143,13 @@ bool TryGetWorkloadSet(string workloadSetVersion, out WorkloadSet? workloadSet)
142143
}
143144
}
144145

146+
// The baseline workload sets were merged with a fixed 8.0.100 feature band. That means they will always be here
147+
// regardless of where they would otherwise belong. This is a workaround for that.
148+
if (workloadSets80100.TryGetValue(workloadSetVersion, out workloadSet))
149+
{
150+
return true;
151+
}
152+
145153
workloadSet = null;
146154
return false;
147155
}

0 commit comments

Comments
 (0)