bugmake - Bugs: bug #36486, Overrides and append to pattern...

 
 

bug #36486: Overrides and append to pattern specific variables

Submitter:  None
Submitted:  Thu 17 May 2012 03:34:27 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.82 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  Major Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 04 Feb 2024 11:36:31 PM UTC, comment #3: 

This was addressed as part of bug #64822

Paul D. Smith <psmith>
Group administrator
Mon 10 Sep 2012 05:28:40 AM UTC, comment #2: 

This is a bug, but it's going to require some non-trivial effort to fix.  The problem is that make is recursively walking down (or up, whichever you like) the variable sets, and when it pops back out it returns only the value string of the expanded content.  So, when we pop out of the recursion we have no way to know that at the end (or the top) we found an "override" variable and we shouldn't append anything to it.

To fix this we'll need to rework the returned values from the various variable expansion functions so that more information, than just the value string, is returned.  That kind of change may ripple throughout the codebase.

Paul D. Smith <psmith>
Group administrator
Fri 13 Jul 2012 06:03:10 PM UTC, comment #1: 

Similar to the OP's bug:


override ASDF := global
A: ASDF += A1

A:
  @echo "${@}: ${ASDF}"


Running make causes it to print:

A: global A1

Brian Vandenberg <phantal>
Thu 17 May 2012 03:34:27 PM UTC, original submission:  

Hi,

Using a target pattern to append to an override variable is not behaving as I expect.  The behaviour is also different depending on whether the override variable is defined on the command line or inside a makefile.  The problem is demonstrated by the following makefile:

override MO=mo
all: ; @echo 'MO=$(MO), CLO=$(CLO)'
a%: MO += add_to_mo
a%: CLO += add_to_clo

I build it with the following command:

make CLO=clo

The output I see is:

MO=mo add_to_mo, CLO=clo clo

But what I expected to see was:

MO=mo, CLO=clo

It seems the pattern specific append is affecting the value of the override variables, however I don't think that should be possible unless the pattern specific append it also given the override attribute.  The case with the CLO variable seems particularly strange as the effect is to double the globally defined value.

regards,
Rob.


Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 phantal (Posted a comment)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-04 psmith StatusNone Duplicate
        Open/ClosedOpen Closed
        Triage StatusNone Major Effort

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code