[Top][All Lists]

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

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

From: Martin Dorey
Subject: RE: [bug #18641] GNUmake 3.81, $(error ) sometimes unable to stop make process
Date: Sat, 30 Dec 2006 22:44:25 -0800

> Suggest rewriting the last two lines as:

Sorry for that unnecessary nonsense.  I'm not sure why I invented that

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


-include Makefile2


$ make #3.81
make: *** No rule to make target `Makefile1'.  Stop.
$ make-3.80
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"

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
Sent: Saturday, December 30, 2006 7:05
To: 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
To: Jun Chen <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


                 Summary: GNUmake 3.81, $(error ) sometimes unable to
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



I think I've found in GNUmake 3.81 a hard-to-realize bug. This bug
$(error ) function unable to stop the whole make process. I encountered
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
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,
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!
======.  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
./configure && make .


Finally, I also post my eGmu.makefile here:


_IsP1OlderThanP2 = $(if $(wildcard $1),$(shell (if [ $1 -ot $2 ];then
echo -n
        # If file $1 not exist or older than $2, 1 is returned, else
null is
        # 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 # 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" >>
        @${MAKE} -f $(_p_mk_MakeSubPrjs)
        @echo -n "" > $@

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

$(_p_SubprjsAttrMade): $(_p_MainPrjStart)
        @$(call _ClearFile,$(_p_mki_SubprjAttr))
        @echo "\$$(error ====== Hey! you should stop here!
\$$(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



Reply to this item at:


  Message sent via/by Savannah

Bug-make mailing list

reply via email to

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