boilermake icon indicating copy to clipboard operation
boilermake copied to clipboard

'mkdir -p' commands used for various rules may race and fail in surprising ways

Open acehreli opened this issue 11 years ago • 1 comments

The following is a compilation output that I have seen today (I modified the paths manually):


g++ -o /foo/bar/car/zar.o [...] [...] compilation terminated. Assembler messages: Fatal error: can't create /foo/bar/car/zar.o: No such file or directory [...] make: *** [/foo/bar/car/zar.o] Error 2 make: *** Waiting for unfinished jobs....

The bug is not reproducible, so it is likely a hardware or OS problem.

The surprising thing is that the directory /foo/bar/car does exist, the disk is not full, and the file can be created manually in there.

I think the issue is the same as the one that is discussed here:

http://stackoverflow.com/questions/1894427/makefile-with-directory-tree-creation-suitable-for-parallel-j-build

Wow! I have just realized that Dan Moulding has been a contributor to that thread. :)

Anyway... I think the correct solution is to make those directories dependencies of the targets, instead of having multiple 'mkdir -p' commands of multiple targets race with each other.

acehreli avatar Jun 05 '13 21:06 acehreli

I don't know why the message "The bug is not reproducible, so it is likely a hardware or OS problem." is printed so large at least on my screen. It is part of the output; I think it is printed by g++.

acehreli avatar Jun 05 '13 21:06 acehreli