Bug 237393 - release make cannot be run in parallel
Summary: release make cannot be run in parallel
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-19 18:35 UTC by Sean Eric Fagan
Modified: 2019-08-12 09:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Eric Fagan freebsd_committer 2019-04-19 18:35:18 UTC
In trying to build some installation media, I did a buildworld and buildkernel, and then "cd release ; make -j10 cdrom".

This fails every time.  There is at least one big problem I could tell from looking at the output and the Makefile:  the rules for base.txz end with "mv ${DISTDIR}/*.txz ."; this will conflict with the rules for kernel.txz, which tries to move ${DISTDIR}/kernel*.txz -- and the parallel build means that it's already been moved.

Making kernel.txz depend on base.txz, however, exposed another problem:

cd //usr/obj/usr/src/amd64.amd64/release/dist/kernel;  tar cvf - --exclude '*.debug' . |  xz -T 0 > //usr/obj/usr/src/amd64.amd64/release/dist/kernel.txz
cd: //usr/obj/usr/src/amd64.amd64/release/dist/kernel: No such file or directory
*** [packagekernel] Error code 2

which is coming from Makefile.inc1

This isn't critical, since I can just do a non-parallel make.
Comment 1 Sean Eric Fagan freebsd_committer 2019-04-19 22:28:04 UTC
ha, only -j1 isn't working now either. What am I doing wrong?
Comment 2 Glen Barber freebsd_committer 2019-04-19 23:03:54 UTC
(In reply to Sean Eric Fagan from comment #1)
> ha, only -j1 isn't working now either. What am I doing wrong?

'-j1' doesn't necessarily do what you would expect.  Just leave the '-jN' out.
Comment 3 Sean Eric Fagan freebsd_committer 2019-04-21 20:21:37 UTC
Actually, I think the problem may be make.  With any -j option, it breaks pretty badly.

A sample Makefile:
all:
	@echo $$$$
	@echo $$$$
	@echo $$$$

% make
50963
50964
50965
% make -j1
50967
50967
50967

Running each command in a target in the same shell process is pretty bad.