Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.0 Beta 2
-
None
-
457afb3749f4f1d7db86c89cbf251e18fbd0dfbf
Description
For example qtbase/src/corelib/Makefile.Debug. There are the targets install_class_headers and install_targ_headers. Both are independent and can be executed in parallel by jom.
Both start with the following command:
@if not exist D:$(INSTALL_ROOT)\dev\qt\5.0-vs2012\qtbase\include\QtCore $(MKDIR) D:$(INSTALL_ROOT)\dev\qt\5.0-vs2012\qtbase\include\QtCore
There's a race condition:
- both conditions (if not exists) evaluate to true
- one $(MKDIR) call creates the directory
- one $(MKDIR) call fails to create the directory because it already exists
Note that this works on Linux, because mkdir -p doesn't complain, if the directory already exists.
Possible solutions:
- Create a target for every distinct "if not exist $(MKDIR)" call and let the install target that needs this directory depend on it.
- Prevent parallel execution of install targets by chaining them.