Bug 237393

Summary: release make cannot be run in parallel
Product: Base System Reporter: Sean Eric Fagan <sef>
Component: miscAssignee: freebsd-bugs mailing list <bugs>
Status: New ---    
Severity: Affects Some People CC: ota
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

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:
	@echo $$$$
	@echo $$$$
	@echo $$$$

% make
% make -j1

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