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

Disable baseline manifest generation #43797

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/Installer/redist-installer/targets/BundledManifests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,22 @@
<Copy SourceFiles="@(ManifestContent)"
DestinationFolder="$(RedistLayoutPath)sdk-manifests/%(DestinationPath)" />

</Target>

<PropertyGroup>
<!-- NOTE: When setting this to true, we need to also add logic to include it in the exe installation bundle, either via a new MSI or by including it in an existing one. -->
<GenerateBaselineWorkloadSet>false</GenerateBaselineWorkloadSet>
</PropertyGroup>

<Target Name="LayoutBaselineWorkloadSet" DependsOnTargets="LayoutManifests" Condition="'$(GenerateBaselineWorkloadSet)' == 'true'">

<PropertyGroup>
<WorkloadSetVersion Condition="'$(DotNetFinalVersionKind)' == 'release'">$(VersionPrefix)-baseline$(_BuildNumberLabels)</WorkloadSetVersion>
<WorkloadSetVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">$(Version)</WorkloadSetVersion>
<WorkloadSetFeatureBand>$(VersionPrefix.Substring(0, $([MSBuild]::Subtract($(VersionPrefix.Length), 2))))00$([System.Text.RegularExpressions.Regex]::Match($(WorkloadSetVersion), `-[A-z]*[\.]*\d*`))</WorkloadSetFeatureBand>
<RealFormattedManifestPaths>$(RedistLayoutPath)sdk-manifests\$(WorkloadSetFeatureBand)\workloadsets\$(WorkloadSetVersion)</RealFormattedManifestPaths>
</PropertyGroup>

<ItemGroup>
</ItemGroup>

<ItemGroup>
<FormattedBaselineManifest Include="{" />
<FormattedBaselineManifest Include="&quot;%(BundledManifests.Identity)&quot;: &quot;%(BundledManifests.Version)/%(BundledManifests.FeatureBand)&quot;," />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@
LayoutRuntimeGraph;
LayoutTemplates;
LayoutManifests;
LayoutBaselineWorkloadSet;
LayoutWorkloadUserLocalMarker;
LayoutBundledTools;
RetargetTools;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,31 @@ Dictionary<string, WorkloadSet> GetAvailableWorkloadSetsInternal(SdkFeatureBand?

static void AddWorkloadSetsForFeatureBand(Dictionary<string, WorkloadSet> availableWorkloadSets, string featureBandDirectory)
{
var featureBand = new SdkFeatureBand(Path.GetFileName(featureBandDirectory));
var featureBandDirectoryName = Path.GetFileName(featureBandDirectory);
var featureBand = new SdkFeatureBand(featureBandDirectoryName);
if (!featureBandDirectoryName.Equals(featureBand.ToString()))
{
// A folder which should be a feature band parses as something that doesn't match the feature band. For example,
// a folder named 9.0.100-rtm.24476 would parse as feature band 9.0.100. When we try to look up the workload set
// later, we would look for it in a 9.0.100 folder, and wouldn't find it. So we will ignore these incorrect folders
return;
}

var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName);
if (Directory.Exists(workloadSetsRoot))
{
foreach (var workloadSetDirectory in Directory.GetDirectories(workloadSetsRoot))
{
var workloadSetVersion = Path.GetFileName(workloadSetDirectory);
var workloadSet = WorkloadSet.FromWorkloadSetFolder(workloadSetDirectory, workloadSetVersion, featureBand);

if (!WorkloadSet.GetWorkloadSetFeatureBand(workloadSet.Version!).Equals(featureBand))
{
// We have a workload set version where the feature band doesn't match the feature band folder that it's in.
// Skip it, as if we try to actually load it via the workload set version, we'll fail
continue;
}

availableWorkloadSets[workloadSet.Version!] = workloadSet;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,11 @@ public static string WorkloadSetVersionToWorkloadSetPackageVersion(string setVer

return packageVersion;
}

public static SdkFeatureBand GetWorkloadSetFeatureBand(string setVersion)
{
WorkloadSetVersionToWorkloadSetPackageVersion(setVersion, out SdkFeatureBand sdkFeatureBand);
return sdkFeatureBand;
}
}
}
Loading