[src] Try to fix race condition with regards to restoring NuGet packages. by rolfbjarne · Pull Request #19467 · dotnet/macios (original) (raw)

The build is somewhat frequently failing on the bots with this:

/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Could not find file "/Users/builder/azdo/_work/2/a/change-detection/tmp/src/xamarin-macios/packages/mono.options/6.12.0.148/qo8orsfq.fp5"

Although I haven't been able to reproduce it, I believe it to be a race
condition between building the .NET version of the generator and the legacy
Xamarin version of the generator: if they both try to restore NuGet packages
at the same time, things may break.

Fix this by introducing an artificial dependency between the generators, so
that they're not built simultaneously, but instead sequentially.

This might make the build a few seconds slower, but predicable builds on the
bots are way more important. Also the speed will be back to normal once we
stop building legacy Xamarin.