bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #64822] Fix appending to a pattern specific variable.


From: Dmitry Goncharov
Subject: [bug #64822] Fix appending to a pattern specific variable.
Date: Thu, 26 Oct 2023 21:00:52 -0400 (EDT)

Follow-up Comment #1, bug #64822 (project make):

Markus Oberhumer reported a bug.

Appending to a pattern specific variable produces an incorrect value in the
presence of a command line definition or an env override of the variable.



$ ls
makefile
$ cat makefile
al%: hello+=pattern
all:; $(info hello=$(hello))
$ # this is the lastest make from master
$ ~/src/make/m64/make hello=cmd
hello=cmd cmd
make: 'all' is up to date.
$


The following takes place.
1. At parse time record_target_var sets the value of a pattern specific
variable to the value defined on command line or to the value of the env
override.
2. Later, at build time, recursively_expand_for_file appends this value of
the
variable (set in record_target_var) to the command line value again,
regardless
of the origin of the variable.


This patch modifies recursively_expand_for_file to avoid appending, unless
the
origin of the variable beats or equals the origin of one of the parent
definitions of this variable.

Even though this bug and fix are not related to sv 64803, the test attached
here tests (among other things) appending in the presence of an env override.
That test requires the fix from sv 64803 to pass.

The original bug report is here
https://lists.gnu.org/archive/html/bug-make/2023-09/msg00015.html. 



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64822>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]