[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Making the Windows Build Easier

From: Ben Reser <ben_at_reser.org>
Date: Sat, 13 Apr 2013 17:46:12 -0700

As we've discussed previously a big part of the problem in getting the
Windows build working has been getting the dependencies built.
Everyone I've talked to manages to get this done, then has no idea how
to duplicate what they've done.

This past week I wanted to use some static analysis tools that were
only available on Windows. So I set out to build Subversion on
Windows. I spent about 2 days fighting with it, taking notes the
whole way so I could try and reproduce it. On the 3rd day I realized
that taking notes wasn't going to work and that by the time I finished
I'd have some instructions that left some important detail out or
didn't explain it fully. So I started writing a script to automate
this annoying process.

The result is the build-svn-deps-win.pl script that I've commited in r1467714.

This script is far from perfect. It still needs some work on it, but
it's probably about 90% of the way there to turning setting up a
Windows development environment into about an hour effort from a
couple day slog that you have no hope of being able to reproduce.

A lot of credit goes to pburba for his blog post here:
http://blogs.collab.net/subversion/building-subversion-on-windows-a-walk-through

Without it I would have spent even more time doing this than I did.

So with all that said, here are some details.

It downloads the following things:
bdb
zlib
pcre
httpd
apr
apr-util
apr-iconv
sqlite-amalgamation
serf

It builds all of the above expect for sqlite and serf which get built
as part of the Subversion build itself (zlib could be built there as
well but I built it so that mod_deflate would work in httpd).

The script is built to use an entirely modern tool chain and
dependencies. Everything is the current released version. That means
httpd-2.4.4, Visual Studio 2012, etc... It does not build or deal
with neon, though that could be trivially added.

Unfortunately, it does not work with Visual Studio 2012 Windows
Desktop Express due to the lack of devenv.(com|exe). However, the
script is written to produce a the binaries in a way that they can be
packaged. There's still some work to do here in making the package as
minimal as possible (some of it possibly in our build system).

At current the script only builds a Win32 Release build. But I expect
to change that in the near future.

So without further ado, here are some instructions:

1) Get the dependencies. If you have a full version of Visual Studio
(not an Express version) you can follow a) or b) depending on your
preference. For Visual Studio Express you have to follow b).

a) Pick a location to do the build and make a directory to build the
deps, in my case I put it in C:\Users\breser\svn-trunk-deps. Download
the script at http://svn.apache.org/repos/asf/subversion/trunk/tools/dev/build-svn-deps-win.pl
and put it in this directory. Open the script in a text editor and
make sure you install the few dependencies you'll need (Perl, Python,
7-Zip and CMake). Python actually may not be needed for this but it's
needed for the Subversion build itself. If presented the option to
add the commands to your path accept it (Python and Perl will do this
by default, CMake you have to explicitly decide to do this). 7-zip
doesn't have one so make a note of where you installed it for later.
Once you have the dependencies downloaded open the "VS2012 x86 Native
Tools Command Prompt" (usually found in the Visual Studio Tools
group). cd to your directory and run build-svn-deps-win.pl. If
7z.exe is not in "C:\Program Files\7-Zip\7z.exe" you can override this
by passing "SEVEN_ZIP=C:\Path\To\7z.exe" to the script. The script
will then download and build the dependencies for you. For me on my
VM setup it takes about 45 minutes for this to run.

b) Download http://ben.reser.org/svn-windows-deps/svn-trunk-deps-win32-release-20130413.7z
and extract it. You can rename the folder but it should be named
svn-trunk-deps. In my case I put it in
C:\Users\breser\svn-trunk-deps. The file is 116MB and it's compressed
with 7-zip (sorry but it was less than half the size using 7-zip over
normal zip). You'll need at least Python which you can find a URL to
at the top of the build-svn-deps-win.pl script in the svn-trunk-deps.
You may need Perl but I'm not sure, I had it on my setup since I was
originally trying to do step a with Express. You won't need CMake for
sure though. There is a GPG signature of the file for the
appropriately cautious:
http://ben.reser.org/svn-windows-deps/svn-trunk-deps-win32-release-20130413.7z.asc

2) Get Subversion's source. At this point I haven't tested this with
anything other than trunk, so you'll need a Subversion client to do a
checkout.

3) Configure Subversion. In the VS2012 Command Prompt cd into the
Subversion source you checked out and run the following (adjusting the
paths so that C:\Users\breser\svn-trunk-deps is wherever you put the
dependencies:
gen-make.py -t vcproj --vsnet-version=2012
--with-berkeley-db=c:\Users\breser\svn-trunk-deps
--with-httpd=c:\Users\breser\svn-trunk-deps\build\httpd
--with-serf=c:\Users\breser\svn-trunk-deps\serf
--with-sqlite=c:\Users\breser\svn-trunk-deps\sqlite-amalgamation
--with-zlib=c:\Users\breser\svn-trunk-deps\build\httpd\srclib\zlib
--with-openssl=c:\Users\breser\svn-trunk-deps\build\httpd\srclib\openssl

4) Build Subversion. Once that finishes run the following in the came
command prompt:
msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release

5) Test Subversion.

Before testing Subversion you need to set the PATH to include the bin
dir in the deps directory (otherwise tests will fail due to missing
libapriconv-1.dll):
set PATH=c:\Users\breser\svn-trunk-deps\bin;%PATH%

The following command can be used to test Subversion with ra_local:
win-tests.py --release --parallel

The following command can test it with ra_serf (and will start httpd for you):
win-tests.py --release --httpd-dir=C:\Users\breser\svn-trunk-deps --httpd-daemon
[For some reason for me ra_serf fails with parallel, which speeds up the tests]

The following command can test it with ra_svn (and will start svnserve for you):
win-tests.py --release --parallel --url=svn://localhost
Received on 2013-04-14 02:46:46 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.