[bug #59093] Segmentation fault regression in make 4.3 vs. 4.2.1

2022-05-18 Thread Thomas Petazzoni
Follow-up Comment #10, bug #59093 (project make):

This bug has been fixed more than one year ago. Would it be possible to
publish a new release of GNU Make that contains this fix? Even if it's a make
4.3.1 minor release, for example. Thanks!


___

Reply to this item at:

  

___
  Message posté via Savannah
  https://savannah.gnu.org/




Re: Potential Bug: `.PHONY` targets and order-only prerequisites

2022-05-18 Thread Dmitry Goncharov
On Wed, May 18, 2022 at 5:37 PM Jacob Kopczynski
 wrote:
>>   - it might make sense to state explicitly that order-only prereqs
>> which are phony behave in all ways like standard prerequisites.

This statement is simply incorrect.
Order-only prerequisites which are phony do not behave like regular
prerequisites.
An order-only prerequisite which is phony is rebuilt every time, but
still does not cause those targets, which depend on this order-only
phony prerequisite, to be rebuilt.

regards, Dmitry



Re: Make Docs Errata

2022-05-18 Thread Martin Dorey
> It says SECONDARY EXPANSION, while the first time the manual is referring to 
> the first one

I think it means what it says.  I'd try to suggest a rewording for clarity... 
but I'm not seeing how it could be clearer.  Perhaps you could suggest one?


From: Bug-make  on behalf of 
dVaGaymer 
Sent: Wednesday, May 18, 2022 15:58
To: bug-make@gnu.org 
Subject: Make Docs Errata

* EXTERNAL EMAIL *
Hi,

It is probably not that important but It doesn't cost me anything to report it.
In chapter -3.9 Secondary Expansion- at paragraph 7:
It says SECONDARY EXPANSION, while the first time the manual is referring to 
the first one. (since the example shows how MAKE parses the first expansion and 
then the second one)
I hope I did not missunrestand anything.

It is always a pleasure trying to be useful.


Make Docs Errata

2022-05-18 Thread dVaGaymer
Hi,

It is probably not that important but It doesn't cost me anything to report
it.
In chapter -3.9 Secondary Expansion- at paragraph 7:
It says SECONDARY EXPANSION, while the first time the manual is referring
to the first one. (since the example shows how MAKE parses the first
expansion and then the second one)
I hope I did not missunrestand anything.

It is always a pleasure trying to be useful.


Re: Potential Bug: `.PHONY` targets and order-only prerequisites

2022-05-18 Thread Jacob Kopczynski
The thing that the docs refer to as "impose order" is not a single thing,
but two. I would characterize a normal prerequisite as doing three things
rather than two:
- *update-marking: *cause a target to be marked out of date if the prereq
is marked out of date
- *require-existence: *require the prereq to be built successfully at least
once before the target is built
- *imposed-order: *require the prereq to be built before the target, if
both are being built
A prereq which truly was order-only would *exclusively* do the last one,
imposing order. The "order-only" prereqs as they stand do both
*imposed-order* and *require-existence*. For .PHONY targets,
*require-existence* always mandates *update-marking*, which is why the
overlap between those two cases is particularly confusing - a phony target
which drops only update-marking is a contradiction in terms, so the natural
assumption to make is that the effect of "order-only" prereqs is *not* that,
and is instead something non-paradoxical.

I looked deeper into the list archives and saw that this discussion has
come up before; Stefano Lattarini experienced the same problem in 2012
 (thread
starts 2012/06/11). Phillip Guenther said
 that
this pure-order effect is not achievable with the structure of make, which
presumably remains true.

I agree with Lattarini's recommendations, which I'll reproduce below for
convenience. The primary one was the suggestion of alternate names that
might be used for what are currently called order-only prerequisites -
"existence-only prerequisites" seems like the clearest one to me.

Thanks,
Jacob

Lattarini:

>   - the name "order-only prerequisites" is IMHO poorly chosen, and don't
> really correspond to their actual semantics; a more appropriate might
> be "weak prerequisites" or "existence-only prerequisites";
>   - the explanation given in the manual is imprecise and confusing; since
> the explanation you've given here is OTOH very clear and concise, I
> suggest you report it in the manual;
>   - it might make sense to state explicitly that order-only prereqs
> which are phony behave in all ways like standard prerequisites.

The referenced 'explanation you've given here' is from Paul Smith -
presumably the same one that has responded to me? It was

> No, that's not how order-only prerequisites work.  An order-only
> prerequisite is treated identically to a normal prerequisite except for
> exactly one thing: when make checks to see if a target needs to be
> remade, the time-last-modified values for any order-only prerequisites
> are not considered.


On Wed, May 18, 2022 at 11:14 AM Paul Smith  wrote:

> On Wed, 2022-05-18 at 10:22 -0700, Jacob Kopczynski wrote:
> > I believe I understand. The name "order-only" is highly misleading
> > and should be changed - it does considerably more than "only"
> > "order"; the only thing it does not do is check the timestamp.
>
> As described in the docs there are only two things a prerequisite can
> do: impose order and effect the out-of-date decision of the target.
> Order-only prerequisites do one of them (impose order) and don't do the
> other (effect out-of-date decisions).
>
> What are the "considerably more" things that order-only prerequisites
> do, besides impose order?
>
> I do agree that the docs need clarification though.
>


Re: Potential Bug: `.PHONY` targets and order-only prerequisites

2022-05-18 Thread Paul Smith
On Wed, 2022-05-18 at 10:22 -0700, Jacob Kopczynski wrote:
> I believe I understand. The name "order-only" is highly misleading
> and should be changed - it does considerably more than "only"
> "order"; the only thing it does not do is check the timestamp.

As described in the docs there are only two things a prerequisite can
do: impose order and effect the out-of-date decision of the target. 
Order-only prerequisites do one of them (impose order) and don't do the
other (effect out-of-date decisions).

What are the "considerably more" things that order-only prerequisites
do, besides impose order?

I do agree that the docs need clarification though.



Re: Potential Bug: `.PHONY` targets and order-only prerequisites

2022-05-18 Thread Jacob Kopczynski
I believe I understand. The name "order-only" is highly misleading and
should be changed - it does considerably more than "only" "order"; the only
thing it does not do is check the timestamp. This portion of the
documentation *particularly* needs changing:
> Occasionally, however, you have a situation where you want to impose
> a specific ordering on the rules to be invoked without forcing the
> target to be updated if one of those rules is executed. In that case,
> you want to define order-only prerequisites.
The natural reading of this strongly implies that an order-only
prerequisite literally only affects the order of things. I would suggest
> Occasionally, however, you have a situation where you do not want to
> force the target to be updated if a rule is executed, but you do want to
> ensure that rule is executed before the target every time the target is
> built. In that case, you want to define order-only prerequisites.

Thanks,
Jacob

On Tue, May 17, 2022 at 3:40 PM Paul Smith  wrote:

> On Tue, 2022-05-17 at 22:32 +, Martin Dorey wrote:
> > >  all your targets are .PHONY, and thus are always rebuilt anyway
> >
> > If you "make down", the rule for "down-clean" doesn't run.  They're
> > only rebuilt if something causes them to be considered.
> >
> > >  order-only prerequisites are totally irrelevant and have no impact
> > > on
> > > your makefile.
> >
> > If you comment-out the order-only prerequisite that says that the up
> > target depends on down-clean, then the recipe for down-clean doesn't
> > get run when you "make up".
>
> Sure, of course.
>
> What I was trying to say was, any rule that would normally be run will
> be run regardless of order-only or not, because all the targets in the
> makefile are phony.  So adding or removing the order-only operator in a
> prerequisites list makes no difference to how the targets will be
> processed, in this specific makefile.
>