[Top][All Lists]

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

[bug #48643] Irrelevant targets can confuse make on which pattern rule t

From: Dmitry Goncharov
Subject: [bug #48643] Irrelevant targets can confuse make on which pattern rule to select.
Date: Thu, 27 Jan 2022 16:20:46 -0500 (EST)

Follow-up Comment #37, bug #48643 (project make):

> The first one is that the output appears even if make ultimately decides
that there is no way to build the target.

i think, this is good. Hopefully, this will prevent users from writing
makefiles that depend on compat search.

> When I put my extra warning in I get this output:
> make: Detected a compatibility rule to build 'hello.z'.
> make: Using compatibility rule '%.z:: %.x' due to unrelated 'hello.x'.
> make: *** No rule to make target 'hello.x', needed by 'hello.z'.  Stop.

i think, "Detected a compatibility rule..." message is problematic.

> Although I didn't find too many instances of this in my tests I know they
are actually quite common and this makes me concerned that adding this warning
will cause lots of warnings in real makefiles.

i think, make should issue this warning only when two conditions are
1. No implicit rule is found.
2. There is an unrelated rule which mentiones the implicit prerequisite

Even though the 2nd condition is common, the 1st is not that common. Most of
makefiles (as far as i can tell) have proper rules. For those proper makefiles
make will fail to find the rule only if the source file is missing, vpath is
messed up or a bug was introduced to the makefile.
All those who reported after the 2009 fix, presented some legal, but
convoluted makefile, such as examples 3 and 5 or this test from
features/double_colon. These makefiles have the prerequisite mentioned
explicitly on an unrelated rule to cause make to cut implicit search short and
then rely on either default rule or a match anything rule to build the target.
make will issue the warning for such makefiles only. Makefiles which have
proper rules should not cause make to issue the warning. Your testing
described in update 30 found no such convoluted examples.

The "Detected a compatibility rule..." can be quite common, that's the
condition 2. That's why, i suggest, make does not issue "Detected a
compatibility rule..." message.

i think, make should tell the user that no implicit rule is found. Otherwise,
"Using compatibility rule..." looks like an neutral message and does not look
like make is warning about something bad.

> It also may well mean that we won't ever be able to remove the compatibility
search at all, because without this we don't get the above error at all:
instead we just get a successful "Nothing to be done for 'all'."

Only if the target exists and there is no proper (the one that does not depend
on its implicit prerequisite mentioned explicitly somewhere else) rule.


Reply to this item at:


  Сообщение отправлено по Savannah

reply via email to

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