Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiler and linker open some source files with exclusive access #4466
The compiler and linker open some source files with exclusive access instead of read-share access. This causes intermittent problems when performing multi-core builds. Any files that are only being read should be opened with read-share access so that multiple threads / processes can read the file simultaneously.
I think it was coming from the linker when it was reading an ICO file to use as the package icon. After taking a closer look at the 3.8 code, it looks like there is only once place where this is happening (I thought there were more, but I was wrong), and it is stinging us randomly. Here is the offending line:
File: src\DTF\Libraries\Resources\GroupIconResource.cs: ~line 95 (ReadFromFile method)
The default FileShare mode is None, so if one thread is reading the icon, no other threads can also open it for read. I think this needs to be changed so that other threads can read the file:
Or it could just be changed to use File.OpenRead, which automatically uses FileShare.Read under the covers. This is what is done in many places for Wix read operations.