Closed zmwangx closed 9 years ago
ENV.deparallelize
runs make with -j1 (otherwise Homebrew invokes make with -j set to the number of processing cores) so the upshot is that commonmark's makefile can behave inelegantly when make's parallelism is enabled.
@tdsmith Thanks for the explanation, I simplified the issue description accordingly. (Somehow I didn't realize from the name what ENV.deparallelize
actually does...)
Going forward, I'm just going to include cmark.3 in the repo and the archive, so we avoid these complications. But the patch I pushed to close this issue should work for you now.
@jgm Yes it does, thanks.
Simplified issue description per @tdsmith's comment:
When building
cmark
, the order of targets could be wrong when multiple cores are used. Steps to reproduce:Error:
This error occurred because the
man
target was built beforelibcmark
.Old issue description:
When building
cmark
in certain environments, the order of targets could be wrong, e.g.,man
beforelibcmark
. I noticed this issue when I tried to buildcmark
using Homebrew (see Homebrew/homebrew #35735), but otherwise there was no problem. A Homebrew maintainer believe that this is not a Homebrew issue.Steps to reproduce the issue:
commonmark.rb
from Homebrew/homebrew #35735 (yet to be merged);Emulate Homebrew's build environment by
In the new interactive session,
Error:
I investigated and realized that the error occurred because
libcmark.dylib
(clearly a product of thelibcmark
target) was not yet built whenman/make_man_page.py
was called (clearly for theman
target).The right build order (when built outside Homebrew) is
cmark
,libcmark
,api_test
, and finallyman
.ENV.deparallelize
beforesystem "make"
.Since I have little experience with CMake, I don't know what further information I should provide. I'm happy to provide more details when asked.