bugmake - Bugs: bug #64822, Fix appending to a pattern...


bug #64822: Fix appending to a pattern specific variable.

Submitter:  Dmitry Goncharov <dgoncharov>
Submitted:  Fri 27 Oct 2023 12:50:37 AM UTC
Severity:  3 - Normal Item Group:  Bug
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  SCM Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Sun 04 Feb 2024 11:38:53 PM UTC, comment #7: 

I pushed the changes here with some small fixups.

These changes are good as far as they go but I think there are still some remaining issues to be addressed.  I will raise this on the mailing list before closing this issue.

Paul D. Smith <psmith>
Group administrator
Sat 20 Jan 2024 06:24:26 PM UTC, comment #6: 

Tested on linux, sunos and aix, 64 and 32 bits.

Dmitry Goncharov <dgoncharov>
Sat 20 Jan 2024 06:23:40 PM UTC, comment #5: 

Paul, i attached fix2 and test2. fix2 is split into 2 parts to ease review. Should be applied in order part1 before part2. Thanks for review.

Dmitry Goncharov <dgoncharov>
Wed 10 Jan 2024 10:12:26 PM UTC, comment #4: 

Paul, please do not apply the attached patch. I prepared a more extensive test and another patch, to cover more cases. Going to attach the new patch in a few days.

Dmitry Goncharov <dgoncharov>
Mon 18 Dec 2023 10:04:09 PM UTC, comment #3: 

Rob, that's right. The patch fixes both. In fact, this bug report is a duplicate of https://savannah.gnu.org/bugs/?36486.

Dmitry Goncharov <dgoncharov>
Sun 17 Dec 2023 06:59:19 PM UTC, comment #2: 

Sorry I'm not in a position to confirm it myself, but it looks like this could also fix bug #36486.

Rob <robw_ty>
Fri 27 Oct 2023 01:00:51 AM UTC, comment #1: 

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
$ 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
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

Dmitry Goncharov <dgoncharov>
Fri 27 Oct 2023 12:50:37 AM UTC, original submission:  


Dmitry Goncharov <dgoncharov>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #55592:  sv64822_test2.diff added by dgoncharov (10KiB - text/x-patch)
file #55593:  sv64822_fix2_part2.diff added by dgoncharov (7KiB - text/x-patch)
file #55591:  sv64822_fix2_part1.diff added by dgoncharov (9KiB - text/x-patch)
file #55270:  sv64822_test.diff added by dgoncharov (10KiB - text/x-patch)
file #55271:  sv64822_fix.diff added by dgoncharov (4KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by robw_ty (Posted a comment)
  • -email is unavailable- added by dgoncharov (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-20 dgoncharov Attached File- Added sv64822_fix2_part1.diff, #55591
        Attached File- Added sv64822_test2.diff, #55592
        Attached File- Added sv64822_fix2_part2.diff, #55593
    2023-10-27 dgoncharov Attached File- Added sv64822_test.diff, #55270
        Attached File- Added sv64822_fix.diff, #55271

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code