| @@ -1,32 +1,32 @@ | | | @@ -1,32 +1,32 @@ |
1 | # $NetBSD: job-output-long-lines.mk,v 1.3 2020/10/24 08:50:17 rillig Exp $ | | 1 | # $NetBSD: job-output-long-lines.mk,v 1.4 2020/11/01 17:29:13 rillig Exp $ |
2 | # | | 2 | # |
3 | # The jobs may produce long lines of output. A practical case are the echoed | | 3 | # The jobs may produce long lines of output. A practical case are the echoed |
4 | # command lines from compiler invocations, with their many -D options. | | 4 | # command lines from compiler invocations, with their many -D options. |
5 | # | | 5 | # |
6 | # Each of these lines must be written atomically to the actual output. | | 6 | # Each of these lines must be written atomically to the actual output. |
7 | # The markers for switching jobs must always be written at the beginning of | | 7 | # The markers for switching jobs must always be written at the beginning of |
8 | # the line, to make them clearly visible in large log files. | | 8 | # the line, to make them clearly visible in large log files. |
9 | # | | 9 | # |
10 | # As of 2020-09-27, the default job buffer size is 1024. When a job produces | | 10 | # As of 2020-09-27, the default job buffer size is 1024. When a job produces |
11 | # output lines that are longer than this buffer size, these output pieces are | | 11 | # output lines that are longer than this buffer size, these output pieces are |
12 | # not terminated by a newline. Because of this missing newline, the job | | 12 | # not terminated by a newline. Because of this missing newline, the job |
13 | # markers "--- job-a ---" and "--- job-b ---" are not always written at the | | 13 | # markers "--- job-a ---" and "--- job-b ---" are not always written at the |
14 | # beginning of a line, even though this is expected by anyone reading the log | | 14 | # beginning of a line, even though this is expected by anyone reading the log |
15 | # files. | | 15 | # files. |
16 | | | 16 | |
17 | .MAKEFLAGS: -j2 | | 17 | .MAKEFLAGS: -j2 |
18 | | | 18 | |
19 | 100:= ${:U1:S,1,2222222222,g:S,2,3333333333,g} | | 19 | 100:= ${:U1:S,1,2222222222,g:S,2,3333333333,g} |
20 | 10000:= ${100:S,3,4444444444,g:S,4,xxxxxxxxxx,g} | | 20 | 5000:= ${100:S,3,4444444444,g:S,4,xxxxx,g} |
21 | | | 21 | |
22 | all: job-a job-b | | 22 | all: job-a job-b |
23 | | | 23 | |
24 | job-a: | | 24 | job-a: |
25 | .for i in ${:U:range=100} | | 25 | .for i in ${:U:range=20} |
26 | @echo ${10000:S,x,a,g} | | 26 | @echo ${5000:S,x,a,g} |
27 | .endfor | | 27 | .endfor |
28 | | | 28 | |
29 | job-b: | | 29 | job-b: |
30 | .for i in ${:U:range=100} | | 30 | .for i in ${:U:range=20} |
31 | @echo ${10000:S,x,b,g} | | 31 | @echo ${5000:S,x,b,g} |
32 | .endfor | | 32 | .endfor |