Skip to content
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
6 changes: 6 additions & 0 deletions build-tools/automation/yaml-templates/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,9 @@ variables:
value: true
- name: DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT
value: true
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: true
- name: DOTNET_NOLOGO
value: true
- name: DOTNET_GENERATE_ASPNET_CERTIFICATE
value: false
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public bool Run ()
if (!exited) {
Log.ErrorLine ($"Process '{FullCommandLine}' timed out after {ProcessTimeout}");
ErrorReason = ErrorReasonCode.ExecutionTimedOut;
process.Kill ();
process.Kill (entireProcessTree: true);
Comment thread
jonathanpeppers marked this conversation as resolved.
}

// See: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.waitforexit?view=netframework-4.7.2#System_Diagnostics_Process_WaitForExit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,34 @@ protected override async Task<bool> Execute (Context context)

// Install runtime packs associated with the SDK previously installed.
var packageDownloadProj = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "build-tools", "xaprepare", "xaprepare", "package-download.proj");
var logPath = Path.Combine (Configurables.Paths.BuildBinDir, $"msbuild-{context.BuildTimeStamp}-download-runtime-packs.binlog");
var restoreArgs = new string [] { "restore",
ProcessRunner.QuoteArgument (packageDownloadProj),
"--configfile", Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "NuGet.config"),
ProcessRunner.QuoteArgument ($"-bl:{logPath}"),
};
if (!Utilities.RunCommand (Configurables.Paths.DotNetPreviewTool, restoreArgs)) {
Log.ErrorLine ($"Failed to restore runtime packs using '{packageDownloadProj}'.");
var logPathBase = Path.Combine (Configurables.Paths.BuildBinDir, $"msbuild-{context.BuildTimeStamp}-download-runtime-packs");

const int maxAttempts = 3;
const int initialBackoffDelayMilliseconds = 2000;
bool restoreSucceeded = false;
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
var logPath = $"{logPathBase}-attempt{attempt}.binlog";
var runner = new ProcessRunner (Configurables.Paths.DotNetPreviewTool, "restore",
packageDownloadProj,
"--configfile", Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "NuGet.config"),
$"-bl:{logPath}",
"--verbosity", "normal"
) {
EchoStandardOutput = true,
EchoStandardError = true,
};
if (runner.Run ()) {
restoreSucceeded = true;
break;
}
if (attempt < maxAttempts) {
Log.WarningLine ($"Failed to restore runtime packs (attempt {attempt}/{maxAttempts}), retrying...");
var delayMilliseconds = initialBackoffDelayMilliseconds * (1 << (attempt - 1));
await Task.Delay (delayMilliseconds);
}
}
if (!restoreSucceeded) {
Log.ErrorLine ($"Failed to restore runtime packs using '{packageDownloadProj}' after {maxAttempts} attempts.");
return false;
}

Expand Down