Re: parallel build failure with .c.o rule interrupted mid-step!
Roland Illig <[email protected]> Mon, 24 Feb 2025 23:09:00 +0100
| Newsgroups | gmane.os.netbsd.current,gmane.os.netbsd.devel.toolchain |
|---|---|
| Message-ID | <[email protected]> |
Am 24.02.2025 um 21:04 schrieb Greg A. Woods: > In jobs mode make is supposed to feed the whole rule's script to one > invocation of a shell, and in theory that invocation should run to > completion even if some other parallel branch of make encounters an > error. That's how it _should_ work. I made up a little test case (see the attached Makefile), and that test fails sometimes when I interrupt it by pressing Ctrl+C. $ ktrace -i make -r -j20 # press Ctrl+C in the middle $ make -r clean && ls -l At this point, there may be one or more files named 'target-*' left that are smaller than the expected 14 bytes. I got the ktrace log from the above command and will further analyze it. Roland
Makefile
(text/plain, 424 B)
dirs= 20
targets= 20
all: .PHONY
.for d in ${:U:${:Urange=${dirs}}}
all: dir-$d
dir-$d: .PHONY
@${MAKE} -f ${MAKEFILE} do-dir-$d
do-dir-$d: .PHONY
. for t in ${:U:${:Urange=${targets}}}
do-dir-$d: target-$d-$t
target-$d-$t:
@echo one > $@
@echo two >> $@
@echo three >> $@
# Make one of the commands fail in the middle.
@${:U$d$t:M1515}
. endfor
.endfor
clean:
@find . -name 'target-*' -size 14c -delete