Skip to content

Commit fce6642

Browse files
authored
[CI] Do not install mingw for APK instrumentation (#5583)
On CI the `APK instrumentation - MacOS` job is often failing with: Error: Installation of mingw-w64 failed The `mingw-w64` should not be needed for that job, so add a new option for `xaprepare` to diable that installation.
1 parent aad2c29 commit fce6642

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ stages:
288288
parameters:
289289
configuration: $(ApkTestConfiguration)
290290

291-
- script: mono $(System.DefaultWorkingDirectory)/build-tools/xaprepare/xaprepare/bin/$(ApkTestConfiguration)/xaprepare.exe --s=Required --auto-provision=yes --auto-provision-uses-sudo=yes --no-emoji --run-mode=CI
291+
- script: mono $(System.DefaultWorkingDirectory)/build-tools/xaprepare/xaprepare/bin/$(ApkTestConfiguration)/xaprepare.exe --s=Required --auto-provision=yes --auto-provision-uses-sudo=yes --no-emoji --no-mingw-w64 --run-mode=CI
292292
displayName: install required brew tools and prepare java.interop
293293

294294
- script: mono $(System.DefaultWorkingDirectory)/build-tools/xaprepare/xaprepare/bin/$(ApkTestConfiguration)/xaprepare.exe --s=EmulatorTestDependencies --no-emoji --run-mode=CI

build-tools/xaprepare/xaprepare/Application/Context.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,11 @@ public bool IsRunningOnHostedAzureAgent {
358358
}
359359
}
360360

361+
/// <summary>
362+
/// Do not install mingw-w64 with brew on MacOS, default false
363+
/// </summary>
364+
public bool NoMingwW64 { get; set; } = false;
365+
361366
static Context ()
362367
{
363368
Instance = new Context ();

build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/MacOS.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ partial class MacOS
1616

1717
new HomebrewProgram ("make"),
1818

19-
new HomebrewProgram ("mingw-w64") {
20-
MinimumVersion = "7.0.0_2",
21-
MaximumVersion = "7.0.0_3",
22-
Pin = true,
23-
},
24-
2519
new HomebrewProgram ("ninja"),
2620
new HomebrewProgram ("p7zip", "7za"),
2721

@@ -31,9 +25,17 @@ partial class MacOS
3125
},
3226
};
3327

28+
static readonly HomebrewProgram mingw = new HomebrewProgram ("mingw-w64") {
29+
MinimumVersion = "7.0.0_2",
30+
MaximumVersion = "7.0.0_3",
31+
Pin = true,
32+
};
33+
3434
protected override void InitializeDependencies ()
3535
{
3636
Dependencies.AddRange (programs);
37+
if (!Context.Instance.NoMingwW64)
38+
Dependencies.Add (mingw);
3739
}
3840
}
3941
}

build-tools/xaprepare/xaprepare/Main.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ sealed class ParsedOptions
1515
public bool ShowHelp { get; set; } = false;
1616
public bool DumpProps { get; set; } = false;
1717
public bool NoEmoji { get; set; } = !Configurables.Defaults.UseEmoji;
18+
public bool NoMingwW64 { get; set; } = false;
1819
public bool ForceRuntimesBuild { get; set; } = false;
1920
public string? HashAlgorithm { get; set; }
2021
public uint MakeConcurrency { get; set; } = 0;
@@ -89,6 +90,7 @@ static async Task<int> Run (string[] args)
8990
{"d|dump-properties", "Dump values of all the defined properties to the screen", v => parsedOptions.DumpProps = true },
9091
{"j|make-concurrency=", "Number of concurrent jobs for make to run. A positive integer or 0 for the default. Defaults to the number of CPUs/cores", v => parsedOptions.MakeConcurrency = EnsureUInt (v, "Invalid Make concurrency value") },
9192
{"no-emoji", "Do not use any emoji characters in the output", v => parsedOptions.NoEmoji = true },
93+
{"no-mingw-w64", "Do not install mingw-w64 compiler", v => parsedOptions.NoMingwW64 = true },
9294
{"r|run-mode=", $"Specify the execution mode: {GetExecutionModes()}. See documentation for mode descriptions. Default: {Configurables.Defaults.ExecutionMode}", v => parsedOptions.ExecutionMode = ParseExecutionMode (v)},
9395
{"f|build-runtimes", $"Build runtimes even if the bundle/archives are available.", v => parsedOptions.ForceRuntimesBuild = true },
9496
{"H|hash-algorithm=", "Use the specified hash algorithm instead of the default {Configurables.Defaults.HashAlgorithm}", v => parsedOptions.HashAlgorithm = v?.Trim () },
@@ -130,6 +132,7 @@ static async Task<int> Run (string[] args)
130132

131133
Context.Instance.MakeConcurrency = parsedOptions.MakeConcurrency;
132134
Context.Instance.NoEmoji = parsedOptions.NoEmoji;
135+
Context.Instance.NoMingwW64 = parsedOptions.NoMingwW64;
133136
Context.Instance.ExecutionMode = parsedOptions.ExecutionMode;
134137
Context.Instance.ForceRuntimesBuild = parsedOptions.ForceRuntimesBuild;
135138
Context.Instance.LoggingVerbosity = parsedOptions.Verbosity;

0 commit comments

Comments
 (0)