<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Saved for later reference &#187; subversion</title>
	<atom:link href="http://www.lejordet.com/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lejordet.com</link>
	<description>online repository of stuff I had to google for hours to figure out</description>
	<lastBuildDate>Fri, 03 Sep 2010 11:46:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Making a Trac install work on Apache 2.2/Python 2.6/win32, 2010 edition</title>
		<link>http://www.lejordet.com/2010/01/making-a-trac-install-work-on-apache-2-2python-2-6win32-2010-edition/</link>
		<comments>http://www.lejordet.com/2010/01/making-a-trac-install-work-on-apache-2-2python-2-6win32-2010-edition/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 11:14:25 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python2.6]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=98</guid>
		<description><![CDATA[A year ago making Trac work on Python 2.6/win32 was a lot of work, including having to compile your own Python SVN bindings. This is an update of that old article assuming the usage of pre-built PySVN bindings.]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: normal;">About 10 months ago I wrote a 
<a  href="http://www.lejordet.com/2009/03/making-a-trac-install-work-on-apache-22python-26win32/">short article</a> on getting 
<a title="Trac"  href="http://trac.edgewall.org/" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/');" >Trac</a> to work on Python 2.6 and Windows. Recently I updated the install, and took a look at how the situation is now.</span></p>
<p>This guide assumes you have a working install of Trac on Python 2.5/mod_python/Apache2.2 already, as described in the 
<a  href="http://trac.edgewall.org/wiki/TracInstall" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/wiki/TracInstall');" >Trac install guide</a>, and that 
<a  href="http://www.python.org/download/releases/2.6.4/" onclick="javascript:pageTracker._trackPageview('/external/www.python.org/download/releases/2.6.4/');" >Python 2.6</a> is installed.</p>
<p>What needs to be done:</p>
<ul>
<li>Install Python 2.6 and Trac for 2.6</li>
<li>Build a new version of mod_python</li>
<li>Optionally Replace Apache DLLs (mostly if you followed my previous guide)</li>
</ul>
<h2>Required software</h2>
<p>You&#8217;ll need 
<a  href="http://www.microsoft.com/express/vc/" onclick="javascript:pageTracker._trackPageview('/external/www.microsoft.com/express/vc/');" >Visual C++ 2008 Express Edition</a> or any retail version of VS 2008 if you want to build your own mod_python for 2.6 (I&#8217;ll provide a precompiled one in this post).</p>
<h2>Preparing</h2>
<p>Install Python 2.6 and 
<a  href="http://trac.edgewall.org/wiki/TracInstall" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/wiki/TracInstall');" >Trac on 2.6</a> (using &#8220;
<a  href="http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install" onclick="javascript:pageTracker._trackPageview('/external/peak.telecommunity.com/DevCenter/EasyInstall?installing-easy-install');" >easy_install</a> trac&#8221; is recommended)</p>
<p>You&#8217;ll probably also want to easy_install 
<a  href="http://pygments.org/" onclick="javascript:pageTracker._trackPageview('/external/pygments.org/');" >Pygments</a> for source highlighting.</p>
<h2>Building mod_python for 2.6</h2>
<p>This 
<a  href="http://badwords.org/w/Compile_mod_python_for_Python_2.6.1" onclick="javascript:pageTracker._trackPageview('/external/badwords.org/w/Compile_mod_python_for_Python_2.6.1');" >guide to mod_python</a> covers the creation and installation of a compatible version of the module.</p>
<p>At this point, you should be able to restart Apache and load up your &#8220;old&#8221; Trac on Python 2.6, but with the error message that &#8220;svn&#8221; support is not installed.</p>
<p>A pre-built version of this can be found here: 
<a  href="http://vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6.exe" onclick="javascript:pageTracker._trackPageview('/external/vagabonds.info/python/mod_python-3.3.2-dev-20080819.win32-py2.6.exe');" >mod_python-3.3.2-dev-20080819.win32-py2.6.exe</a></p>
<h2>Python SVN bindings</h2>
<p>My 
<a  href="http://www.lejordet.com/2009/03/making-a-trac-install-work-on-apache-22python-26win32/">old guide</a> had instructions on how to build these yourself, but after that article was made, 
<a  href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100" onclick="javascript:pageTracker._trackPageview('/external/subversion.tigris.org/servlets/ProjectDocumentList');" >&#8220;official&#8221; Python 2.6 bindings</a> have been released.</p>
<p>Most recent version as of this writing is the 
<a  href="http://subversion.tigris.org/files/documents/15/46888/svn-python-1.6.6.win32-py2.6.exe" onclick="javascript:pageTracker._trackPageview('/external/subversion.tigris.org/files/documents/15/46888/svn-python-1.6.6.win32-py2.6.exe');" >SVN 1.6.6 version of the bindings</a>.</p>
<h2>Replacing Apache DLLs to make libsvn work</h2>
<p><em>Note: Only use these instructions if you experience problems, and/or you&#8217;re running a self-built version of the Python SVN bindings already.</em></p>
<p>There&#8217;s a slight difference between libapr-1.dll as supplied with Apache 2.2 and the one we built together with libsvn, so 
<a  href="http://trac.edgewall.org/ticket/6739#comment:9" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org/ticket/6739?comment:9');" >the fix</a> is to replace the one in your Apache2.2\bin folder with the one from your Python2.6\Lib\site-packages\libsvn folder (copy the libsvn_*.dlls from the same folder into the Apache2.2\bin folder if you still get problems).</p>
<p>Restarting Apache now should make Trac work fully, with Subversion support.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2010/01/making-a-trac-install-work-on-apache-2-2python-2-6win32-2010-edition/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Compiling Subversion Python bindings on Windows</title>
		<link>http://www.lejordet.com/2009/03/compiling-subversion-python-bindings-on-windows/</link>
		<comments>http://www.lejordet.com/2009/03/compiling-subversion-python-bindings-on-windows/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 12:26:15 +0000</pubDate>
		<dc:creator>Lars Erik Jordet</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python2.6]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.lejordet.com/?p=3</guid>
		<description><![CDATA[A step-by-step how-to on compiling the svn/libsvn Python 2.6 modules on Windows, using the free compiler Visual C++ Express 2008]]></description>
			<content:encoded><![CDATA[<p>I tried finding good instructions on building the Python SVN bindings (for use with 
<a  href="http://trac.edgewall.org" onclick="javascript:pageTracker._trackPageview('/external/trac.edgewall.org');" >Trac</a>), but the included readme file is based on Visual C++ 5.0/6.0 (which I remember using back in &#8217;98), and leaves out a few crucial steps.</p>
<p>So, this how-to will explain the process of building SVN bindings for Python 2.6 on Windows.</p>
<h2>What you&#8217;ll need:</h2>
<ul>
<li>
<a  href="http://www.microsoft.com/express/vc/" onclick="javascript:pageTracker._trackPageview('/external/www.microsoft.com/express/vc/');" >Visual C# 2008 Express Edition</a> (Visual Studio 2008 will also work, but will base this on free downloads)</li>
<li>
<a  href="http://www.swig.org/download.html" onclick="javascript:pageTracker._trackPageview('/external/www.swig.org/download.html');" >Swig</a> (I used swigwin-1.3.39 specifically, but any newer version should do)</li>
<li>
<a  href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&amp;expandFolder=74" onclick="javascript:pageTracker._trackPageview('/external/subversion.tigris.org/servlets/ProjectDocumentList');" >Subversion source</a> &#8211; grab both the source file subversion-1.6.0.zip and the dependencies subversion-deps-1.6.0.zip</li>
</ul>
<h2>Preparing</h2>
<p>Start with installing VC++ 2008 Express and Python if you haven&#8217;t already, then create a folder to store the source trees (I used C:\Temp &#8211; and will use that folder in the instructions here for simplicity). Unpack Swig to C:\Temp\swig, and subversion-1.6.0.zip and subversion-deps-1.6.0.zip to C:\Temp (which should create the folder &#8220;C:\Temp\subversion-1.6.0&#8243;).</p>
<p>Make sure you have C:\Python26 in your path.<br />
<span id="more-3"></span></p>
<h2>Creating the Visual Studio solution and compiling</h2>
<p>Open a command prompt, go to C:\Temp\subversion-1.6.0, and run the following command:</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gen-make.py -t vcproj --vsnet-version=<span style="color: #cc66cc;">2008</span> --with-swig=C:\Temp\swig --with-zlib=C:\temp\subversion-1.6.0\zlib --with-apr=C:\Temp\subversion-1.6.0\apr --with-apr-util=C:\Temp\subversion-1.6.0\apr-util --with-apr-iconv=C:\Temp\subversion-1.6.0\apr-iconv</div></td></tr></tbody></table></div>
<p><em>The paths MUST be absolute like that, using &#8220;..\swig&#8221; will not work.</em></p>
<p>This will create the file subversion_vcnet.sln in the folder you&#8217;re in &#8211; we&#8217;ll leave this for a second to build some of the dependencies.</p>
<p>Open the file C:\Temp\subversion-1.6.0\apr\apr.dsw and select &#8220;Yes to all&#8221; to convert it to VS2008 format, set the build configuration to &#8220;Release&#8221;, and build.</p>
<p>Do the same thing with C:\Temp\subversion-1.6.0\apr-util\aprutil.dsw (this will ask if you want to use the .vcproj files you already converted in the previous step, answer &#8220;Yes&#8221; to this) &#8211; set to &#8220;Release&#8221; and build.</p>
<p>Open C:\Temp\subversion-1.6.0\subversion_vcnet.sln in Visual C++ (if you&#8217;re using the Express edition, you&#8217;ll get a few error messages about project folders not being supported, this won&#8217;t affect anything, so just &#8220;OK&#8221; them), set build configuration to Release (since Python 2.6 by default comes without debug DLLs), and build the sub-project &#8220;__SWIG_PYTHON__&#8221;.</p>
<p>This should compile with no errors (and few warnings).</p>
<h2>Creating the libraries</h2>
<p>Now you have all the files you need in C:\Temp\subversion-1.6.0\Release\subversion, so we&#8217;ll create the folder C:\Temp\svnpy to hold our &#8220;result&#8221;.</p>
<p>First, copy the folder C:\Temp\subversion-1.6.0\subversion\bindings\swig\python\svn to C:\Temp\svnpy\svn (this is the pure-python part of the library)</p>
<p>Then, create the folder C:\Temp\svnpy\libsvn and copy C:\Temp\subversion-1.6.0\subversion\bindings\swig\python\*.py here (these are the Swig interface files to the compiled library)</p>
<p>Do a Windows search for &#8220;*.dll&#8221; in C:\Temp\subversion-1.6.0\Release\subversion (since this will give you a single list of all DLLs in subfolders) and copy all of them to C:\Temp\svnpy\libsvn</p>
<p>Finally, rename all the DLLs starting with underscore (_core, _fs, _delta, _diff, _ra, _wc) from *.dll to *.pyd.</p>
<p>Copy svn and libsvn from C:\Temp\svnpy into C:\Python26\Lib\site-packages to install them.</p>
<h2>Testing svn</h2>
<p>From a Python command line, try the following:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> svn <span style="color: #ff7700;font-weight:bold;">import</span> core</div></td></tr></tbody></table></div>
<p>If this doesn&#8217;t throw any errors, you have a working libsvn build!</p>
<h2>Troubleshooting</h2>
<p>The most common error is getting an exception that says: <em>&#8220;_mod&#8221; is undefined.</em></p>
<p>To see the <em>real</em> error, try running the command:</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> libsvn <span style="color: #ff7700;font-weight:bold;">import</span> _core</div></td></tr></tbody></table></div>
<p>If the error says &#8220;DLL load failed: The specified procedure could not be found.&#8221;, check if you got all the .dlls copied over from the Release directory &#8211; they need to be from your build &#8211; even if this is svn 1.6.0, I couldn&#8217;t get the &#8220;official&#8221; 1.6.0 .dlls to work.</p>
<p>If the error is &#8220;please reinstall the application&#8221;, and there&#8217;s an entry in the Windows Event Log to the effect of</p>
<blockquote><p>&#8220;<span class="status-body"><span class="entry-content">Resolve Partial Assembly failed for Microsoft.VC90.DebugCRT. The referenced assembly is not installed on your system.&#8221;</span></span></p></blockquote>
<p><span class="status-body"><span class="entry-content">it means one or more of the libsvn*.dlls were compiled in debug mode (even if you set Release when building).</span></span></p>
<p>To fix this, open the VC++ 2008 solution again, Ctrl-select all the projects starting with &#8220;lib&#8221;, Properties, Linker-&gt;Debug, and turn off debugging. Re-compile the entire solution, and rebuild the modules as described under <em>&#8220;Creating the libraries&#8221;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejordet.com/2009/03/compiling-subversion-python-bindings-on-windows/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->