bug-make
[Top][All Lists]
Advanced

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

Re: RE: [bug #18641] GNUmake 3.81, $(error ) sometimes unable to stop ma


From: Chen Jun (陈军)
Subject: Re: RE: [bug #18641] GNUmake 3.81, $(error ) sometimes unable to stop make process
Date: Thu, 4 Jan 2007 11:57:07 +0800

Hello, Martin Dorey,

Thank you very much for your investigation, now I've realized that the source 
of my problem on GNUmake 3.81 is the leading dash before "include" directive. 
It's a pity that this behavior change is not expressed in the NEWS file in 
GNUmake 3.81 source package.

However, on revisiting the GNUmake manual(manual of v3.81), I feel that the 
description for "-include" is still quite vague. The manual says in chapter 
"3.3 Including Other Makefiles":

>>>>>>>>>>>>
-include filenames…

This acts like include in every way except that there is no error (not even a 
warning) if any of the filenames do not exist. For compatibility with some 
other make implementations, sinclude is another name for -include. 
<<<<<<<<<<<<

What does "no error (not even a warning) if any of the filenames do not exist" 
mean? There are two time points that make will check the existence of the 
to-be-included files, one is the first start of a makefile, another is the 
second start(restart) after all included targets are remade. For a user using 
GNUmake 3.80, he can only observe the behavior difference(as for whether add 
the dash) at the first time point that I mentioned(the difference is whether a 
warning is printed) ; no make hehavior difference can be observered at the 
second time point(make process stops on failing to make an included target).

Now, GNUmake 3.81 really changed(or fix) the behavior since 3.80. I do not 
protest this fix -- it's a new feature after all, however, the GNUmake author 
should not have broken the behavior compatibility after 3.80 had been used 
widely for three years. If possible in GNUmake 3.82, I'd like to suggest using 
double dash(i.e. --include some-files) for current 3.81's behavior, while singe 
dash remains the same behavior as 3.80 .

Just forcing the current 3.80 user to remove the dash before "include" is not 
good. Take my situation for example, I require the included files to exist when 
make is restarted(else the make process must halt), but at make's first start, 
I don't like the end-user to see lots of warnings saying "No such file or 
directory" for my designated included files. You see, I can not accomplish this 
using GNUmake 3.81 .

By the way, my problems mentioned above arose when I was trying my 
GNUmake-based auto-building system (called GnumakeUniproc) on GNUmake 3.81. The 
GnumakeUniproc project has just been approved by sourceforge.net today(unix 
name = gnumakeuniproc), and hopefully you can see its first beta release in a 
month or two.
        

======= You wrote: ======

>> Suggest rewriting the last two lines as:
>
>Sorry for that unnecessary nonsense.  I'm not sure why I invented that
>superstition.
>
>Now I'm at a proper computer (and can read the documentation and try
>things out), I can reproduce the behavior observed by the OP.  A
>potentially relevant difference in behavior between 3.80 and 3.81 can be
>observed with a simpler makefile:
>
>-include Makefile1
>
>Makefile1:
>       false
>
>-include Makefile2
>
>Makefile2:
>       false
>
>$ make #3.81
>false
>false
>make: *** No rule to make target `Makefile1'.  Stop.
>$ make-3.80
>false
>make-3.80: *** [Makefile2] Error 1
>$
>
>If I remove the "-" from "-include", then make-3.81 stops after the
>first failure to update a makefile.  The 3.81 behavior of -include seems
>consistent with the documentation - that make shouldn't stop if the
>makefile can't be remade.  So I think I'd say that the difference in
>behavior is due to a bug with 3.80's -include which is fixed in 3.81.
>
>The OP said:
>
>>> $(error ) function unable to stop the whole make process
>
>But there are two make processes.  One was stopped and the other carried
>on, as it was (arguably) instructed to do by the "-" on the "-include"
>directive.
>
>Double apologies if I've got the wrong end of the stick again but I felt
>duty bound to correct my earlier mistake... and then duty bound to try
>to make some more useful contribution.  I have to admit that I haven't
>fully understood the attached makefiles.  Hopefully --debug=all gave me
>enough insight.
>-------------------------------------
>Martin's Outlook, BlueArc Engineering
>
>
>-----Original Message-----
>From: address@hidden
>[mailto:address@hidden On Behalf Of Martin
>Dorey
>Sent: Saturday, December 30, 2006 7:05
>To: address@hidden; address@hidden;
>address@hidden; address@hidden; address@hidden;
>address@hidden
>Subject: Re: [bug #18641] GNUmake 3.81,$(error ) sometimes unable to
>stop make process
>
>To get the behavior you want, you need the rule for $(_p_SubprjsMade) to
>fail when its invocation of ${MAKE} -f $(_p_mk_MakeSubPrjs) fails.
>Suggest rewriting the last two lines as:
>
>       @${MAKE} -f $(_p_mk_MakeSubPrjs) && \
>       touch $@
>
>(echo -n "" > $@ is fine - touch $@ is just more usual and shorter.)
>
>This way, the parent make will stop when the sub-make fails.
>
>As to why make-3.81 behaves differently to make-3.80, that requires a
>deeper knowledge of make's internals than I have.  All I can say is that
>I have noticed make-3.81 seeming to reassess the list of targets which
>need building "more often" than 3.80 but someone else might chime in
>with a fuller explanation.
>
>----- Original Message -----
>From: address@hidden
><address@hidden>
>To: Jun Chen <address@hidden>; address@hidden
><address@hidden>; address@hidden <address@hidden>;
>address@hidden <address@hidden>; address@hidden
><address@hidden>
>Sent: Sat Dec 30 06:03:44 2006
>Subject: [bug #18641] GNUmake 3.81, $(error ) sometimes unable to stop
>make process
>
>
>URL:
>  <http://savannah.gnu.org/bugs/?18641>
>
>                 Summary: GNUmake 3.81, $(error ) sometimes unable to
>stop
>make process
>                 Project: make
>            Submitted by: chjfth
>            Submitted on: Saturday 12/30/2006 at 22:03
>                Severity: 3 - Normal
>              Item Group: Bug
>                  Status: None
>                 Privacy: Public
>             Assigned to: None
>             Open/Closed: Open
>         Discussion Lock: Any
>       Component Version: 3.81
>        Operating System: Any
>           Fixed Release: None
>
>    _______________________________________________________
>
>Details:
>
>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
>================================================
>
>
>
>
>    _______________________________________________________
>
>File Attachments:
>
>
>-------------------------------------------------------
>Date: Saturday 12/30/2006 at 22:03  Name: make381-error-not-stop.tar.gz 
>Size: 1kB   By: chjfth
>
><http://savannah.gnu.org/bugs/download.php?file_id=11631>
>
>    _______________________________________________________
>
>Reply to this item at:
>
>  <http://savannah.gnu.org/bugs/?18641>
>
>_______________________________________________
>  Message sent via/by Savannah
>  http://savannah.gnu.org/
>
>
>
>_______________________________________________
>Bug-make mailing list
>address@hidden
>http://lists.gnu.org/mailman/listinfo/bug-make

        
address@hidden
          2007-01-04


reply via email to

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