Skip to content
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
29 changes: 27 additions & 2 deletions tracer/build/_build/Build.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,33 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo
var packages = $@"{BuildArtifactsDirectory}\obj\vcpkg\packages";
var buildTrees = $@"{BuildArtifactsDirectory}\obj\vcpkg\buildtrees";

// This big line is the same generated by VS when installing libdatadog while building the profiler
vcpkg($@"install --x-wait-for-lock --triplet ""{triplet}"" --vcpkg-root ""{vcpkgRoot}"" ""--x-manifest-root={RootDirectory}"" ""--x-install-root={installRoot}"" --downloads-root ""{downloads}"" --x-packages-root ""{packages}"" --x-buildtrees-root ""{buildTrees}"" --clean-after-build");
const int maxRetries = 3;

for (int attempt = 1; attempt <= maxRetries; attempt++)
{
try
{
Logger.Information($"Attempt {attempt}: Running vcpkg install for {triplet}...");
// This big line is the same generated by VS when installing libdatadog while building the profiler
vcpkg($@"install --x-wait-for-lock --triplet ""{triplet}"" --vcpkg-root ""{vcpkgRoot}"" ""--x-manifest-root={RootDirectory}"" ""--x-install-root={installRoot}"" --downloads-root ""{downloads}"" --x-packages-root ""{packages}"" --x-buildtrees-root ""{buildTrees}"" --clean-after-build");
Logger.Information($"vcpkg install succeeded on attempt {attempt}.");
break; // Exit loop on success
}
catch (Exception ex)
{
Logger.Warning($"Attempt {attempt} failed: {ex.Message}");

if (attempt == maxRetries)
{
throw;
}

// Exponential backoff before retrying
var delaySeconds = 5 * attempt;
Logger.Information($"Waiting {delaySeconds} seconds before retry...");
await Task.Delay(TimeSpan.FromSeconds(delaySeconds));
}
}
}
}
});
Expand Down
Loading