This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Win32: Fix build when you have TortoiseSVN but no .svn/*
Type: Stage:
Components: Build Versions: Python 3.0
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: larry, loewis
Priority: normal Keywords: patch

Created on 2007-01-04 17:56 by larry, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
lch.makebuildinfo.diff.txt larry, 2007-01-04 17:56 patch to fix PCbuild when you have TortoiseSVN but no .svn/* dirs
Messages (4)
msg51648 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2007-01-04 17:56
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.
msg51649 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-01-05 01:10
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).
msg51650 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2007-01-05 01:50
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.
msg51651 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-01-06 13:50
Ok, rejecting the patch then. The typical case would be that you have an exported tree, in which case there wouldn't be any .svn directories at all. As I'm sure you know, you can easily fix your installation by removing the .svn directory from PCBuild also.
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44410
2008-01-06 22:29:46adminsetkeywords: - py3k
versions: + Python 3.0
2007-01-04 17:56:38larrycreate