head 1.10; access; symbols netbsd-10-2-RELEASE:1.5 netbsd-11-0-RELEASE:1.10 netbsd-11-0-RC7:1.10 netbsd-11-0-RC6:1.10 netbsd-11-0-RC5:1.10 netbsd-11-0-RC4:1.10 netbsd-11-0-RC3:1.10 netbsd-11-0-RC2:1.10 netbsd-11-0-RC1:1.10 perseant-exfatfs-base-20250801:1.10 netbsd-11:1.10.0.2 netbsd-11-base:1.10 netbsd-10-1-RELEASE:1.5 perseant-exfatfs-base-20240630:1.7 perseant-exfatfs:1.6.0.2 perseant-exfatfs-base:1.6 netbsd-10-0-RELEASE:1.5 netbsd-10-0-RC6:1.5 netbsd-10-0-RC5:1.5 netbsd-10-0-RC4:1.5 netbsd-10-0-RC3:1.5 netbsd-10-0-RC2:1.5 netbsd-10-0-RC1:1.5 netbsd-10:1.5.0.2 netbsd-10-base:1.5 cjep_sun2x-base1:1.3 cjep_sun2x:1.3.0.4 cjep_sun2x-base:1.3 cjep_staticlib_x-base1:1.3 cjep_staticlib_x:1.3.0.2 cjep_staticlib_x-base:1.3; locks; strict; comment @# @; 1.10 date 2025.03.30.09.51.51; author rillig; state Exp; branches; next 1.9; commitid veGmSzVhPiW2G4PF; 1.9 date 2025.01.14.21.34.09; author rillig; state Exp; branches; next 1.8; commitid cnt23fNlJcIj0vFF; 1.8 date 2025.01.11.21.21.33; author rillig; state Exp; branches; next 1.7; commitid NtFvbDJHnW9G17FF; 1.7 date 2024.06.30.11.37.21; author rillig; state Exp; branches; next 1.6; commitid yW5k27FNGJ0c30gF; 1.6 date 2023.06.01.20.56.35; author rillig; state Exp; branches 1.6.2.1; next 1.5; commitid j3tIvMRlxolKQhrE; 1.5 date 2022.01.10.20.32.29; author rillig; state Exp; branches; next 1.4; commitid oS7G16sNshH7Z7oD; 1.4 date 2022.01.09.18.22.31; author rillig; state Exp; branches; next 1.3; commitid GlsKE09Ry1rkkZnD; 1.3 date 2021.02.06.04.55.08; author sjg; state Exp; branches; next 1.2; commitid 3VvGRlnp9dPLHBGC; 1.2 date 2020.11.09.20.39.46; author rillig; state Exp; branches; next 1.1; commitid PvwwytDh7FK2NfvC; 1.1 date 2020.08.16.12.07.51; author rillig; state Exp; branches; next ; commitid coEgPk3hgfeYGhkC; 1.6.2.1 date 2024.07.01.01.01.15; author perseant; state Exp; branches; next 1.6.2.2; commitid NkoYLLCQWWw9v4gF; 1.6.2.2 date 2025.08.02.05.58.38; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.10 log @make: use '"filename" line 123' for locations instead of 'filename:123' The format 'filename:123' is commonly used for identifying a location in a file. Text editors recognize it and allow quick navigation through it. The previous format was specific to make and would have required custom support in editors. The new format was already used in stack traces, except for the first line. Now all lines use the same format. @ text @make: var-op-shell.mk:32: warning: Command "echo "failed"; (exit 13)" exited with status 13 make: var-op-shell.mk:39: warning: Command "exit 13" exited with status 13 make: var-op-shell.mk:62: warning: "kill $$" exited on a signal /bin/no/such/command: not found make: var-op-shell.mk:69: warning: Command "/bin/no/such/command" exited with status 127 stderr Capturing the output of command "echo '$$$$'" Global: OUTPUT = $$$$ Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 Var_Parse: ${UNDEF}y (eval) Capturing the output of command "echo xy" Global: OUTPUT_OF_UNDEF = xy Var_Parse: ${OUTPUT_OF_UNDEF} != "xy" (eval-defined-loud) Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d 0 exit status 0 @ 1.9 log @make: simplify code for evaluating the '!=' variable assignment An undefined variable evaluates to an empty string, without an error message. @ text @d1 3 a3 3 make: "var-op-shell.mk" line 32: warning: Command "echo "failed"; (exit 13)" exited with status 13 make: "var-op-shell.mk" line 39: warning: Command "exit 13" exited with status 13 make: "var-op-shell.mk" line 62: warning: "kill $$" exited on a signal d5 1 a5 1 make: "var-op-shell.mk" line 69: warning: Command "/bin/no/such/command" exited with status 127 @ 1.8 log @make: replace "Malformed conditional" with "Variable is undefined" Evaluating a conditional such as ".if ${UNDEF}" produced a "Malformed conditional" error, even though the form of the conditional was correct, it was the content of the variable that was wrong. Replace this message with the more accurate "Variable is undefined", revealing which of the possibly many variables is actually undefined. @ text @d11 1 a11 1 Var_Parse: ${UNDEF}y (eval-defined) @ 1.7 log @make: add detailed exit status to message for failed sub-commands Several commands communicate via the exit status and not only distinguish between zero and non-zero, so make this information available to ease investigations. The command "false" is not guaranteed to exit with a consistent status, so use "(exit 13)" instead in the tests, to keep these tests portable across different operating systems. The exit status 127 is required for a shell that cannot find a command, so keep that one. @ text @d11 6 @ 1.6 log @tests/make: force line-based diagnostics to be listed in the tests This way, contradictions between the intended output and the actual output are closer together and have a better chance of being spotted. @ text @d1 2 a2 2 make: "var-op-shell.mk" line 32: warning: "echo "failed"; false" returned non-zero status make: "var-op-shell.mk" line 39: warning: "false" returned non-zero status d5 1 a5 1 make: "var-op-shell.mk" line 69: warning: "/bin/no/such/command" returned non-zero status @ 1.6.2.1 log @Sync with HEAD. @ text @d1 2 a2 2 make: "var-op-shell.mk" line 32: warning: Command "echo "failed"; (exit 13)" exited with status 13 make: "var-op-shell.mk" line 39: warning: Command "exit 13" exited with status 13 d5 1 a5 1 make: "var-op-shell.mk" line 69: warning: Command "/bin/no/such/command" exited with status 127 @ 1.6.2.2 log @Sync with HEAD @ text @d1 3 a3 3 make: var-op-shell.mk:32: warning: Command "echo "failed"; (exit 13)" exited with status 13 make: var-op-shell.mk:39: warning: Command "exit 13" exited with status 13 make: var-op-shell.mk:62: warning: "kill $$" exited on a signal d5 1 a5 1 make: var-op-shell.mk:69: warning: Command "/bin/no/such/command" exited with status 127 a10 6 Var_Parse: ${UNDEF}y (eval) Capturing the output of command "echo xy" Global: OUTPUT_OF_UNDEF = xy Var_Parse: ${OUTPUT_OF_UNDEF} != "xy" (eval-defined-loud) Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d 0 @ 1.5 log @make: add debug logging for capturing the output of external commands This applies to all 4 situations in which the output of an external command is used for modifying a variable or an expression: * the assignment operator '!=' * the assignment modifier '::!=' * the SUN shell modifier ':sh' * the other shell modifier ':!cmd!' Previously, only the shell modifier ':!cmd!' had debug logging. Suggested by Christoph Badura. @ text @d1 3 a3 3 make: "var-op-shell.mk" line 31: warning: "echo "failed"; false" returned non-zero status make: "var-op-shell.mk" line 37: warning: "false" returned non-zero status make: "var-op-shell.mk" line 59: warning: "kill $$" exited on a signal d5 1 a5 1 make: "var-op-shell.mk" line 65: warning: "/bin/no/such/command" returned non-zero status @ 1.4 log @tests/make: demonstrate inconsistencies in Cmd_Exec callers The assignment 'VAR != cmd' generates a warning, the others generate an error message. That error message is ignored for backwards compatibility though. The assignment via the expression ${VAR::!=cmd} only uses the output of the command if there was no error, the other places use the output nevertheless. @ text @d7 4 @ 1.3 log @Use plain kill to test signaled child Recent update to Darwin18 make the test using kill -14 stop working. Reviewed by: rillig @ text @d1 3 a3 3 make: "var-op-shell.mk" line 28: warning: "echo "failed"; false" returned non-zero status make: "var-op-shell.mk" line 34: warning: "false" returned non-zero status make: "var-op-shell.mk" line 56: warning: "kill $$" exited on a signal d5 1 a5 1 make: "var-op-shell.mk" line 62: warning: "/bin/no/such/command" returned non-zero status @ 1.2 log @make(1): move test for != assignments to var-op-shell @ text @d3 1 a3 1 make: "var-op-shell.mk" line 59: warning: "kill -14 $$" exited on a signal d5 1 a5 1 make: "var-op-shell.mk" line 65: warning: "/bin/no/such/command" returned non-zero status @ 1.1 log @make(1): add dummies for fine-grained tests, one per single feature The test names have been derived from the current manual page. All these tests are dummies right now, and the code from the existing tests will be moved into the new tests step by step. This is done to prevent modmisc, escape, varmod-edge and varmisc from growing without any bounds, and to reduce the side-effects of one test to the others. @ text @d1 6 @