فهرست منبع

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

NPM does not handle this well, so only run one NPM command at a time
Nate McMaster 7 سال پیش
والد
کامیت
4c8db32b1c

+ 1 - 1
build/dependencies.props

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

+ 8 - 7
build/repo.props

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

+ 2 - 3
eng/scripts/CodeCheck.ps1

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

+ 3 - 2
eng/targets/Npm.Common.targets

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

+ 2 - 2
korebuild-lock.txt

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

+ 7 - 0
src/SignalR/clients/ts/client-ts.npmproj

@@ -3,8 +3,15 @@
 
   <PropertyGroup>
     <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>
   </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" />
 </Project>

+ 7 - 21
src/SignalR/clients/ts/common/package-lock.json

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