Skip to content
New issue

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

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

Already on GitHub? # to your account

[wasm] InstallWorkloadFromArtifacts: remove unnecessary workaround #86191

Merged
merged 1 commit into from
May 13, 2023
Merged
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
24 changes: 0 additions & 24 deletions src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public override bool Execute()
throw new LogAsErrorException($"Cannot find {nameof(LocalNuGetsPath)}={LocalNuGetsPath} . " +
"Set it to the Shipping packages directory in artifacts.");

ExecuteHackForRenamedManifest();
if (!InstallAllManifests())
return false;

Expand Down Expand Up @@ -177,29 +176,6 @@ private bool ExecuteInternal(InstallWorkloadRequest req)
return !Log.HasLoggedErrors;
}

private void ExecuteHackForRenamedManifest()
{
// HACK - Because the microsoft.net.workload.mono.toolchain is being renamed to microsoft.net.workload.mono.toolchain.current
// but the sdk doesn't have the change yet.
string? txtPath = Directory.EnumerateFiles(Path.Combine(SdkWithNoWorkloadInstalledPath, "sdk"), "IncludedWorkloadManifests.txt",
new EnumerationOptions { RecurseSubdirectories = true, MaxRecursionDepth = 2})
.FirstOrDefault();
if (txtPath is null)
throw new LogAsErrorException($"Could not find IncludedWorkloadManifests.txt in {SdkWithNoWorkloadInstalledPath}");

string stampPath = Path.Combine(Path.GetDirectoryName(txtPath)!, ".stamp");
if (File.Exists(stampPath))
return;

var lines = File.ReadAllLines(txtPath)
.Select(line => line == "microsoft.net.workload.mono.toolchain"
? "microsoft.net.workload.mono.toolchain.current"
: line);
File.WriteAllLines(txtPath, lines);

File.WriteAllText(stampPath, "");
}

private bool InstallAllManifests()
{
var allManifestPkgs = Directory.EnumerateFiles(LocalNuGetsPath, "*Manifest*nupkg");
Expand Down