{"thread":{"id":"11883","subject":"Parallel make problem?","startedAt":"2008-02-04T20:15:49Z","lastAt":"2008-02-05T03:30:20Z","messageCount":2,"participants":["Bill Lear","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"67412","messageId":"18343.29301.981552.418860@lisa.zopyra.com","threadId":"11883","inReplyTo":null,"subject":"Parallel make problem?","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2008-02-04T20:15:49Z","receivedAt":"2008-02-04T20:15:49Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"I just downloaded 1.5.4 and am building with gnu make, passing the '-j5'\nflag to invoke multiple jobs.  I get the following:\n\n% make -j5 prefix=/opt/git-1.5.4 all doc info\n[...]\nmake[1]: Entering directory `/home/blear/build/git-1.5.4/Documentation'\nrm -f doc.dep+ doc.dep\n/usr/bin/perl ./build-docdep.perl >doc.dep+\nWriting perl.mak for Git\nmake -C ../ GIT-VERSION-FILE\nmv doc.dep+ doc.dep\nmake -C ../ GIT-VERSION-FILE\nmv doc.dep+ doc.dep\nmv: cannot stat `doc.dep+': No such file or directory\n[...]\n\nit does not seem to fail from there, but I am concerned that this is\na problem and thought it worth reporting.\n\n\nBill\n"},{"id":"67475","messageId":"20080205033020.GA2558@coredump.intra.peff.net","threadId":"11883","inReplyTo":"18343.29301.981552.418860@lisa.zopyra.com","subject":"Re: Parallel make problem?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-02-05T03:30:20Z","receivedAt":"2008-02-05T03:30:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 04, 2008 at 02:15:49PM -0600, Bill Lear wrote:\n\n> I just downloaded 1.5.4 and am building with gnu make, passing the '-j5'\n> flag to invoke multiple jobs.  I get the following:\n> \n> % make -j5 prefix=/opt/git-1.5.4 all doc info\n\nI'm not sure this will ever be safe because of the recursive make\ninvocations ('make doc' invokes '$(MAKE) -C Documentation all', which in\nturn does an '-include ../GIT-VERSION-FILE' which triggers a 'make -C\n../ GIT-VERSION-FILE'; and that's just one of the possible problems). So\nyou actually have three different makes running, and nothing to prevent\nthem from clobbering each other if they hit the same file.\n\n> [...]\n> make[1]: Entering directory `/home/blear/build/git-1.5.4/Documentation'\n> rm -f doc.dep+ doc.dep\n> /usr/bin/perl ./build-docdep.perl >doc.dep+\n> Writing perl.mak for Git\n> make -C ../ GIT-VERSION-FILE\n> mv doc.dep+ doc.dep\n> make -C ../ GIT-VERSION-FILE\n> mv doc.dep+ doc.dep\n> mv: cannot stat `doc.dep+': No such file or directory\n> [...]\n\nActually, I think the particular one you're seeing is caused by the two\ndocumentation makes going at once (both 'doc' and 'info' spawn a\nrecursive make in Documentation).\n\nThe solution is to avoid recursive make invocations, which is\npotentially a lot of work and not likely to happen.\n\nThe workaround, as you have may have figured out already, is:\n\n  make -j5 && make -j5 doc && make -j5 info\n\nwhich should be equivalently fast, since there's plenty to parallelize\nwithin each target.\n\n-Peff\n"}]}