zsh-workers
 help / color / mirror / code / Atom feed
* make oddity
@ 2010-12-20 17:15 Peter Stephenson
  2010-12-20 21:01 ` Peter Stephenson
  2010-12-21  2:46 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Stephenson @ 2010-12-20 17:15 UTC (permalink / raw)
  To: Zsh hackers list

I had to work around a problem with make in releasing 4.3.11: in
previous releases 'make' from a clean directory performed the equivalent
of 'make prep' in the Src directory, this time it didn't.  I assume that
there's some dependency missing (the standard answer) and that the
timestamps of two files have somehow got out of order so some assumption
isn't valid any more.

Here's the change I committed to work around it (with a later change to
fix a minor unintentional slip with the phony files that it's not worth
updating the release for).  As it works well enough in practice I'm not
going to waste time on it, but maybe somebody can see more quickly than
I can why this step should have happened automatically in everything up to
4.3.10-test-3 but doesn't in the 4.3.11 release without the change.

Index: Makefile.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Makefile.in,v
retrieving revision 1.16
retrieving revision 1.18
diff -p -u -u -r1.16 -r1.18
--- Makefile.in	18 Dec 2010 23:03:20 -0000	1.16
+++ Makefile.in	20 Dec 2010 16:51:25 -0000	1.18
@@ -221,7 +221,10 @@ mostlyclean-modules clean-modules distcl
 
 install.modules uninstall.modules \
 modobjs modules headers proto $(MAIN_OBJS) zsh.export: Makemod
+	@if [ ! -f Builtins/Makefile.in ]; then \
+	   $(MAKE) prep; \
+	fi
 	@$(MAKE) -f Makemod $(MAKEDEFS) $@
-.PHONY: install.modules uninstall.modules
+.PHONY: install.modules uninstall.modules headers proto
 
 $(MAIN_OBJS): $(sdir)/zsh.h

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: make oddity
  2010-12-20 17:15 make oddity Peter Stephenson
@ 2010-12-20 21:01 ` Peter Stephenson
  2011-01-09 17:00   ` Peter Stephenson
  2010-12-21  2:46 ` Bart Schaefer
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2010-12-20 21:01 UTC (permalink / raw)
  To: Zsh hackers list

On Mon, 20 Dec 2010 17:15:47 +0000
Peter Stephenson <pws@csr.com> wrote:
> I had to work around a problem with make in releasing 4.3.11: in
> previous releases 'make' from a clean directory performed the equivalent
> of 'make prep' in the Src directory, this time it didn't.  I assume that
> there's some dependency missing (the standard answer) and that the
> timestamps of two files have somehow got out of order so some assumption
> isn't valid any more.
> 
> Here's the change I committed to work around it (with a later change to
> fix a minor unintentional slip with the phony files that it's not worth
> updating the release for).  As it works well enough in practice I'm not
> going to waste time on it, but maybe somebody can see more quickly than
> I can why this step should have happened automatically in everything up to
> 4.3.10-test-3 but doesn't in the 4.3.11 release without the change.

Inevitably I did waste time on it.

I can't for the life of me see how "prep" in Makemod ever got executed
other than by an explicit "make prep".  Surely it should be done when
the timestamp for the module file gets made?

Index: Src/Makefile.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Makefile.in,v
retrieving revision 1.18
diff -p -u -r1.18 Makefile.in
--- Src/Makefile.in	20 Dec 2010 16:51:25 -0000	1.18
+++ Src/Makefile.in	20 Dec 2010 20:56:10 -0000
@@ -221,9 +221,6 @@ mostlyclean-modules clean-modules distcl
 
 install.modules uninstall.modules \
 modobjs modules headers proto $(MAIN_OBJS) zsh.export: Makemod
-	@if [ ! -f Builtins/Makefile.in ]; then \
-	   $(MAKE) prep; \
-	fi
 	@$(MAKE) -f Makemod $(MAKEDEFS) $@
 .PHONY: install.modules uninstall.modules headers proto
 
Index: Src/Makemod.in.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Makemod.in.in,v
retrieving revision 1.7
diff -p -u -r1.7 Makemod.in.in
--- Src/Makemod.in.in	1 Feb 2008 11:31:38 -0000	1.7
+++ Src/Makemod.in.in	20 Dec 2010 20:56:10 -0000
@@ -116,8 +116,9 @@ prep:
 	done
 .PHONY: prep
 
-headers prep: $(dir_src)/modules.stamp
+headers: $(dir_src)/modules.stamp
 $(dir_src)/modules.stamp: $(MDDS)
+	$(MAKE) -f $(makefile) $(MAKEDEFS) prep
 	echo 'timestamp for *.mdd files' > $@
 .PHONY: headers
 
-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: make oddity
  2010-12-20 17:15 make oddity Peter Stephenson
  2010-12-20 21:01 ` Peter Stephenson
@ 2010-12-21  2:46 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2010-12-21  2:46 UTC (permalink / raw)
  To: Zsh hackers list

On Dec 20,  5:15pm, Peter Stephenson wrote:
}
} I had to work around a problem with make in releasing 4.3.11: in
} previous releases 'make' from a clean directory performed the equivalent
} of 'make prep' in the Src directory, this time it didn't.

Oops.  This must in some way be my fault.  On Saturday last I committed
this change:

Index: Src/Makefile.in
@@ -109,7 +109,7 @@
 
 @CONFIG_MK@
 
-Makemod prep: $(CONFIG_INCS) $(dir_top)/config.modules
+Makemod: $(CONFIG_INCS) $(dir_top)/config.modules
        @case $(sdir_top) in \
            /*) top_srcdir=$(sdir_top) ;; \
            *) top_srcdir=$(subdir)/$(sdir_top) ;; \
@@ -119,6 +119,7 @@
            '$$top_srcdir/$(subdir)/mkmakemod.sh $(subdir) Makemod'; \
        cd $(dir_top) && \
            $(SHELL) $$top_srcdir/$(subdir)/mkmakemod.sh $(subdir) Makemod
+prep: Makemod
        @$(MAKE) -f Makemod $(MAKEDEFS) prep || rm -f Makemod
 .PHONY: prep
 

This has been working fine for me here for literally years, so I didn't
expect it to cause any disruption.  The reason for the change is so
that "make prep" doesn't needlessly re-run mkmakemod.sh, which I found
to be stepping on something or other (I forget now what, it's been a
very long time ago).  However, apparently in some circumstances that I
simply must never have tested, Makemod is implicitly rebuilt and that
fails to implicitly rebuild "prep".

PWS's change in 28544 re-introduces that explicit "make prep" at another
place in the build, but without the explicit removal of Makemod if the
action fails.  Seen from this perspective I realize the change I made to
Makefile.in missed an important point, which is that Makemod can't be
considered successfully built unless "make prep" succeeds ... my change
has inadvertently removed that condition.

I'm not certain of the best way to resolve all the issues.  It would
seem that Makemod and prep, taken as targets, have a strange partial
dependency on one another:  prep can't be run withoug Makemod, and
Makemod is built by mkmakemod.sh, but Makemod isn't done unless prep
has been successful; conversely, if nothing else has changed and prep
succeeded before, then mkmakemod.sh isn't needed for prep.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: make oddity
  2010-12-20 21:01 ` Peter Stephenson
@ 2011-01-09 17:00   ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2011-01-09 17:00 UTC (permalink / raw)
  To: Zsh hackers list

On Mon, 20 Dec 2010 21:01:21 +0000
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> I can't for the life of me see how "prep" in Makemod ever got executed
> other than by an explicit "make prep".  Surely it should be done when
> the timestamp for the module file gets made?
> 
> Index: Src/Makefile.in
> Index: Src/Makemod.in.in

I committed this patch (28544), slightly unintentionally.  I suspect it
doesn't materially affect the problem Bart was having one way or the
other.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-09 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-20 17:15 make oddity Peter Stephenson
2010-12-20 21:01 ` Peter Stephenson
2011-01-09 17:00   ` Peter Stephenson
2010-12-21  2:46 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).