Skip to content

Commit bcee901

Browse files
committed
C#: Add /nodeReuse:false to autobuild build command
1 parent 41cca47 commit bcee901

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ public void TestDefaultCSharpAutoBuilder()
440440
actions.RunProcess["cmd.exe /C dotnet --info"] = 0;
441441
actions.RunProcess[@"cmd.exe /C dotnet clean C:\Project\test.csproj"] = 0;
442442
actions.RunProcess[@"cmd.exe /C dotnet restore C:\Project\test.csproj"] = 0;
443-
actions.RunProcess[@"cmd.exe /C dotnet build --no-incremental C:\Project\test.csproj"] = 0;
443+
actions.RunProcess[@"cmd.exe /C dotnet build --no-incremental /nodeReuse:false C:\Project\test.csproj"] = 0;
444444
actions.FileExists["csharp.log"] = true;
445445
actions.FileExists[@"C:\Project\test.csproj"] = true;
446446
actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
@@ -468,7 +468,7 @@ public void TestLinuxCSharpAutoBuilder()
468468
actions.RunProcess["dotnet --info"] = 0;
469469
actions.RunProcess[@"dotnet clean C:\Project/test.csproj"] = 0;
470470
actions.RunProcess[@"dotnet restore C:\Project/test.csproj"] = 0;
471-
actions.RunProcess[@"dotnet build --no-incremental C:\Project/test.csproj"] = 0;
471+
actions.RunProcess[@"dotnet build --no-incremental /nodeReuse:false C:\Project/test.csproj"] = 0;
472472
actions.FileExists["csharp.log"] = true;
473473
actions.FileExists[@"C:\Project/test.csproj"] = true;
474474
actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
@@ -907,7 +907,7 @@ public void TestSkipNugetDotnet()
907907
actions.RunProcess["dotnet --info"] = 0;
908908
actions.RunProcess[@"dotnet clean C:\Project/test.csproj"] = 0;
909909
actions.RunProcess[@"dotnet restore C:\Project/test.csproj"] = 0;
910-
actions.RunProcess[@"dotnet build --no-incremental --no-restore C:\Project/test.csproj"] = 0;
910+
actions.RunProcess[@"dotnet build --no-incremental /nodeReuse:false --no-restore C:\Project/test.csproj"] = 0;
911911
actions.FileExists["csharp.log"] = true;
912912
actions.FileExists[@"C:\Project/test.csproj"] = true;
913913
actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
@@ -939,7 +939,7 @@ public void TestDotnetVersionNotInstalled()
939939
actions.RunProcess[@"scratch/.dotnet/dotnet --info"] = 0;
940940
actions.RunProcess[@"scratch/.dotnet/dotnet clean C:\Project/test.csproj"] = 0;
941941
actions.RunProcess[@"scratch/.dotnet/dotnet restore C:\Project/test.csproj"] = 0;
942-
actions.RunProcess[@"scratch/.dotnet/dotnet build --no-incremental C:\Project/test.csproj"] = 0;
942+
actions.RunProcess[@"scratch/.dotnet/dotnet build --no-incremental /nodeReuse:false C:\Project/test.csproj"] = 0;
943943
actions.FileExists["csharp.log"] = true;
944944
actions.FileExists["test.csproj"] = true;
945945
actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
@@ -975,7 +975,7 @@ public void TestDotnetVersionAlreadyInstalled()
975975
actions.RunProcess[@"scratch/.dotnet/dotnet --info"] = 0;
976976
actions.RunProcess[@"scratch/.dotnet/dotnet clean C:\Project/test.csproj"] = 0;
977977
actions.RunProcess[@"scratch/.dotnet/dotnet restore C:\Project/test.csproj"] = 0;
978-
actions.RunProcess[@"scratch/.dotnet/dotnet build --no-incremental C:\Project/test.csproj"] = 0;
978+
actions.RunProcess[@"scratch/.dotnet/dotnet build --no-incremental /nodeReuse:false C:\Project/test.csproj"] = 0;
979979
actions.FileExists["csharp.log"] = true;
980980
actions.FileExists["test.csproj"] = true;
981981
actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
@@ -1008,7 +1008,7 @@ private void TestDotnetVersionWindows(Action action, int commandsRun)
10081008
actions.RunProcess[@"cmd.exe /C scratch\.dotnet\dotnet --info"] = 0;
10091009
actions.RunProcess[@"cmd.exe /C scratch\.dotnet\dotnet clean C:\Project\test.csproj"] = 0;
10101010
actions.RunProcess[@"cmd.exe /C scratch\.dotnet\dotnet restore C:\Project\test.csproj"] = 0;
1011-
actions.RunProcess[@"cmd.exe /C scratch\.dotnet\dotnet build --no-incremental C:\Project\test.csproj"] = 0;
1011+
actions.RunProcess[@"cmd.exe /C scratch\.dotnet\dotnet build --no-incremental /nodeReuse:false C:\Project\test.csproj"] = 0;
10121012
actions.FileExists["csharp.log"] = true;
10131013
actions.FileExists[@"C:\Project\test.csproj"] = true;
10141014
actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";

csharp/autobuilder/Semmle.Autobuild.CSharp/DotNetRule.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ private static BuildScript GetBuildScript(IAutobuilder<CSharpAutobuildOptions> b
272272
var build = new CommandBuilder(builder.Actions, null, environment);
273273
var script = build.RunCommand(DotNetCommand(builder.Actions, dotNetPath)).
274274
Argument("build").
275-
Argument("--no-incremental");
275+
Argument("--no-incremental").
276+
Argument("/nodeReuse:false");
276277

277278
return
278279
script.Argument(builder.Options.DotNetArguments).

0 commit comments

Comments
 (0)