bugmake - Bugs: bug #18641, GNUmake 3.81, $(error ) sometimes...

 
 

bug #18641: GNUmake 3.81, $(error ) sometimes unable to stop make process

Submitted by:  Jun Chen <chjfth>
Submitted on:  Sat 30 Dec 2006 02:03:43 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 30 Jan 2007 06:01:23 AM UTC, comment #4:

The method for auto-generating dependencies described in the GNU make manual is not the state-of-the-art method. You should check my website http://make.paulandlesley.org and look at the advanced auto-dependency generation description there. This process was created fro automake by Tom Tromey and it's much superior to the process in the GNU make manual. And, it doesn't suffer from this issue of invalid warnings.

The solution to the problem is just as described in bug #102; the message about makefiles not being rebuildable would be deferred until after the makefile has tried to be created and only printed if it couldn't be. I don't see any issue with backward compatibility in this.

I took a very quick look at the SF page but there wasn't much there: no homepage, no docs that I could find, etc. If you want to discuss it, probably the -unavailable- mailing list is the best place. Cheers!

Paul D. Smith <psmith>
Project Administrator
Tue 30 Jan 2007 02:47:24 AM UTC, comment #3:

Thanks a lot for your reply, Paul. You catch my meaning right.

I believe that the "include warning suppression" is expected for nearly every person using GNUmake. People use the ``gcc -M' technique mentioned in GNU make manual to generate .d files to be included into their makefiles, so, if you do not provide a way to suppress that warning, they will see a lot of "No such file or directory" warnings for .d files when they start a clean build.

Could you tell me how you're going to solve this (in make 3.82 for example) and at the same time try to maintain makefile behavior compatibility across at least 3.82, 3.81 and 3.80 ?

And perhaps you can have a look at my GnumakeUniproc project just submitted to sf.net: https://gnumakeuniproc.svn.sourceforge.net/svnroot/gnumakeuniproc/GMU-manual/trunk/quick-start/quick-start.htm

Jun Chen <chjfth>
Mon 29 Jan 2007 04:35:18 PM UTC, comment #2:

I understand that this is an undocumented change in behavior. However, I think the new behavior is consistent with the documentation... if the user suggests that the file does not need to exist for inclusion via "-include" then it makes sense to me that a failure to build that file should not cause make to exit.

I think what you really want is a solution to bug #102, so that you can have mandatory include files but not get any warnings/errors unless they really can't be built.

Paul D. Smith <psmith>
Project Administrator
Thu 04 Jan 2007 05:27:22 AM UTC, comment #1:

[2007-01-04]

Well, with the help of Martin Dorey, I've got to know that this bug has nothing to do with make's $(error ) function, but a make behavior change for ``-include '' directive. Since I used ``-include $(_p_SubprjsMade)'' instead of ``include $(_p_SubprjsMade) '' in my makefile, failure to remake $(_p_SubprjsMade) will not stop the whole make process.

After removing the dash from ``-include $(_p_SubprjsAttrMade)'' , the make process goes as I've expected on GNUmake 3.80 as well as GNUmake 3.81, however, I have to suffer from the noisy "<some-file>:<some line>: No such file or directory" warning output by make.

Jun Chen <chjfth>
Sat 30 Dec 2006 02:03:43 PM UTC, original submission:

I think I've found in GNUmake 3.81 a hard-to-realize bug. This bug causes $(error ) function unable to stop the whole make process. I encountered this bug recently when I'm developing an auto-building system based on GNUmake(called GnumakeUniproc), and I have isolate the smallest makefile(filename: eGmu.makefile, 30 effective lines, see the attached file) that can reproduce this problem.

Be aware, in order to see this bug, you have to `rm _MainPrjBuildStart.gmu.ckt' before invoking my makefile, -- honestly, you just have to do it.

Output from make 3.81:
===============
[chj @vchjsuse101 ~/test/clear381]
$ make381 -f eGmu.makefile
make381[1]: Entering directory `/home/chj/test/clear381'
_SubprjsAttr.gmu.mki:1: *** ====== Hey! you should stop here! [./_MakeSubPrjs.gmu.mk] ======. Stop.
make381[1]: Leaving directory `/home/chj/test/clear381'
_SubprjsAttr.gmu.mki:1: *** ====== Hey! you should stop here! [eGmu.makefile] ======. Stop.
===============
You can see that `` <some-makefile>:<line-number>: *** <error message>. Stop.'' appears more than once, which is not the correct behavior.

GNUmake 3.80 does not have this bug however. Output from make 3.80:
===================
[chj @vchjsuse101 ~/test/clear381]
$ make380 -f eGmu.makefile
make[1]: Entering directory `/home/chj/test/clear381'
_SubprjsAttr.gmu.mki:1: *** ====== Hey! you should stop here! [./_MakeSubPrjs.gmu.mk] ======. Stop.
make[1]: Leaving directory `/home/chj/test/clear381'
make: *** [_SubprjsMade.gmu.ckt] Error 2
===================

My testing environment:

  • SuSE Linux 10.1 with stock make 3.80.
  • And I build make 3.81 from official source on SuSE Linux 10.1 with command ./configure && make .

###############################################################

Finally, I also post my eGmu.makefile here:

================================================

_IsP1OlderThanP2 = $(if $(wildcard $1),$(shell (if [ $1 -ot $2 ];then echo -n '1';fi)),1)
# If file $1 not exist or older than $2, 1 is returned, else null is returned.
# If $2 does not exist, result is undetermined.
_IsOlderThanPrjStart = $(call _IsP1OlderThanP2,$1,$(_p_MainPrjStart))
_ClearFile = echo -n "" > $(1)

gmu_Gd_PRJ_GMUTMP = .

_StartupSignatureFile = _MainPrjBuildStart.gmu.ckt

ifeq ($(MAKELEVEL),0)

export _p_MainPrjStart = $(CURDIR)/$(_StartupSignatureFile)
# Important! User should first delete it before invoking the makefile of the main-project!
#Otherwise, the build can be incomplete.

ifeq (,$(wildcard $(_p_MainPrjStart))) # Do these only if the main-prj-start signature does not exist.

# The first thing here is to create the main-prj-start signature, so that the code
# in this if/endif will only execute once during one whole build process.
_temp := $(shell if (echo -n "" > $(_p_MainPrjStart)) ; then echo -n ''; \
else echo __GMU_ex_ERROR; fi; )
ifneq (,$(_temp))
$(error !GMU!Error: Cannot create start-up signature file($(_StartupSignatureFile)) in current dir)
endif

endif # ifeq (,$(wildcard $(_p_MainPrjStart)))

endif # ifeq ($(MAKELEVEL),0)

_p_mki_SubprjAttr = $(gmu_Gd_PRJ_GMUTMP)/_SubprjsAttr.gmu.mki
_p_SubprjsAttrMade = $(gmu_Gd_PRJ_GMUTMP)/_SubprjsAttrMade.gmu.ckt

_p_mk_MakeSubPrjs = $(gmu_Gd_PRJ_GMUTMP)/_MakeSubPrjs.gmu.mk
_p_SubprjsMade = $(gmu_Gd_PRJ_GMUTMP)/_SubprjsMade.gmu.ckt

-include $(_p_SubprjsMade)

$(_p_SubprjsMade): $(_p_MainPrjStart)
@$(call _ClearFile,$(_p_mk_MakeSubPrjs))
@echo -e "include $(_p_mki_SubprjAttr)\n" >> $(_p_mk_MakeSubPrjs)
@${MAKE} -f $(_p_mk_MakeSubPrjs)
@echo -n "" > $@

ifeq ($(call _IsOlderThanPrjStart,$(_p_SubprjsAttrMade)),1)
# $(warning %%%%%%%%%%%%%%%%% [$(MAKELEVEL)] [$(MAKE_RESTARTS)] %%%%%%%%%%%%%%%)
-include $(_p_SubprjsAttrMade)
else
# $(warning +++++++++++++++++ [$(MAKELEVEL)] [$(MAKE_RESTARTS)] +++++++++++++++)
include $(_p_mki_SubprjAttr)
endif

$(_p_SubprjsAttrMade): $(_p_MainPrjStart)
@$(call _ClearFile,$(_p_mki_SubprjAttr))
@echo "\$$(error ====== Hey! you should stop here! [\$$(firstword \$$(MAKEFILE_LIST))] ======)" >> $(_p_mki_SubprjAttr)
@echo -n "" > $@ # touch it
================================================

Jun Chen <chjfth>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #11631:  make381-error-not-stop.tar.gz added by chjfth (1KiB - application/x-gzip-compressed)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 29 Jan 2007 04:35:18 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed
    Sat 30 Dec 2006 02:03:43 PM UTCchjfthAttached File-=>Added make381-error-not-stop.tar.gz, #11631
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1