History log of /src/usr.bin/make/unit-tests/directive-export-impl.exp
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
# 1.21 14-Jan-2025 rillig

make: simplify parsing of dependency lines

The evaluation modes that allow or deny undefined variables have the same
effect in this case, as Var_Subst does not return an error marker.


# 1.20 11-Jan-2025 rillig

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.


# 1.19 31-Oct-2024 rillig

make: in the debug log, always qualify line number with filename

Previously, to find out the filename corresponding to a line number from
a 'Parsing' line, it was necessary to find the preceding
'SetFilenameVars' line, which was unnecessarily time-consuming and
distracting.

The 'filename:line' format matches the one used in PrintStackTrace, and
it differs from the one used in PrintLocation, as the former format is
more common in other tools.

Most of the affected unit tests only use the 'Parsing' lines to give
additional context to their debug log, so no structural changes there.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
# 1.18 14-Apr-2024 rillig

branches: 1.18.2;
make: add debug logging for .if and .for lines in -dp mode

This helps track down in which line a condition is evaluated.


Revision tags: netbsd-10-1-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.17 03-Mar-2022 rillig

make: make debug logging for comparisons less technical


# 1.16 10-Jan-2022 rillig

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.


# 1.15 28-Dec-2021 rillig

make: make debug logging a bit more human-friendly

The previous log format "ParseReadLine (%d): '%s'" focused on the
implementation, it was not immediately obvious to a casual reader that
the number in parentheses was the line number. Additionally, having
both a colon and quotes in a log message is uncommon. The quotes have
been added in parse.c 1.127 from 2007-01-01.

The new log format "Parsing line %d: %s" is meant to be easier readable
by humans. The quotes are not needed since ParseReadLine always strips
trailing whitespace, leaving no room for ambiguities. The other log
messages follow common punctuation rules, which makes the beginning of
the line equally unambiguous. Before var.c 1.911 from 2021-04-05,
variable assignments were logged with the format "%s:%s = %s", without a
space after the colon.


# 1.14 20-Nov-2021 rillig

make: use correct plural form in debug message


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.13 06-Apr-2021 rillig

make: reduce verbosity of the -dv debug logging for standard cases

The verbosity was already removed from LogBeforeApply, now it is
consistent between LogBeforeApply and LogAfterApply.


# 1.12 05-Apr-2021 rillig

make: in debug log, add space between scope and variable name

Without this space, the debug log looked more like line noise, even
though the only punctuation was a single innocent ':'. From a make
user's perspective, the variable name is a word of its own and should
not be visually glued to its namespace.


# 1.11 05-Apr-2021 rillig

make: omit unnecessary details from -dv debug log

When an expression is based on a defined variable, it does not matter
whether the evaluation mode is "eval" or "eval-defined", therefore omit
these details to reduce confusion.


# 1.10 05-Apr-2021 rillig

make: be more verbose in -dv debug logging

The previous log output was too brief to be understandable. Give more
hints by describing each part of the expression when evaluating a
modifier. Distinguish between parse-only mode and eval mode since in
parse-only mode most of the details are irrelevant.


# 1.9 05-Apr-2021 rillig

make: clean up debug logging for ':M' and ':N'

Using square brackets as quotes was confusing since patterns can contain
square brackets themselves.

The debug logging for VarMatch was a bit too detailed. Having the
"before" and "after" states is enough for all practically relevant
cases.


# 1.8 04-Apr-2021 rillig

make: remove filler word 'Do' from function names for parsing

No functional change, except for debug logging.


# 1.7 03-Apr-2021 rillig

make: replace enum bit-set with struct bit-fields

This makes the code easier to read, especially when setting one of the
flags to false.

No functional change.


# 1.6 03-Apr-2021 rillig

make: remove VarFlags from debug logging

Before the introduction of ExprDefined, VarFlags contained whether the
expression was defined or not, which was useful to know since the final
value of the expression depends on this information. The other VarFlags
do not influence the evaluation, so there is no point logging them.


# 1.5 15-Mar-2021 rillig

make: change debug log for variable evaluation flags to lowercase

This makes them easier distinguishable from variable names since the
latter are usually uppercase.

No functional change outside debug mode.


# 1.4 16-Feb-2021 rillig

make: rename constants for VarFlags

The old prefix was "VAR_" and this prefix is used for several other
constants as well, which made it ambiguous.


# 1.3 15-Feb-2021 rillig

make: rename ExprDefined constants for debug logging


# 1.2 02-Feb-2021 rillig

make: replace VarExprFlags with VarExprStatus

The combination of !VEF_UNDEF && VEF_DEF was not possible, which made it
rather strange to model this state as a bit set.

The only functional change is the renamed constants in the debug output.

Using ENUM_VALUE_RTTI_2 felt like overengineering since it's harder to
understand than a simple array of names.


# 1.1 29-Dec-2020 rillig

make(1): add test that explains how variables are exported

Exporting the variables at the right time and with the correct values is
a subtle issue. The current implementation carefully marks variables as
ready to be exported, then exports them and at the same time tries to
export as few variables as possible, to avoid memory leaks. This test
describes and explains how all this works in detail.

This test also justifies that the call to Var_ReexportVars happens in
the make process itself, not in the child processes, no matter whether
these are created with vfork or (only theoretically) with plain fork.
This has changed in compat.c 1.217, job.c 1.390 and main.c 1.504 from
2020-12-27.