Skip to content

Commit

Permalink
Fix "[wasm] Fix "we can't find snapshot urls"" (dotnet#99945)
Browse files Browse the repository at this point in the history
* Revert "[wasm] Fix "we can't find snapshot urls" (dotnet#99814)"

This reverts commit 55273a1.

* Fix.
  • Loading branch information
ilonatommy authored Mar 19, 2024
1 parent c352ef6 commit 41d08f9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/tasks/WasmBuildTasks/UpdateChromeVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ private async Task<Stream> GetDownloadFileStreamAsync(string filename, string ur

private async Task<string?> FindSnapshotUrlFromBasePositionAsync(string osPrefix, ChromeVersionSpec version, bool throwIfNotFound = true)
{
string baseUrl = $"{s_snapshotBaseUrl}?prefix={osPrefix}";
string baseUrlForRevision = $"{s_snapshotBaseUrl}?prefix={osPrefix}";

int branchPosition = int.Parse(version.branch_base_position);
for (int i = 0; i < MaxBranchPositionsToCheck; i++)
{
string branchUrl = $"{baseUrl}/{branchPosition}";
string branchUrl = $"{baseUrlForRevision}/{branchPosition}";
string url = $"{branchUrl}/REVISIONS";

Log.LogMessage(MessageImportance.Low, $"Checking if {url} exists ..");
Expand All @@ -285,14 +285,16 @@ private async Task<Stream> GetDownloadFileStreamAsync(string filename, string ur
.ConfigureAwait(false);
if (response.StatusCode == HttpStatusCode.OK)
{
Log.LogMessage(MessageImportance.Low, $"Found {url}");
return branchUrl;
string baseUrlForDownload = $"{s_snapshotBaseUrl}/{osPrefix}";
string snapshotUrl = $"{baseUrlForDownload}/{branchPosition}";
Log.LogMessage(MessageImportance.Low, $"Found {url}. Snapshots should be under ${snapshotUrl}");
return snapshotUrl;
}

branchPosition += 1;
}

string message = $"Could not find a chrome snapshot folder under {baseUrl}, " +
string message = $"Could not find a chrome snapshot folder under {baseUrlForRevision}, " +
$"for branch positions {version.branch_base_position} to " +
$"{branchPosition}, for version {version.version}. " +
"A fixed version+url can be set in eng/testing/ProvisioningVersions.props .";
Expand Down

0 comments on commit 41d08f9

Please sign in to comment.