head 1.16; access; symbols perseant-exfatfs-base-20261102:1.16 netbsd-11-1-RELEASE:1.16 netbsd-11-0-RELEASE:1.16 netbsd-11-0-RC7:1.16 netbsd-11-0-RC6:1.16 netbsd-11-0-RC5:1.16 netbsd-11-0-RC4:1.16 netbsd-11-0-RC3:1.16 netbsd-11-0-RC2:1.16 netbsd-11-0-RC1:1.16 perseant-exfatfs-base-20250801:1.16 netbsd-11:1.16.0.2 netbsd-11-base:1.16 perseant-exfatfs-base-20240630:1.8 perseant-exfatfs:1.8.0.2 perseant-exfatfs-base:1.8; locks; strict; comment @# @; 1.16 date 2025.06.28.22.39.29; author rillig; state Exp; branches; next 1.15; commitid CDDpACH2g2jV3I0G; 1.15 date 2025.06.12.18.51.05; author rillig; state Exp; branches; next 1.14; commitid vFHPNQz9JJnCjDYF; 1.14 date 2025.03.30.09.51.51; author rillig; state Exp; branches; next 1.13; commitid veGmSzVhPiW2G4PF; 1.13 date 2025.03.29.19.08.52; author rillig; state Exp; branches; next 1.12; commitid y95n9TsA04p0PZOF; 1.12 date 2025.01.11.20.54.46; author rillig; state Exp; branches; next 1.11; commitid v92duHXtj62ZR6FF; 1.11 date 2024.08.29.20.20.36; author rillig; state Exp; branches; next 1.10; commitid EaMgk7FrF8mB1LnF; 1.10 date 2024.08.06.18.00.17; author rillig; state Exp; branches; next 1.9; commitid 1R0ZDok3menTZMkF; 1.9 date 2024.07.04.17.47.54; author rillig; state Exp; branches; next 1.8; commitid mjDGVMgldk7QYxgF; 1.8 date 2024.04.20.10.18.55; author rillig; state Exp; branches 1.8.2.1; next 1.7; commitid 2fCjOO5HMlf2VR6F; 1.7 date 2023.11.19.12.11.34; author rillig; state Exp; branches; next 1.6; commitid WbchyLEtLVXBsdNE; 1.6 date 2023.11.19.11.47.49; author rillig; state Exp; branches; next 1.5; commitid Z0iyhIR9aT4pkdNE; 1.5 date 2023.11.19.11.37.44; author rillig; state Exp; branches; next 1.4; commitid T6Nq2cRxunw1hdNE; 1.4 date 2023.08.19.01.34.21; author sjg; state Exp; branches; next 1.3; commitid QA6FllApxvUrTkBE; 1.3 date 2023.08.17.19.06.51; author rillig; state Exp; branches; next 1.2; commitid mt169J0qVVXoMaBE; 1.2 date 2023.08.17.18.48.32; author rillig; state Exp; branches; next 1.1; commitid wL6ocbtw6DD9GaBE; 1.1 date 2023.05.09.20.14.27; author sjg; state Exp; branches; next ; commitid 6vbjw8CTuIeZmkoE; 1.8.2.1 date 2025.08.02.05.58.39; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.16 log @make: consistently use double quotes in error messages Previously, some error messages used single quotes, very few used backticks or parentheses, most already used double quotes. While here, reword a few error messages to be clearer or more consistent with related error messages. @ text @make: varmod-mtime.mk:46: Invalid argument "123x" for modifier ":mtime" while evaluating variable "no/such/file" with value "no/such/file" make: varmod-mtime.mk:68: Cannot determine mtime for "no/such/file1": while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2" make: varmod-mtime.mk:68: Cannot determine mtime for "no/such/file2": while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2" make: varmod-mtime.mk:78: Invalid argument "errorhandler-no" for modifier ":mtime" while evaluating variable "MAKEFILE" with value "varmod-mtime.mk" make: varmod-mtime.mk:86: Invalid argument "warn" for modifier ":mtime" while evaluating variable "MAKEFILE" with value "varmod-mtime.mk" make: varmod-mtime.mk:110: Unknown modifier ":mtim" while evaluating variable "anything" with value "anything" make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 @ 1.15 log @make: use a common style for unexpected error messages In enomem, report the actual error instead of a fixed ENOMEM. @ text @d1 1 a1 1 make: varmod-mtime.mk:46: Invalid argument '123x' for modifier ':mtime' d7 1 a7 1 make: varmod-mtime.mk:78: Invalid argument 'errorhandler-no' for modifier ':mtime' d9 1 a9 1 make: varmod-mtime.mk:86: Invalid argument 'warn' for modifier ':mtime' @ 1.14 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 @d3 1 a3 1 make: varmod-mtime.mk:68: Cannot determine mtime for 'no/such/file1': d5 1 a5 1 make: varmod-mtime.mk:68: Cannot determine mtime for 'no/such/file2': @ 1.13 log @make: add ":" to error message about unknown modifier In the manual page, the modifiers are listed with a preceding ":", so use the same pattern in the error message. This removes an inconsistency between the error messages "Unknown modifier" and "Bad modifier". @ text @d1 1 a1 1 make: "varmod-mtime.mk" line 46: Invalid argument '123x' for modifier ':mtime' d3 1 a3 1 make: "varmod-mtime.mk" line 68: Cannot determine mtime for 'no/such/file1': d5 1 a5 1 make: "varmod-mtime.mk" line 68: Cannot determine mtime for 'no/such/file2': d7 1 a7 1 make: "varmod-mtime.mk" line 78: Invalid argument 'errorhandler-no' for modifier ':mtime' d9 1 a9 1 make: "varmod-mtime.mk" line 86: Invalid argument 'warn' for modifier ':mtime' d11 1 a11 1 make: "varmod-mtime.mk" line 110: Unknown modifier ":mtim" @ 1.12 log @make: omit redundant follow-up message "Malformed conditional" If there is a parse error or an evaluation error during the conditional, the conditional is already mentioned in the "while evaluating condition" line, so there's no reason to repeat it once again. Same for the "Bad condition" message from the '?:' modifier. @ text @d11 1 a11 1 make: "varmod-mtime.mk" line 110: Unknown modifier "mtim" @ 1.11 log @make: reduce line length in error messages The error messages for deeply nested parse errors were hard to decipher, due to the large amount of text. Split these messages into individual lines, just as in the backtrace for .include files and .for loops. This unified backtrace makes the output more uniform. @ text @d1 1 a1 1 make: "varmod-mtime.mk" line 47: Invalid argument '123x' for modifier ':mtime' d3 1 a3 2 make: "varmod-mtime.mk" line 47: Malformed conditional '${no/such/file:L:mtime=123x}' make: "varmod-mtime.mk" line 70: Cannot determine mtime for 'no/such/file1': d5 1 a5 1 make: "varmod-mtime.mk" line 70: Cannot determine mtime for 'no/such/file2': d7 1 a7 2 make: "varmod-mtime.mk" line 70: Malformed conditional '${no/such/file1 no/such/file2:L:mtime=error}' make: "varmod-mtime.mk" line 81: Invalid argument 'errorhandler-no' for modifier ':mtime' d9 1 a9 2 make: "varmod-mtime.mk" line 81: Malformed conditional '${MAKEFILE:mtime=errorhandler-no} > 0' make: "varmod-mtime.mk" line 90: Invalid argument 'warn' for modifier ':mtime' d11 1 a11 2 make: "varmod-mtime.mk" line 90: Malformed conditional '${MAKEFILE:mtime=warn} > 0' make: "varmod-mtime.mk" line 115: Unknown modifier "mtim" a12 1 make: "varmod-mtime.mk" line 115: Malformed conditional '${anything:L:mtim}' @ 1.10 log @make: in error message about conditionals, use single quotes Single quotes are used less often in the conditionals themselves, which leads to fewer confusions. @ text @d1 2 a2 1 make: "varmod-mtime.mk" line 47: while evaluating variable "no/such/file" with value "no/such/file": Invalid argument '123x' for modifier ':mtime' d4 4 a7 2 make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': d9 2 a10 1 make: "varmod-mtime.mk" line 81: while evaluating variable "MAKEFILE" with value "varmod-mtime.mk": Invalid argument 'errorhandler-no' for modifier ':mtime' d12 2 a13 1 make: "varmod-mtime.mk" line 90: while evaluating variable "MAKEFILE" with value "varmod-mtime.mk": Invalid argument 'warn' for modifier ':mtime' d15 2 a16 1 make: "varmod-mtime.mk" line 115: while evaluating variable "anything" with value "anything": Unknown modifier "mtim" @ 1.9 log @make: add more context information to error messages In case of a parse error or evaluation error, print the variable value in addition to the variable name, to see the effects of previous expression modifiers. In nested make calls, print the current directory at the bottom of a stack trace, as that information is otherwise hard to get in a parallel build spanning multiple directories. @ text @d2 1 a2 1 make: "varmod-mtime.mk" line 47: Malformed conditional (${no/such/file:L:mtime=123x}) d5 1 a5 1 make: "varmod-mtime.mk" line 70: Malformed conditional (${no/such/file1 no/such/file2:L:mtime=error}) d7 1 a7 1 make: "varmod-mtime.mk" line 81: Malformed conditional (${MAKEFILE:mtime=errorhandler-no} > 0) d9 1 a9 1 make: "varmod-mtime.mk" line 90: Malformed conditional (${MAKEFILE:mtime=warn} > 0) d11 1 a11 1 make: "varmod-mtime.mk" line 115: Malformed conditional (${anything:L:mtim}) @ 1.8 log @make: provide more context information for parse/evaluate errors @ text @d1 1 a1 1 make: "varmod-mtime.mk" line 47: while evaluating variable "no/such/file": Invalid argument '123x' for modifier ':mtime' d3 2 a4 2 make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': d6 1 a6 1 make: "varmod-mtime.mk" line 81: while evaluating variable "MAKEFILE": Invalid argument 'errorhandler-no' for modifier ':mtime' d8 1 a8 1 make: "varmod-mtime.mk" line 90: while evaluating variable "MAKEFILE": Invalid argument 'warn' for modifier ':mtime' d10 1 a10 1 make: "varmod-mtime.mk" line 115: while evaluating variable "anything": Unknown modifier "mtim" @ 1.8.2.1 log @Sync with HEAD @ text @d1 11 a11 12 make: varmod-mtime.mk:46: Invalid argument "123x" for modifier ":mtime" while evaluating variable "no/such/file" with value "no/such/file" make: varmod-mtime.mk:68: Cannot determine mtime for "no/such/file1": while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2" make: varmod-mtime.mk:68: Cannot determine mtime for "no/such/file2": while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2" make: varmod-mtime.mk:78: Invalid argument "errorhandler-no" for modifier ":mtime" while evaluating variable "MAKEFILE" with value "varmod-mtime.mk" make: varmod-mtime.mk:86: Invalid argument "warn" for modifier ":mtime" while evaluating variable "MAKEFILE" with value "varmod-mtime.mk" make: varmod-mtime.mk:110: Unknown modifier ":mtim" while evaluating variable "anything" with value "anything" @ 1.7 log @tests/make: cover all code paths for the ':mtime' modifier @ text @d1 1 a1 1 make: "varmod-mtime.mk" line 47: Invalid argument '123x' for modifier ':mtime' d3 2 a4 2 make: "varmod-mtime.mk" line 70: Cannot determine mtime for 'no/such/file1': make: "varmod-mtime.mk" line 70: Cannot determine mtime for 'no/such/file2': d6 1 a6 1 make: "varmod-mtime.mk" line 81: Invalid argument 'errorhandler-no' for modifier ':mtime' d8 1 a8 1 make: "varmod-mtime.mk" line 90: Invalid argument 'warn' for modifier ':mtime' d10 1 a10 1 make: "varmod-mtime.mk" line 115: Unknown modifier "mtim" @ 1.6 log @make: produce more accurate error message for invalid ':mtime' argument @ text @d8 4 @ 1.5 log @tests/make: test non-integer fallback in ':mtime' modifier @ text @d1 1 a1 1 make: "varmod-mtime.mk" line 47: Unknown modifier "x" @ 1.4 log @varmod-mtime.mk: use :localtime for %s Add a comment to explain why ${%s:L:localtime} should be used to get a value that matches time(3). @ text @d1 7 a7 5 make: "varmod-mtime.mk" line 60: Cannot determine mtime for 'no/such/file1': make: "varmod-mtime.mk" line 60: Cannot determine mtime for 'no/such/file2': make: "varmod-mtime.mk" line 60: Malformed conditional (${no/such/file1 no/such/file2:L:mtime=error}) make: "varmod-mtime.mk" line 71: Invalid argument 'errorhandler-no' for modifier ':mtime' make: "varmod-mtime.mk" line 71: Malformed conditional (${MAKEFILE:mtime=errorhandler-no} > 0) @ 1.3 log @make: be strict when parsing the argument of the ':mtime' modifier @ text @d1 5 a5 5 make: "varmod-mtime.mk" line 58: Cannot determine mtime for 'no/such/file1': make: "varmod-mtime.mk" line 58: Cannot determine mtime for 'no/such/file2': make: "varmod-mtime.mk" line 58: Malformed conditional (${no/such/file1 no/such/file2:L:mtime=error}) make: "varmod-mtime.mk" line 69: Invalid argument 'errorhandler-no' for modifier ':mtime' make: "varmod-mtime.mk" line 69: Malformed conditional (${MAKEFILE:mtime=errorhandler-no} > 0) @ 1.2 log @tests/make: extend tests for the ':mtime' modifier @ text @d4 1 a4 1 make: "varmod-mtime.mk" line 69: Unknown modifier "handler-no" @ 1.1 log @make: add :mtime to provide mtime of file The value of the variable is passed to stat(2) and st_mtime is new value. An optional arg can be used if stat(2) fails, otherwise the current time is used. See varmod-mtime.mk for usage examples. @ text @d1 8 a8 1 exit status 0 @