n-t-roff / heirloom-doctools

The Heirloom Documentation Tools: troff, nroff, and related utilities
http://n-t-roff.github.io/heirloom/doctools.html
Other
126 stars 23 forks source link

Project cannot be built in parallel #72

Closed ghost closed 6 years ago

ghost commented 6 years ago

When trying to run a parallel/threaded job build, the build breaks. There are many race conditions going on, so it can fail in a number of ways. Here is one example from a clean project:

$ make -j8
./configure
cat cfg.mk stuff/bst/Makefile.mk >stuff/bst/Makefile
cat cfg.mk eqn/eqn.d/Makefile.mk >eqn/eqn.d/Makefile
cat cfg.mk eqn/neqn.d/Makefile.mk >eqn/neqn.d/Makefile
cat cfg.mk eqn/checkeq.d/Makefile.mk >eqn/checkeq.d/Makefile
cat cfg.mk eqn/eqnchar.d/Makefile.mk >eqn/eqnchar.d/Makefile
cat cfg.mk tbl/Makefile.mk >tbl/Makefile
cat cfg.mk pic/Makefile.mk >pic/Makefile
cat: cfg.mk: No such file or directory
cat: cfg.mk: No such file or directory
cat: cfg.mk: No such file or directory
make: *** [makefile:45: eqn/eqn.d/Makefile] Error 1
make: *** Waiting for unfinished jobs....
make: *** [makefile:45: stuff/bst/Makefile] Error 1
make: *** [makefile:45: eqn/neqn.d/Makefile] Error 1
cat: cfg.mk: No such file or directory
make: *** [makefile:45: eqn/checkeq.d/Makefile] Error 1
cat: cfg.mk: No such file or directory
cat: cfg.mk: No such file or directory
make: *** [makefile:45: eqn/eqnchar.d/Makefile] Error 1
cat: cfg.mk: No such file or directory
make: *** [makefile:45: tbl/Makefile] Error 1
make: *** [makefile:45: pic/Makefile] Error 1
Checking for make(1) ... no
Checking for bmake(1) ... no
Checking for $(LEX) ... no
Checking for flex(1) ... no
Checking for lex(1) ... no
Checking for strlcpy(3) ... no
Checking for strlcat(3) ... no
Checking for wcslcpy(3) ... no
n-t-roff commented 6 years ago

After some changes it should work now. However it is not easy to make sure there are no more race conditions. Anyway you should run ./configure before make.

ghost commented 6 years ago

Excellent, thanks for the quick patch! Seems to be working with ed982b0. I'll agree that it's hard to know for sure if everything is perfect, but it's definitely better than what it was.

Also, thanks for updating the readme about the configure step!