diff options
author | Rob Mensching <rob@firegiant.com> | 2022-10-06 11:59:31 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2022-10-14 20:13:50 -0700 |
commit | 5567239a9411aac769a34f2c65b80a523a577ad7 (patch) | |
tree | 158d3689253cdf86f7f346672d1178d1742724ce /src/internal/WixBuildTools.TestSupport | |
parent | 8f8999f017c29d1cbe531d0fffbab1174c16596b (diff) | |
download | wix-5567239a9411aac769a34f2c65b80a523a577ad7.tar.gz wix-5567239a9411aac769a34f2c65b80a523a577ad7.tar.bz2 wix-5567239a9411aac769a34f2c65b80a523a577ad7.zip |
Run wix.exe out of proc
"wix build" will load assemblies to read metadata which can cause
the assemblies to get locked in the process. Since MSBuild keeps
build processes alive this can cause work done by in-proc MSBuild
tasks (like the WixBuild) to get stuck. Moving the "wix build" out
of proc avoids any of those issues.
Moving out of proc also allows the WiX tasks to be AnyCPU which
simplifies the wix.targets (although did need to add code to find
the .NET Framework wix.exe).
Fixes 6595
Diffstat (limited to 'src/internal/WixBuildTools.TestSupport')
-rw-r--r-- | src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs b/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs index 32680e5d..3271cc20 100644 --- a/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs +++ b/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs | |||
@@ -17,7 +17,7 @@ namespace WixToolsetTest.Sdk | |||
17 | 17 | ||
18 | public static class MsbuildUtilities | 18 | public static class MsbuildUtilities |
19 | { | 19 | { |
20 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal", bool suppressValidation = true) | 20 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", string verbosityLevel = "normal", bool suppressValidation = true) |
21 | { | 21 | { |
22 | var allArgs = new List<string> | 22 | var allArgs = new List<string> |
23 | { | 23 | { |
@@ -30,11 +30,6 @@ namespace WixToolsetTest.Sdk | |||
30 | $"-bl:{Path.ChangeExtension(projectPath, ".binlog")}" | 30 | $"-bl:{Path.ChangeExtension(projectPath, ".binlog")}" |
31 | }; | 31 | }; |
32 | 32 | ||
33 | if (outOfProc.HasValue) | ||
34 | { | ||
35 | allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); | ||
36 | } | ||
37 | |||
38 | if (arguments != null) | 33 | if (arguments != null) |
39 | { | 34 | { |
40 | allArgs.AddRange(arguments); | 35 | allArgs.AddRange(arguments); |
@@ -96,11 +91,9 @@ namespace WixToolsetTest.Sdk | |||
96 | } | 91 | } |
97 | } | 92 | } |
98 | 93 | ||
99 | public static IEnumerable<string> GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem, bool? outOfProc = null) | 94 | public static IEnumerable<string> GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem) |
100 | { | 95 | { |
101 | var expectedOutOfProc = buildSystem == BuildSystem.DotNetCoreSdk || outOfProc.HasValue && outOfProc.Value; | 96 | var expectedToolExe = buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; |
102 | var expectedToolExe = !expectedOutOfProc ? $"({toolName}.exe)" : | ||
103 | buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; | ||
104 | var expectedToolCommand = $"{expectedToolExe} {operation}"; | 97 | var expectedToolCommand = $"{expectedToolExe} {operation}"; |
105 | return result.Output.Where(line => line.Contains(expectedToolCommand)); | 98 | return result.Output.Where(line => line.Contains(expectedToolCommand)); |
106 | } | 99 | } |