[Patches] [ python-Patches-1628061 ] Win32: Fix build when you have TortoiseSVN but no .svn/*

SourceForge.net noreply at sourceforge.net
Fri Jan 5 02:50:51 CET 2007


Patches item #1628061, was opened at 2007-01-04 17:56
Message generated for change (Comment added) made by lhastings
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1628061&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Larry Hastings (lhastings)
Assigned to: Nobody/Anonymous (nobody)
Summary: Win32: Fix build when you have TortoiseSVN but no .svn/*

Initial Comment:

Recent snazzy improvements to the Win32 build system include embedding SVN version information in the builds.  This is done by compiling a short C file, make_buildinfo.c, and running the result.  make_buildinfo.exe runs the liltingly-named SubWCRev.exe--a tool that comes with TortoiseSVN--over one of the source files, ../Modules/getbuildinfo.c, producing a second file, getbuildinfo2.c.

The code is reasonably smart; if you don't have TortoiseSVN, it doesn't bother trying, and just compiles ../Modules/getbuildinfo.c unmodified.  However: it blindly assumes that if SubWCRev.exe exists, and the system() call to run it returns 0 or greater, getbuildinfo2.c must have been successfully created.  If you have TortoiseSVN, but *don't* have the .svn/... directories in your source tree, system(SubWCRev.exe) returns 0 or greater (seemingly indicating success) but in fact fails and does *not* create getbuildinfo2.c.  When it fails in this way I see this inscrutable message in the log:
"C:\b\tortoisesvn\bin\subwcrev.exe" .. ..\Modules\getbuildinfo.c getbuildinfo2.c
SubWCRev : Path '..' ends in '..', which is unsupported for this operation

This patch changes make_buildinfo.c so that it calls _stat(getbuildinfo2.c) as a final step.  If getbuildinfo2.c exists, it returns true, else it returns false.

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

>Comment By: Larry Hastings (lhastings)
Date: 2007-01-05 01:50

Message:
Logged In: YES 
user_id=364875
Originator: YES

Good point.  I seem to have goofed up my directory in a very specific way:
when I made a copy of the tree, I explicitly did *not* copy the top-level
.svn, but I forgot to do anything about the .svn directories in the
subdirectories.  make_buildinfo is run from the "PCbuild" directory, which
still has a ".svn" directory, so the _stat(".svn") call succeeds.  But the
call to SubWCRev.exe fails because ".." (aka the Python root) doesn't have
a ".svn" directory.

I assert that the patch won't hurt anything, and will make the build
process slightly more tolerant of goof-ups like me.  If you prefer, I could
submit an alternate patch where the current directory is the Python root
and it writes to "PCbuild/getbuildinfo2.c".  Or one where the stat checks
for "../.svn" instead.  Or if you don't want any patch at all, that works
too, just close the patch.

In the meantime, I'll clean up my build tree.

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

Comment By: Martin v. Löwis (loewis)
Date: 2007-01-05 01:10

Message:
Logged In: YES 
user_id=21627
Originator: NO

This patch shouldn't be necessary. make_buildinfo2 checks whether there is
a .svn subdirectory, and if there is none, it compiles getbuildinfo.c (just
like when subwcrev.exe wasn't found).

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1628061&group_id=5470


More information about the Patches mailing list