[Patches] [Patch #101275] Issue a warning if Setup.in is newer than Setup

noreply@sourceforge.net noreply@sourceforge.net
Wed, 30 Aug 2000 12:19:42 -0700


Patch #101275 has been updated. 

Project: 
Category: Build
Status: Open
Summary: Issue a warning if Setup.in is newer than Setup

Follow-Ups:

Date: 2000-Aug-24 07:23
By: fdrake

Comment:
This issues a waring during the build if the generated Setup flie is older than the Setup.in file.  This is helpful in getting users to check that they have everything they need in their Setup file.  The limitation is that the warning is issued several times during a build, but it's not clear that's a serious problem, though it is potentially annoying.
-------------------------------------------------------

Date: 2000-Aug-24 08:05
By: montanaro

Comment:
This works fine for me.  My only question is whether
the use of the relatively new "-nt" flag of test is
going to be as portable as we'd like.  I notice it's
not used anywhere else in the Python makefiles or in
the configure script.  Configure only uses =, !=, -gt
and -eq.  It's a script that tries to be painfully
portable.

On the other hand, if we're requiring an ANSI C compiler,
why not a fairly recent incarnation of /bin/sh?

Other than that thought, I say check it in.

-------------------------------------------------------

Date: 2000-Aug-24 08:13
By: fdrake

Comment:
My Mandrake box doesn't have a man page for sh(1), so it may be that -nt is specific to bash; Mandrake uses a symlink to use bash as sh, so there's no way for me to tell if -nt is available under a traditional sh.  This could be a showstopper for this patch.
-------------------------------------------------------

Date: 2000-Aug-24 08:19
By: montanaro

Comment:
try "man 1 test".  -nt is actually an argument to
the test command.  Bash's builtin test command does
support -nt.

-------------------------------------------------------

Date: 2000-Aug-24 08:32
By: twouters

Comment:
BSDI 'test' does not support -nt.

-------------------------------------------------------

Date: 2000-Aug-24 09:51
By: montanaro

Comment:
In light of Thomas's comment about BSDI's test command, I
recommend this patch be postponed until 2.1.  It's minor
enough.  Still, we do need to prod people into comparing
Setup.in with preexisting Setup files, otherwise we're going
to get a lot of "not-a-bugs" once the software is made
widely available.

find(1) has a -newer predicate.  Is it safe enough to assume
it's universally available on systems that can build with
Python's Makefile?

if [ "`find . -name Setup.in -newer Setup`" = "./Setup.in" ]
then
  echo 'compare Setup and Setup.in for changes!'
fi

-------------------------------------------------------

Date: 2000-Aug-24 10:03
By: fdrake

Comment:
Postponed for Python 2.1; assigned to the release manager to re-open after 2.0 is released.

The use of find is more difficult; the whole thing must be inside a test that makes sure Setup already exists.  Also, the test should be something closer to (untested):

[ "`find $(srcdir) -name Setup.in -newer Setup`" = "$(srcdir)/Setup.in" ]
-------------------------------------------------------

Date: 2000-Aug-24 14:49
By: twouters

Comment:
Eep, don't use find. Find has more platform-specific issues than has 'test'! (Don't get me started on BSDI find, please ;)

However, I'm getting the feeling this is re-inventing the wheel. 'make' was intended for this kind of thing! And it already does the modified-time check and such: if Setup.in isn't newer than the existing Setup, the body of the rule shouldn't get called. Isn't it enough to test whether there already exists a Setup, and produce a warning if so ?



-------------------------------------------------------

Date: 2000-Aug-24 15:15
By: montanaro

Comment:
doh!  I think Thomas is onto something...

-------------------------------------------------------

Date: 2000-Aug-24 19:04
By: montanaro

Comment:
Thomas was correct.  I reworked the patch and sent a copy to
Fred.  I think this patch will ward off a lot of spurious
"2.0 won't build" messages in c.l.py and should - for that reason alone - be added to 2.0.  People are going to try building 2.0 with 1.5 Setup files.  Socket at least won't build without some Setup file tweaks.  I'm reopening it and 
assigning it back to Fred.


-------------------------------------------------------

Date: 2000-Aug-30 12:19
By: gvanrossum

Comment:
Make Setup depend on Setup.in in the Makefile. Then the rule is invoked when Setup.in is newer than Setup as well as when Setup doesn't exist yet. The rule should test whether Setup already exists and in that case issue a warning instead of overwriting Setup.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101275&group_id=5470