Don't restore npmproj files in parallel (#6560)

NPM does not handle this well, so only run one NPM command at a time
This commit is contained in:
Nate McMaster 2019-01-10 08:21:26 -08:00 committed by GitHub
parent e5d943a7e3
commit 4c8db32b1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 36 deletions

View File

@ -20,7 +20,7 @@
<!-- Determined by build tools --> <!-- Determined by build tools -->
<InternalAspNetCoreSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSdkPackageVersion> <InternalAspNetCoreSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSdkPackageVersion>
<InternalAspNetCoreSiteExtensionSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSiteExtensionSdkPackageVersion> <InternalAspNetCoreSiteExtensionSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSiteExtensionSdkPackageVersion>
<InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">2.1.7-build-20190109.2</InternalAspNetCoreSdkPackageVersion> <InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">2.1.7-build-20190110.2</InternalAspNetCoreSdkPackageVersion>
</PropertyGroup> </PropertyGroup>
<!-- These are package versions that should not be overridden or updated by automation. --> <!-- These are package versions that should not be overridden or updated by automation. -->

View File

@ -70,17 +70,16 @@
<!-- Project selection can be overridden on the command line by passing in -projects --> <!-- Project selection can be overridden on the command line by passing in -projects -->
<When Condition="'$(Projects)' != ''"> <When Condition="'$(Projects)' != ''">
<ItemGroup> <ItemGroup>
<ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude)" /> <ProjectToBuild Include="$(Projects)" Exclude="@(ProjectToExclude)">
<RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
</ProjectToBuild>
</ItemGroup> </ItemGroup>
</When> </When>
<Otherwise> <Otherwise>
<ItemGroup> <ItemGroup>
<SamplesProject Include="$(RepositoryRoot)src\**\samples\**\*.csproj;"/> <ProjectToBuild Condition="'$(SkipNpm)' != 'true'"
<ProjectToExclude Include="@(SamplesProject)" Condition="'$(BuildSamples)' == 'false' "/>
<ProjectToBuild Condition="'$(SkipSignalRTypescriptClient)' != 'true'"
Include="$(RepositoryRoot)src\SignalR\**\*.npmproj" Include="$(RepositoryRoot)src\SignalR\**\*.npmproj"
RestoreInParallel="false"
Exclude="@(ProjectToExclude)" /> Exclude="@(ProjectToExclude)" />
<ProjectToBuild Include=" <ProjectToBuild Include="
@ -108,7 +107,9 @@
@(ProjectToExclude); @(ProjectToExclude);
$(RepositoryRoot)**\node_modules\**\*; $(RepositoryRoot)**\node_modules\**\*;
$(RepositoryRoot)**\bin\**\*; $(RepositoryRoot)**\bin\**\*;
$(RepositoryRoot)**\obj\**\*;" /> $(RepositoryRoot)**\obj\**\*;">
<RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
</ProjectToBuild>
</ItemGroup> </ItemGroup>
</Otherwise> </Otherwise>
</Choose> </Choose>

View File

@ -16,8 +16,8 @@ $repoRoot = Resolve-Path "$PSScriptRoot/../../"
[string[]] $errors = @() [string[]] $errors = @()
function LogError([string]$message) { function LogError([string]$message) {
Write-Host -f Red "error: $messsage" Write-Host -f Red "error: $message"
$errors += $message $script:errors += $message
} }
try { try {
@ -81,7 +81,6 @@ finally {
Write-Host "" Write-Host ""
foreach ($err in $errors) { foreach ($err in $errors) {
Write-Host -f Red "error : $err" Write-Host -f Red "error : $err"
} }

View File

@ -13,8 +13,9 @@
</Target> </Target>
<Target Name="Restore"> <Target Name="Restore">
<!-- Always use 'npm ci' because 'npm install' churns the package-lock.json file for no apparent reason. --> <Message Importance="High" Text="Running npm install on $(MSBuildProjectFullPath)" />
<Exec Command="npm ci" /> <Exec Command="npm ci" Condition="'$(CI)' == 'true'" />
<Exec Command="npm install --no-optional" Condition="'$(CI)' != 'true'" />
</Target> </Target>
<Target Name="PrepareForBuild"> <Target Name="PrepareForBuild">

View File

@ -1,2 +1,2 @@
version:2.1.7-build-20190109.2 version:2.1.7-build-20190110.2
commithash:ac3a3419fc03baebde26ce4ea3abc86fd701271c commithash:00aefcfd284db33352f35bfa2c74c65f8580e372

View File

@ -3,8 +3,15 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<!-- The 'build' script for this package just build signalr and signalr-protocol-msgpack, so don't invoke build here. -->
<IsBuildable>false</IsBuildable>
<IsTestProject>true</IsTestProject> <IsTestProject>true</IsTestProject>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="signalr\signalr.npmproj" />
<ProjectReference Include="signalr-protocol-msgpack\signalr-protocol-msgpack.npmproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" /> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project> </Project>

View File

@ -2656,14 +2656,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -2678,20 +2676,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -2808,8 +2803,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -2821,7 +2815,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -2836,7 +2829,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -2844,14 +2836,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -2870,7 +2860,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -2951,8 +2940,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -2964,7 +2952,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -3086,7 +3073,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",