Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/usr.bin/make



Module Name:    src
Committed By:   rillig
Date:           Mon Dec  7 00:53:30 UTC 2020

Modified Files:
        src/usr.bin/make: compat.c
        src/usr.bin/make/unit-tests: dep-percent.exp deptgt-end-fail.exp
            deptgt-end-fail.mk opt-debug-errors.exp opt-file.exp
            opt-keep-going.exp opt-keep-going.mk posix.exp suff-add-later.exp
            suff-clear-regular.exp suff-clear-regular.mk suff-clear-single.exp
            suff-main-several.exp suff-self.exp suff-transform-endless.exp
            suff-transform-expand.exp suff-transform-select.exp
            use-inference.exp use-inference.mk

Log Message:
make(1): fix exit status in -k mode if a dependency fails

Whether in -k mode or not, the exit status tells whether all requested
targets were made or not.  If a dependency could not be made, the main
target was not made as well, therefore the exit status must be nonzero
in such a case.

This part of the code lacked proper unit tests until today.  The unit
test deptgt-end-fail.mk is compatible with make>=2003 at least, allowing
to compare the output over time.

In 2003, in the ok-ok-ok-ok case, "Making all from all-dep." was printed
twice in a row, for whatever reason  ... (40 minutes later) ... If I had
just made the two commands for 'all' and '.END' more distinguishable.
Back in 2003, the local variables for .END had not been initialized,
instead the .END node was run with the local variables of the last
preceding node.  In this case, that node was 'all', therefore ${.TARGET}
had obviously expanded to 'all'.

Somewhere in 2004, the shell commands were no longer run with the -e
flag, which resulted in the "exit status $?" line to be printed in cases
that had stopped early before.

Somewhere in 2005, the local variables for the .END node had been fixed.
The variable ${.TARGET} now had the value '.END', just as expected.  In
addition, the dependencies for the .END node were made, although without
getting their proper local variables.  This resulted in the output
"Making  out of nothing" instead of the expected "Making end-dep out of
nothing".

Still in 2005, in the test case "all=ok all-dep=ok end=ok end-dep=ERR",
the error code of the failed 'end-dep' was first reported as "*** Error
code 1 (continuing)".  To compensate for this improvement, a new bug had
been introduced.  The test case "all=ok all-dep=ok end=ERR end-dep=ERR"
had properly exited with status 1 on 2005-01-01, but on 2006-01-01 it
exited with status 0, thereby ignoring errors in the .END node.

Somewhere in 2008, some of the error messages (but not all) were
directed to stderr instead of stdout.  The actual output stayed the same
though.

Somewhere in 2011, the dependency of the .END node got its own local
variables, and ${.TARGET} now expanded to 'end-dep', as expected.

Somewhere in 2016, the two empty lines between the "*** Error code 1
(continuing)" and the "Stop." got compressed into a single empty line.

On 2020-12-07 (that is, today), the exit status 1 has been restored in
the error cases, after it had been wrong for at least 14 years.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/make/compat.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dep-percent.exp \
    src/usr.bin/make/unit-tests/posix.exp \
    src/usr.bin/make/unit-tests/suff-clear-regular.exp \
    src/usr.bin/make/unit-tests/suff-clear-regular.mk \
    src/usr.bin/make/unit-tests/suff-clear-single.exp \
    src/usr.bin/make/unit-tests/suff-self.exp \
    src/usr.bin/make/unit-tests/suff-transform-expand.exp \
    src/usr.bin/make/unit-tests/use-inference.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/deptgt-end-fail.exp \
    src/usr.bin/make/unit-tests/deptgt-end-fail.mk \
    src/usr.bin/make/unit-tests/opt-file.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-debug-errors.exp \
    src/usr.bin/make/unit-tests/use-inference.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-keep-going.exp \
    src/usr.bin/make/unit-tests/suff-add-later.exp \
    src/usr.bin/make/unit-tests/suff-main-several.exp \
    src/usr.bin/make/unit-tests/suff-transform-endless.exp \
    src/usr.bin/make/unit-tests/suff-transform-select.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/opt-keep-going.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index