Fix race conditions in CG2 runs (#44492)
authorTomáš Rylek <trylek@microsoft.com>
Fri, 13 Nov 2020 01:49:04 +0000 (02:49 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Nov 2020 01:49:04 +0000 (02:49 +0100)
commitb86bcd5265612721018cc1cc387748a62056ed46
treea61a4778188781292dca5ba7f8add1577dc82bab
parent4c102bdf5c68fa5f027b224a23e11c24e385c49b
Fix race conditions in CG2 runs (#44492)

While we do lock the test folder during CG2 compilation, we always
run the compilation which means that it can race with execution of
the already CG2-compiled executable which also locks the PE file.

While I'm not super happy about introducing more state, I believe
the easiest way to fix this is the same way CG1 works - compiling
opportunistically upon first build of the project and skipping the
compilation subsequently.

Thanks

Tomas
src/tests/Common/CLRTest.CrossGen.targets