Skip to content

Commit 4c8db32

Browse files
authored
Don't restore npmproj files in parallel (#6560)
NPM does not handle this well, so only run one NPM command at a time
1 parent e5d943a commit 4c8db32

File tree

7 files changed

+30
-36
lines changed

7 files changed

+30
-36
lines changed

build/dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<!-- Determined by build tools -->
2121
<InternalAspNetCoreSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSdkPackageVersion>
2222
<InternalAspNetCoreSiteExtensionSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSiteExtensionSdkPackageVersion>
23-
<InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">2.1.7-build-20190109.2</InternalAspNetCoreSdkPackageVersion>
23+
<InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">2.1.7-build-20190110.2</InternalAspNetCoreSdkPackageVersion>
2424
</PropertyGroup>
2525

2626
<!-- These are package versions that should not be overridden or updated by automation. -->

build/repo.props

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,16 @@
7070
<!-- Project selection can be overridden on the command line by passing in -projects -->
7171
<When Condition="'$(Projects)' != ''">
7272
<ItemGroup>
73-
<ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude)" />
73+
<ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude)">
74+
<RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
75+
</ProjectToBuild>
7476
</ItemGroup>
7577
</When>
7678
<Otherwise>
7779
<ItemGroup>
78-
<SamplesProject Include="$(RepositoryRoot)src\**\samples\**\*.csproj;"/>
79-
80-
<ProjectToExclude Include="@(SamplesProject)" Condition="'$(BuildSamples)' == 'false' "/>
81-
82-
<ProjectToBuild Condition="'$(SkipSignalRTypescriptClient)' != 'true'"
80+
<ProjectToBuild Condition="'$(SkipNpm)' != 'true'"
8381
Include="$(RepositoryRoot)src\SignalR\**\*.npmproj"
82+
RestoreInParallel="false"
8483
Exclude="@(ProjectToExclude)" />
8584

8685
<ProjectToBuild Include="
@@ -108,7 +107,9 @@
108107
@(ProjectToExclude);
109108
$(RepositoryRoot)**\node_modules\**\*;
110109
$(RepositoryRoot)**\bin\**\*;
111-
$(RepositoryRoot)**\obj\**\*;" />
110+
$(RepositoryRoot)**\obj\**\*;">
111+
<RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
112+
</ProjectToBuild>
112113
</ItemGroup>
113114
</Otherwise>
114115
</Choose>

eng/scripts/CodeCheck.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ $repoRoot = Resolve-Path "$PSScriptRoot/../../"
1616
[string[]] $errors = @()
1717

1818
function LogError([string]$message) {
19-
Write-Host -f Red "error: $messsage"
20-
$errors += $message
19+
Write-Host -f Red "error: $message"
20+
$script:errors += $message
2121
}
2222

2323
try {
@@ -81,7 +81,6 @@ finally {
8181
Write-Host ""
8282

8383
foreach ($err in $errors) {
84-
8584
Write-Host -f Red "error : $err"
8685
}
8786

eng/targets/Npm.Common.targets

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
</Target>
1414

1515
<Target Name="Restore">
16-
<!-- Always use 'npm ci' because 'npm install' churns the package-lock.json file for no apparent reason. -->
17-
<Exec Command="npm ci" />
16+
<Message Importance="High" Text="Running npm install on $(MSBuildProjectFullPath)" />
17+
<Exec Command="npm ci" Condition="'$(CI)' == 'true'" />
18+
<Exec Command="npm install --no-optional" Condition="'$(CI)' != 'true'" />
1819
</Target>
1920

2021
<Target Name="PrepareForBuild">

korebuild-lock.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version:2.1.7-build-20190109.2
2-
commithash:ac3a3419fc03baebde26ce4ea3abc86fd701271c
1+
version:2.1.7-build-20190110.2
2+
commithash:00aefcfd284db33352f35bfa2c74c65f8580e372

src/SignalR/clients/ts/client-ts.npmproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33

44
<PropertyGroup>
55
<IsPackable>false</IsPackable>
6+
<!-- The 'build' script for this package just build signalr and signalr-protocol-msgpack, so don't invoke build here. -->
7+
<IsBuildable>false</IsBuildable>
68
<IsTestProject>true</IsTestProject>
79
</PropertyGroup>
810

11+
<ItemGroup>
12+
<ProjectReference Include="signalr\signalr.npmproj" />
13+
<ProjectReference Include="signalr-protocol-msgpack\signalr-protocol-msgpack.npmproj" />
14+
</ItemGroup>
15+
916
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
1017
</Project>

src/SignalR/clients/ts/common/package-lock.json

Lines changed: 7 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)