7 messages in com.perforce.jamming[jamming] Bug with bound vars and SEA...
FromSent OnAttachments
Vladimir Prus07 Oct 2003 02:55.jam
Vladimir Prus07 Oct 2003 04:55 
David Abrahams07 Oct 2003 07:06 
Vladimir Prus07 Oct 2003 07:26 
Alan Baljeu" <alanb@cornerstonemold.com (Alan Baljeu)07 Oct 2003 08:24 
Alan Baljeu" <alanb@cornerstonemold.com (Alan Baljeu)07 Oct 2003 15:02 
Jim Geist07 Oct 2003 15:15 
Subject:[jamming] Bug with bound vars and SEARCH/LOCATE?
From:David Abrahams (davi@rcn.com)
Date:10/07/2003 07:06:22 AM
List:com.perforce.jamming

Vladimir Prus <gho@cs.msu.su> writes:

David Abrahams wrote:

./jam -fsl.jam -n

I get

cp b /tmp/a && cat /tmp/some-target >> /tmp/a

while I'd expect to see

cp b /tmp/a && cat some-target >> /tmp/a

Anybody knows how to fix this?

Yeah, binding doesn't work that way. When INPUT is bound, the variables "on" the target(s) whose name it contains are used to bind it.

Hmm.. I read your words to mean that if input contains target "some-target", then variables on "some-target" are used for binding of "some-target"? Okay, then why "SEARCH" variable on "some-target" is ignored?

It isn't. ./some-target is equivalent to some-target. Try setting SEARCH to something other than "."

Another aspect is that the problem only happens when "some-target" is not in dependency graph. In that case it's bound after variable on $(<) are in effect, which cause the strange behaviour.

When I add

DEPENDS $(<) : some-target ;

to the "do" rule, the "some-target" is bound at a different time, and all is fine.

I'm not sure what you mean by "all is fine". What code do you use, what behavior do you see, and why do you expect (or not expect) it?