Add --mutex option to yarn commands (#9919)

Attempt to improve reliability of running yarn commands. Our project structure might cause yarn to be launched multiple times. According to yarn docs, this option should avoid conflicts between multiple instances of yarn

https://yarnpkg.com/en/docs/cli/#toc-concurrency-and-mutex
This commit is contained in:
Nate McMaster 2019-05-02 17:45:55 -07:00 committed by GitHub
parent 20d0497163
commit 8863ebfda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 9 deletions

View File

@ -18,7 +18,7 @@
<Target Name="Restore">
<Message Importance="High" Text="Running yarn install on $(MSBuildProjectFullPath)" />
<Yarn Command="install $(InstallArgs)" StandardOutputImportance="High" StandardErrorImportance="High" />
<Yarn Command="install --mutex network $(InstallArgs)" StandardOutputImportance="High" StandardErrorImportance="High" />
</Target>
<Target Name="PrepareForBuild">

View File

@ -12,10 +12,5 @@
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<Target Name="InstallPuppeteer" BeforeTargets="Restore">
<!-- Explicitly install puppeteer. This will install the bundled Chromium as part of restore instead of as part of execution -->
<Yarn Command="add puppeteer" />
</Target>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>

View File

@ -21,7 +21,7 @@
<Target Name="YarnInstall">
<Message Text="Running yarn install on $(MSBuildProjectFile)" Importance="High" />
<Yarn Command="install" />
<Yarn Command="install --mutex network" />
</Target>
<Target Name="_IsCustomRestoreTargetSupported" Returns="@(CustomRestoreTargets)" Condition="'$(BuildNodeJs)' == 'true'">

View File

@ -25,7 +25,7 @@
<Target Name="YarnInstall">
<Message Text="Running yarn install on $(MSBuildProjectFile)" Importance="High" />
<Yarn Command="install" />
<Yarn Command="install --mutex network" />
</Target>
<Target Name="_IsCustomRestoreTargetSupported" Returns="@(CustomRestoreTargets)" Condition="'$(BuildNodeJs)' == 'true'">

View File

@ -11,7 +11,7 @@
Importance="High"
Text="Prerequisites were not enforced at build time. Running Yarn or the E2E tests might fail as a result. Check /src/Shared/E2ETesting/Readme.md for instructions." />
<Yarn Command="install" />
<Yarn Command="install --mutex network" />
</Target>
<Target Name="_IsCustomRestoreTargetSupported" Returns="@(CustomRestoreTargets)" Condition="'$(BuildNodeJs)' == 'true'">