bugmake - Bugs: bug #15913, Target-specific immediate append...

 
 

bug #15913: Target-specific immediate append operator not working as expected

Submitted by:  None
Submitted on:  Mon 27 Feb 2006 01:47:29 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.80Operating System: Any
Fixed Release: 3.81Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 15 Mar 2006 03:11:18 AM UTC, comment #2:

OK, I've fixed this for the next release of GNU make.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Mon 27 Feb 2006 05:57:17 PM UTC, comment #1:

Please see this reply I sent to the original message on the bug-make mailing list:

http://www.mail-archive.com/bug-make%40gnu.org/msg03815.html

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Mon 27 Feb 2006 01:47:29 PM UTC, original submission:

There is some weirdness going on with the append operator and target-specific contexts.

The append operator should act immediately if the variable was originally assigned with an immediate assignment but this does not happen if the variable was globally assigned and the append is target-specific, the append does variable expansion (as if the variable had been deferred).

Here's a test case showing the problem:

colsw07m -> cat Makefile

VAR := $$LOGNAME

bar: VAR += bar

foo bar:
echo $(VAR)

colsw07m -> ~/src/make/make-3.81rc1/make foo echo $LOGNAME makholm colsw07m -> ~/src/make/make-3.81rc1/make bar echo OGNAME bar OGNAME bar

Making the assignment target-specific or making the append global both work as expected.

It seems to be a thing introduced in 3.80 which makes sense since AFAIK 3.80 brought some fixes to target specific variables.
3.78.1 seems to work correctly.
3.79.1, as expected, breaks with target-specific variables.
3.80 works the same as 3.80rc1.

The documentation (chapter on target-specific vars) states that:

"The variable-assignment can be any valid form of assignment; recursive (`='), static (`:='), appending (`+='), or conditional (`?='). All variables that appear within the variable-assignment are evaluated within the context of the target: thus, any previously-defined target-specific variable values will be in effect. Note that this variable is actually distinct from any "global" value: the two variables do not have to have the same flavor (recursive vs. static)."

What basically happens though is that the target-specific append treats the global instance of VAR as recursive.

I would consider this a bug especially since this:

bar: VAR := $(VAR) bar

...also works as expected...

On a slightly related side note, the manual seems to switch between the terms immediate/deferred and static/recursive for describing the same things; the two flavours of variables... Perhaps the two pairs of terms should be unified into one?

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

 

CC list is empty

 

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):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:19:26 AM UTCpsmithFixed Release4.0=>3.81
Wed 15 Mar 2006 03:11:18 AM UTCpsmithStatusNone=>Fixed
  Open/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.0
Mon 27 Feb 2006 05:57:17 PM UTCpsmithAssigned toNone=>psmith

Back to the top


Powered by Savane 3.1-cleanup1