Skip to content

Commit 39f18c0

Browse files
authored
Use IgnoreStandardErrorWarningFormat more extensively in Npm.Common.targets (#24682)
This is a possible fix for the 'Waiting for the other yarn instance to finish' error that appears during our CI builds This property is configured in [CSharp.Common.props](https://github.com/dotnet/aspnetcore/blob/master/eng/targets/CSharp.Common.props#L57-L61) but not the NPM one. However it is used in exactly one place in the [targets](https://github.com/dotnet/aspnetcore/blob/master/eng/targets/Npm.Common.targets#L45) This change updates the target to use it more consistently and to declare it it in the props file
1 parent a196a6a commit 39f18c0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

eng/targets/Npm.Common.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
66
<PackOnBuild>false</PackOnBuild>
77
</PropertyGroup>
8+
9+
<!-- Properties to control how we handle warnings when using the tasks provided by the Yarn MSBuild SDK -->
10+
<PropertyGroup>
11+
<IgnoreYarnWarnings>false</IgnoreYarnWarnings>
12+
<IgnoreYarnWarnings Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</IgnoreYarnWarnings>
13+
</PropertyGroup>
814
</Project>

eng/targets/Npm.Common.targets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
DependsOnTargets="GetBuildInputCacheFile"
7777
Inputs="@(TSFiles);$(BaseIntermediateOutputPath)tsfiles.cache"
7878
Outputs="@(BuildOutputFiles)">
79-
<Yarn Command="$(NpmBuildArgs)" StandardOutputImportance="High" StandardErrorImportance="High" />
79+
<Yarn Command="$(NpmBuildArgs)" StandardOutputImportance="High" StandardErrorImportance="High" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" />
8080
<WriteLinesToFile Overwrite="true" File="$(BaseIntermediateOutputPath)build-sentinel" />
8181
</Target>
8282

@@ -102,9 +102,9 @@
102102

103103
<Copy SourceFiles="$(PackageJson)" DestinationFiles="$(_BackupPackageJson)" />
104104

105-
<Yarn Command="version --no-git-tag-version --new-version $(PackageVersion)" />
105+
<Yarn Command="version --no-git-tag-version --new-version $(PackageVersion)" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" />
106106
<Exec Command="node &quot;$(MSBuildThisFileDirectory)..\scripts\update-packagejson-links.js&quot; &quot;$(PackageJson)&quot; $(PackageVersion)" />
107-
<Yarn Command="pack --filename $(PackageFileName)" />
107+
<Yarn Command="pack --filename $(PackageFileName)" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" />
108108

109109
<Move SourceFiles="$(_PackageTargetPath)" DestinationFolder="$(PackageOutputPath)" />
110110
<Message Importance="High" Text="$(MSBuildProjectName) -> $(_PackageTargetPath)" />
@@ -122,7 +122,7 @@
122122
<Target Name="Test" Condition="'$(IsTestProject)' == 'true' AND '$(SkipTests)' != 'true'">
123123
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Test" />
124124
<Message Importance="High" Text="Running npm tests for $(MSBuildProjectName)" />
125-
<Yarn Command="$(NpmTestArgs)" StandardOutputImportance="High" StandardErrorImportance="High" />
125+
<Yarn Command="$(NpmTestArgs)" StandardOutputImportance="High" StandardErrorImportance="High" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" />
126126
</Target>
127127

128128
</Project>

0 commit comments

Comments
 (0)