Skip to content

Commit f42cbcb

Browse files
authored
Merge pull request #4428 from tamasvajk/feature/force-nuget-single-restore
C#: Add '-DisableParallelProcessing' flag to nuget restore in Autobuilder
2 parents b409cf6 + f3f9083 commit f42cbcb

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,9 @@ public void TestWindowsCmdIgnoreErrors()
710710
[Fact]
711711
public void TestWindowCSharpMsBuild()
712712
{
713-
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test1.sln"] = 0;
713+
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test1.sln -DisableParallelProcessing"] = 0;
714714
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
715-
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test2.sln"] = 0;
715+
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test2.sln -DisableParallelProcessing"] = 0;
716716
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test2.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
717717
Actions.FileExists["csharp.log"] = true;
718718
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
@@ -741,9 +741,9 @@ public void TestWindowCSharpMsBuild()
741741
[Fact]
742742
public void TestWindowCSharpMsBuildMultipleSolutions()
743743
{
744-
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test1.csproj"] = 0;
744+
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test1.csproj -DisableParallelProcessing"] = 0;
745745
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
746-
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test2.csproj"] = 0;
746+
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test2.csproj -DisableParallelProcessing"] = 0;
747747
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test2.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
748748
Actions.FileExists["csharp.log"] = true;
749749
Actions.FileExists[@"C:\Project\test1.csproj"] = true;
@@ -786,7 +786,7 @@ public void TestWindowCSharpMsBuildMultipleSolutions()
786786
[Fact]
787787
public void TestWindowCSharpMsBuildFailed()
788788
{
789-
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test1.sln"] = 0;
789+
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test1.sln -DisableParallelProcessing"] = 0;
790790
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 1;
791791
Actions.FileExists["csharp.log"] = true;
792792
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
@@ -994,8 +994,8 @@ public void TestDotnetVersionWindows()
994994
[Fact]
995995
public void TestDirsProjWindows()
996996
{
997-
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\dirs.proj"] = 1;
998-
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\dirs.proj"] = 0;
997+
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\dirs.proj -DisableParallelProcessing"] = 1;
998+
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\dirs.proj -DisableParallelProcessing"] = 0;
999999
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\dirs.proj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
10001000
Actions.FileExists["csharp.log"] = true;
10011001
Actions.FileExists[@"C:\Project\a\test.csproj"] = true;
@@ -1038,8 +1038,8 @@ public void TestDirsProjWindows()
10381038
[Fact]
10391039
public void TestDirsProjLinux()
10401040
{
1041-
Actions.RunProcess[@"nuget restore C:\Project/dirs.proj"] = 1;
1042-
Actions.RunProcess[@"mono C:\Project/.nuget/nuget.exe restore C:\Project/dirs.proj"] = 0;
1041+
Actions.RunProcess[@"nuget restore C:\Project/dirs.proj -DisableParallelProcessing"] = 1;
1042+
Actions.RunProcess[@"mono C:\Project/.nuget/nuget.exe restore C:\Project/dirs.proj -DisableParallelProcessing"] = 0;
10431043
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto msbuild C:\Project/dirs.proj /p:UseSharedCompilation=false /t:rebuild /p:MvcBuildViews=true"] = 0;
10441044
Actions.FileExists["csharp.log"] = true;
10451045
Actions.FileExists[@"C:\Project/a/test.csproj"] = true;

csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ BuildScript GetNugetRestoreScript() =>
5353
RunCommand(nuget).
5454
Argument("restore").
5555
QuoteArgument(projectOrSolution.FullPath).
56+
Argument("-DisableParallelProcessing").
5657
Script;
5758
var nugetRestore = GetNugetRestoreScript();
5859
var msbuildRestoreCommand = new CommandBuilder(builder.Actions).

0 commit comments

Comments
 (0)