1 # $NetBSD: depsrc-ignore.mk,v 1.5 2020/11/15 20:20:58 rillig Exp $
3 # Tests for the special source .IGNORE in dependency declarations,
4 # which ignores any command failures for that target.
6 # Even though 'ignore-errors' fails, 'all' is still made. Since 'all' is
7 # not marked with .IGNORE, it stops at the first failing command.
9 # XXX: The ordering of the messages in the output is confusing.
10 # The "ignored" comes much too late to be related to the "false
11 # ignore-errors". This is due to stdout being buffered.
13 # The "continuing" message comes from the -k option. If there had been
14 # other targets independent of "all", these would be built as well.
16 # Enabling the debugging option -de changes the order in which the messages
17 # appear. Now the "ignored" message is issued in the correct position.
18 # The explanation for the output reordering is that the output is buffered.
19 # As the manual page says, in debugging mode stdout is line buffered.
20 # In these tests the output is redirected to a file, therefore stdout is
23 # This is what actually happens, as of 2020-08-29. To verify it, set the
24 # following breakpoints in CompatRunCommand:
26 # * the "!silent" line, to see all commands
27 # * the "fflush" line, to see stdout being flushed
28 # * the "status = WEXITSTATUS" line
29 # * the "(continuing)" line
30 # * the "(ignored)" line
32 # The breakpoints are visited in the following order:
34 # "ignore-errors begin"
35 # Goes directly to STDOUT_FILENO since it is run in a child process.
36 # "false ignore-errors"
37 # Goes to the stdout buffer (CompatRunCommand, keyword "!silent") and
38 # the immediate call to fflush(stdout) copies it to STDOUT_FILENO.
39 # "*** Error code 1 (ignored)"
40 # Goes to the stdout buffer but is not flushed (CompatRunCommand, near
43 # Goes directly to STDOUT_FILENO.
45 # Goes directly to STDOUT_FILENO.
47 # Goes to the stdout buffer, where the "*** Error code 1 (ignored)" is
48 # still waiting to be flushed. These two lines are flushed now.
49 # "*** Error code 1 (continuing)"
50 # Goes to the stdout buffer.
52 # Goes to the stdout buffer.
54 # Flushes the stdout buffer to STDOUT_FILENO.
58 ignore-errors: .IGNORE