bugmake - Bugs: bug #60736, Introduce "Circular...

 
 

bug #60736: Introduce "Circular <file> <- <file> dependency dropped." for .EXTRA_PREREQS deps.

Submitter:  Dmitry Goncharov <dgoncharov>
Submitted:  Sun 06 Jun 2021 01:33:46 AM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.4 Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 19 May 2024 11:25:15 PM UTC, comment #6: 

I think that using a warn option is better than forcing this to always warn.  But I still think that the warning makes global usage useless, and since there's no way to control warnings on a per-target basis (today) it means the warning is hard to use.

It seems to me that we have two different behaviors: for global .EXTRA_PREREQS I just can't imagine anyone ever wanting to enable this warning.  Can someone show an example of a situation where it would be useful for global .EXTRA_PREREQS?

But for target-specific .EXTRA_PREREQS I can see how it could be useful.

So maybe what we want to do instead of (or in addition to) creating the warning is to say that the entire behavior of omitting extra prereqs as a prerequisite to itself only applies to global .EXTRA_PREREQS; that is in the manual instead of:

> Note @code{make} is smart enough not to add a prerequisite listed in @code{.EXTRA_PREREQS} as a prerequisite to itself.


we make it explicit (and in the code) that this only applies to global .EXTRA_PREREQS; something like:

> Note @code{make} is smart enough not to add a prerequisite listed in a global setting of @code{.EXTRA_PREREQS} as a prerequisite to itself.


Then we can keep all the default behaviors, including warning about circular dependencies using the already existing warning option for this that you proposed in the other bug, because by definition those warnings won't apply to global .EXTRA_PREREQS due to the special case above, but they will still apply to target-specific .EXTRA_PREREQS.

Thoughts?

Paul D. Smith <psmith>
Group administrator
Tue 14 May 2024 02:07:36 AM UTC, comment #5: 

Attached an alternative patch to https://savannah.gnu.org/bugs/index.php?65739.

Dmitry Goncharov <dgoncharov>
Sat 23 Apr 2022 06:01:41 PM UTC, comment #4: 

The reason the exception exists is so that you can specify an extra target globally.  You are testing a target-specific variable version, but if you set this globally:


.EXTRA_PREREQS = foo

bar foo: ; @echo $@


This will always generate a warning, if this patch is applied.  This makes the whole concept of setting this variable globally essentially not useful: no one wants to have warnings like this always generated.

I understand that not having this warning can mean that a typo can go unnoticed but I'm not sure I agree that forcing this warning on all users of the global assignment is a better alternative.

Paul D. Smith <psmith>
Group administrator
Sat 23 Apr 2022 04:21:59 PM UTC, comment #3: 


> For one thing it causes a number of tests to fail.

Fixed.

> For another thing the docs explicitly say:

    > Note 'make' is smart enough not to add a prerequisite listed in '.EXTRA_PREREQS' as a prerequisite to itself.

Does this behavior have to be silent?


Let me present reasons for the message, since you kept the ticket open

1. This example
hello.x: .EXTRA_PREREQS:=hello.x
has a typo.
This was supposed to be
hello.x: .EXTRA_PREREQS:=hello.y

The user keeps modifying hello.y and running make and make keeps telling the user hello.x is up to date.
The message would help.

2. The manual says
"‘Circular xxx <- yyy dependency dropped.’

    This means that make detected a loop in the dependency graph: after tracing the prerequisite yyy of target xxx, and its prerequisites, etc., one of them depended on xxx again.
"

It looks to me that that the user reading this can expect make to report all cases of circular dependencies.


Dmitry Goncharov <dgoncharov>
Mon 18 Apr 2022 09:22:37 PM UTC, comment #2: 

I think this change is not correct.  For one thing it causes a number of tests to fail.  For another thing the docs explicitly say:

> Note 'make' is smart enough not to add a prerequisite listed in '.EXTRA_PREREQS' as a prerequisite to itself.


Paul D. Smith <psmith>
Group administrator
Sun 06 Jun 2021 01:40:33 AM UTC, comment #1: 

With the patch in the attachment the output is

$ make -f makefile2
make: Circular hello.x <- hello.x dependency dropped.
touch hello.x
$

Dmitry Goncharov <dgoncharov>
Sun 06 Jun 2021 01:33:46 AM UTC, original submission:  

Introduce "Circular <file> <- <file> dependency dropped." for .EXTRA_PREREQS dependencies.


$ cat makefile2
hello.x: ; touch $@
hello.x: .EXTRA_PREREQS:=hello.x
$ make -f makefile2
touch hello.x
$

"make: Circular hello.x <- hello.x dependency dropped." is missing.

The message is useful and make prints it in the case of a regular (as opposite to .EXTRA_PREREQS) circular dependency.

Dmitry Goncharov <dgoncharov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by dgoncharov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-23 dgoncharov Attached File- Added sv_60736_add_avoid_circular_dep_msg_tests.diff, #53138
    2021-06-06 dgoncharov Attached File- Added sv_60736_add_avoid_circular_dep_msg.diff, #51520

    Back to the top

    Powered by Savane 3.13-72d9.
    Corresponding source code