bugmake - Bugs: bug #15110, Confusing failure message for...

 
 

bug #15110: Confusing failure message for generate dependencies with 3.81beta3

Submitter:  None
Submitted:  Wed 30 Nov 2005 05:15:40 PM UTC
Votes: 50
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  bosk Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  3.82 Triage Status:  Verified
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 30 Sep 2009 09:58:48 AM UTC, comment #7: 

Fix is in CVS.

Boris Kolpackov <bosk>
Group Member
Sun 02 Aug 2009 11:51:07 PM UTC, comment #6: 

See also bug #25493 for another example of this

Paul D. Smith <psmith>
Group administrator
Fri 31 Mar 2006 03:37:01 AM UTC, comment #5: 

Paul Smith tells me that the problem I am reporting on the bug-make mailing list is linked to this one, and I would tend to agree.

Another (simpler?) test case for this issue is as follows:

$ cat Makefile
.SUFFIXES:

-include baz

foo: ; touch $@
$ cat baz
foo baz: bar
$ make-3.80
make: * No rule to make target `bar', needed by `baz'.  Stop.
$ make-3.81rc2 # from CVS
<no reported error>
$ echo $?
2
<make silently failed with error code 2>

Additionally:
$ make-3.80 -d
Reading makefiles...
Reading makefile `Makefile'...
Reading makefile `baz' (search path) (don't care) (no ~ expansion)...
Updating makefiles....
 Considering target file `baz'.
  Looking for an implicit rule for `baz'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `baz,v'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `RCS/baz,v'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `RCS/baz'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `s.baz'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `SCCS/s.baz'.
  No implicit rule found for `baz'.
   Considering target file `bar'.
    File `bar' does not exist.
    Looking for an implicit rule for `bar'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `bar,v'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `RCS/bar,v'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `RCS/bar'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `s.bar'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `SCCS/s.bar'.
    No implicit rule found for `bar'.
    Finished prerequisites of target file `bar'.
   Must remake target `bar'.
make: * No rule to make target `bar', needed by `baz'.  Stop.
$ make-3.81rc2 -d
Reading makefiles...
Reading makefile `Makefile'...
Reading makefile `baz' (search path) (don't care) (no ~ expansion)...
Updating makefiles....
 Considering target file `baz'.
  Looking for an implicit rule for `baz'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `baz,v'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `RCS/baz,v'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `RCS/baz'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `s.baz'.
  Trying pattern rule with stem `baz'.
  Trying implicit prerequisite `SCCS/s.baz'.
  No implicit rule found for `baz'.
   Considering target file `bar'.
    File `bar' does not exist.
    Looking for an implicit rule for `bar'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `bar,v'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `RCS/bar,v'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `RCS/bar'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `s.bar'.
    Trying pattern rule with stem `bar'.
    Trying implicit prerequisite `SCCS/s.bar'.
    No implicit rule found for `bar'.
    Finished prerequisites of target file `bar'.
   Must remake target `bar'.
   Failed to remake target file `bar'.
  Finished prerequisites of target file `baz'.
 Giving up on target file `baz'.
 Considering target file `Makefile'.
  Looking for an implicit rule for `Makefile'.
  Trying pattern rule with stem `Makefile'.
  Trying implicit prerequisite `Makefile,v'.
  Trying pattern rule with stem `Makefile'.
  Trying implicit prerequisite `RCS/Makefile,v'.
  Trying pattern rule with stem `Makefile'.
  Trying implicit prerequisite `RCS/Makefile'.
  Trying pattern rule with stem `Makefile'.
  Trying implicit prerequisite `s.Makefile'.
  Trying pattern rule with stem `Makefile'.
  Trying implicit prerequisite `SCCS/s.Makefile'.
  No implicit rule found for `Makefile'.
  Finished prerequisites of target file `Makefile'.
 No need to remake target `Makefile'.
Updating goal targets....
Considering target file `foo'.
 File `foo' does not exist.
  Pruning file `bar'.
 Finished prerequisites of target file `foo'.
Giving up on target file `foo'.

When trying to update the makefiles, make is not able to rebuild baz because of the missing dependency bar, which it does not know how to make. Because of the '-include', this failure is correctly silently ignored with 3.81rc2

However, when later make attempts to build the final target foo, it prunes the missing dependency bar (I guess this is OK: the result of attempting to make that one is already known), but fails to report that it does not know how to build the missing dependency.

Bertrand Mollinier Toublet <bertrandsd>
Thu 01 Dec 2005 10:28:24 AM UTC, comment #4: 

Thanks for the clarification. I understand now.

best regards,
Rob.

Anonymous
Thu 01 Dec 2005 06:46:52 AM UTC, comment #3: 

Your sequence of events misses this step: After makefile is re-read and a.d is included, make checks whether a.d is up to date again. In your case it is not since it now depends on a.h which does not exist. The rest goes as I described below.

Boris Kolpackov <bosk>
Group Member
Wed 30 Nov 2005 09:37:26 PM UTC, comment #2: 

I see the sequence slightly differently, but maybe it's the same thing.

Initially a.d doesn't exist.  When a.d is built for -include it is built successfully (make doesn't know about the dependency on a.h yet). The makefile is then reread and a.d is included, so make now knows about the dependency on a.h.  Next, make wants to build a.o which depends on a.d, which in turn depends on a.h, but the build fails here because there is no way to make a.h.

This sequence typically happens when using GCC to generate dependencies with -MG (where missing #include files are assumed to be generated files).  If GCC fails to find a #include file because it's been given the wrong include path, then it will assume the header is generated and create dependencies like those  in a.d.  However, the diagnostic messages from make aren't very helpful any more because they no longer refer to the file that couldn't be found.  An alternative senario is that the include path is correct and that a.h is supposed to be generated, but the a.h rule is missing.  Either way, the diagnostic from make is less helpful than it was.

I was worried that this was a symptom of some wider issue, but if it really is just a diagnostic message problem then I guess I can live with this for a while.

Thanks,
Rob.

Anonymous
Wed 30 Nov 2005 07:24:52 PM UTC, comment #1: 

I think here is what happens: make tries to build a.d for -include but fails (no a.h). It markes it as tried-and-failed, but since dontcare is set no diagnostics is issued. Then make tries to build a.o which happened to depend on a.d which has already been tried-and-failed. Make issues diagnostics and goes home.

Some time ago I tried to re-design this whole dontcare mess for, if I remeber correctly, exactly this reason. I still have emails somewhere I wrote to Paul discussing the changes. I also remember that the changes necessary to clean things up are quite extensive. I think we will have to postpone this until after 3.81 is out.

Boris Kolpackov <bosk>
Group Member
Wed 30 Nov 2005 05:15:40 PM UTC, original submission:  

Version 3.81beta3 of make seems to report build failures differently to 3.80.  For me at least, the report from 3.81beta3 is confusing.  See the following example:
                                                                                                                                    
$ cat makefile
all: a.o
                                                                                                                                    
a.o: a.c a.d; touch $@
                                                                                                                                    
-include a.d
                                                                                                                                    
a.d: a.c; echo '$@: $< a.h' > $@
                                                                                                                                    
$ touch a.c
                                                                                                                                    
$ rm -f a.o a.d
$ make-3.81beta3
echo a.d: a.c a.h > a.d
make: * No rule to make target `a.d', needed by `a.o'.  Stop.
                                                                                                                                    
$ rm -f a.o a.d
$ make-3.80
echo a.d: a.c a.h > a.d
gmake: * No rule to make target `a.h', needed by `a.d'.  Stop.
                                                                                                                                    
The included makefile a.d is generated and contains a dependency of a.d depending on the non-existent prereqisit a.h.  The missing prerequisit is reported clearly in 3.80, but not in 3.81beta3.  This seems to have something to do with the don't care aspect of the include directive.  I guess this is a regression.
                                                                                                                                    
regards,
Rob.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 50 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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-28 psmith Fixed Release4.0 3.82
    2009-09-30 bosk StatusNone Fixed
    2009-09-30 bosk Open/ClosedOpen Closed
        Component VersionNone 3.81
        Fixed ReleaseNone 4.0
    2009-08-03 psmith Triage StatusNone Verified
    2006-03-31 bertrandsd Carbon-CopyRemoved -email is unavailable- -
    2006-03-31 bertrandsd Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added bertrandsd
    2005-11-30 bosk Assigned toNone bosk

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code