bug-make
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] [SV 54161] Fix second expansion of $*


From: Jouke Witteveen
Subject: Re: [PATCH 2/2] [SV 54161] Fix second expansion of $*
Date: Sat, 12 Oct 2019 15:08:10 +0200

On Sat, Oct 12, 2019 at 2:50 PM Paul Smith <address@hidden> wrote:
>
> On Sat, 2019-10-12 at 13:11 +0200, Jouke Witteveen wrote:
> > Before, this was only expanded to $(*F) in prerequisites.
>
> Sorry but I need more information than this; I can't understand this
> change.
>
> The bug in Savannah, as I understand it, is that directory prefixes
> which should be present are missing during prerequisite expansion.
>
> How does switching from $* to $(*F) (which is explicitly a file only)
> help solve this problem?
>
> Cheers!
>

Haha, yeah, this seems counterintuitive, doesn't it!
The true cause of the issue is not immediately visible in the patch:
stem_str is used as a temporary value of file->stem and this value
gets assigned to $* in the second expansion. To be consistent with the
value of $* in the recipe, we should thus prepend the path to stem_str
in some cases. This is what my patch does.

However, as a sort of 'hack', the current code replaces % by $* on the
first expansion, relying on the second expansion to do the right
thing. This does not work after fixing $*, as directories have a
special treatment in implicit rules (they are prepended to
prerequisites separately). The reason this currently works, is because
$* is set incorrectly. By changing it to $(*F), everything is fine
again also with the fixed $* :-).

I hope this clarifies what the patch does.

Regards,
- Jouke



reply via email to

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