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

 
 

bug #36486: Overrides and append to pattern specific variables

Submitted by:  None
Submitted on:  Thu 17 May 2012 03:34:27 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.82Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by phantal (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup