[cmake-developers] [CMake 0013209]: race condition with parallel build and custom command

Mantis Bug Tracker mantis at public.kitware.com
Thu May 10 11:19:38 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13209 
====================================================================== 
Reported By:                wbu
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13209
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-05-10 11:19 EDT
Last Modified:              2012-05-10 11:19 EDT
====================================================================== 
Summary:                    race condition with parallel build and custom
command
Description: 
When building a dynamic and static library from the same source and a custom
command is involved, the custom command will be called twice at the same time
with the same output, most likely leading to undefined behavior.

I really tried hard to get the custom command called with different output
paths, like what is done with the object files when compiling. But i could not
find a way to achieve this.

My current workaround is to add a dependency for the dynamic library to the
static library, which is not really what i want.

Attached is a stripped down dummy project, that most likely fails to compile,
because the C-code is doubled by calling the modify.sh in two processes at the
same time.

tested with cmake 2.8.3 and 2.8.8


Steps to Reproduce: 
tar -xzf dummy.tar.gz
cd dummy
make


Additional Information: 
If this issue cannot be solved in cmake, it would be nice to add at an FAQ item
for it.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-10 11:19 wbu            New Issue                                    
2012-05-10 11:19 wbu            File Added: dummy.tar.gz                     
======================================================================




More information about the cmake-developers mailing list