bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bug #17529] Variable set with $(shell date '+%Y%m%d-%H%M%S') change


From: Terry Jones
Subject: RE: [bug #17529] Variable set with $(shell date '+%Y%m%d-%H%M%S') changes mid-make
Date: Sat, 26 Aug 2006 03:06:33 +0200

Hi Martin

| > base = xxx-$(shell date '+%Y%m%d-%H%M%S')
| 
| Perhaps you wanted := instead of =.  The difference is explained in (for
| example):
| 
| http://www.gnu.org/software/make/manual/html_node/Reading-Makefiles.html
| #Reading-Makefiles

Thanks for the pointer. But, at least as I read that page, it sounds like
all variables are expanded exactly once - whether they are immediate or
deferred. It looks a lot like my variable is being expanded twice. Plus,
it's not easy to reproduce: sometimes the change happens earlier in the
sequence of @echo commands I posted (these are not the commands I'm using,
of course - in my actual situation things go much worse, and they do so at
differing points in the set of commands to make the target), sometimes
later, most times not at all.

Reading the page you point to still doesn't make me see how the variable
could be expanded into different values, unless "internalizes all the
variables" should be taken to mean that the expansion is done for the
purposes of figuring out what needs to be built, and then later the
variable is expanded with intent to use it. But even then, there should
still be just one value popping up in the expanded shell commands, and the
behavior would be reproducible. And of course (I think) it would come as a
surprise to many to think that their $(shell) commands were going to be
executed twice. So I think the executed twice theory must be wrong.

My guess is that there is a problem (somewhere) that occurs in a very
specific window of each second (e.g., if the variable is expanded in the
last 1/1000th of a second before the clock ticks to the next second). This
sounds improbable, I know, but I don't see another solution. But then where
are the two values coming from? From make? From date?

If I'm overlooking the obvious here, please be gentle :-)

Thanks again,
Terry




reply via email to

[Prev in Thread] Current Thread [Next in Thread]