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

 
 

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

Submitted by:  Dmitry Goncharov <dgoncharov>
Submitted on:  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:  SCM Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

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>
Project 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>
Project 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.9