Veracity Q&A home login about faq

I'm interested in playing with the Veracity source. How do I set up a development environment and get Veracity to compile on Windows?

asked Jul 15 '11 at 09:21

Ian%20Olsen's gravatar image

Ian Olsen ♦♦
2.7k93355

edited Jul 15 '11 at 09:34


Introduction

Assumed - you are running Windows Vista or Windows 7, and have Visual Studio 2010 (or the equivalent SDK and NMake) installed.

Get the Source

There are two options.

or

Unpack or checkout it the directory of your choice - for brevity, we'll pretend you put it under %USERPROFILE%\v, and so your source tree begins at %USERPROFILE%\v\veracity

Install Prerequisites

Install CMake

Grab cmake 2.8.3 or later from cmake.org.

Install CMake, making sure to add cmake to the PATH variable when prompted.

Install Cygwin

Cygwin is used to run a script that builds Veracity's third-party dependencies. That is the only thing it is used for, so it is possible to build and run Veracity without installing cygwin, but you will need to build the third-party dependencies by hand instead of using the script to do it for you. It's a long process, but you can just read throught the script and and do what it would do.

Visit cygwin.com, grab and run the setup utility from there. In addition to the stock Cygwin tools, you'll also need:

  • patch (under Utils)
  • unzip (under Archive)
  • curl (under Net)

Add cygwin to PATH

C:\cygwin\bin needs to be in your path for building the third-party libraries and for running the test suite. You can add it temporarily in a command prompt, e.g.

PATH=%PATH%;C:\cygwin\bin

or add it permanently to your Windows user's path.

Create a Veracity Build Directory

You must open a Command Prompt that has the correct Visual Studio environment variables set. Go to the the Windows Start menu and select "Microsoft Visual Studio 2010" -> "Visual Studio Tools" -> "Visual Studio Command Prompt (2010)" (Or, to build them as 64-bit, choose "Visual Studio x64 Win64 Command Prompt (2010)").

From that command prompt, cmake will create a Visual Studio solution or NMake Makefiles for you. You just need to give it a place to work. For example, let's create a neighbor of our source directory.

mkdir %USERPROFILE%\v\debug

Then, to create a Visual Studio 2010 solution:

cd %USERPROFILE%\v\debug
cmake -G "Visual Studio 10" ..\veracity

Or, to create a solution for a 64-bit build:

cd %USERPROFILE%\v\debug
cmake -G "Visual Studio 10 Win64" ..\veracity

To use NMake instead, run:

cd %USERPROFILE%\v\debug
cmake -G "NMake Makefiles" ..\veracity

Add vv-thirdparty bin to PATH

The first time you perform cmake -G, the script will also download and build third party libraries Veracity needs, in %USERPROFILE%\v\vv-thirdparty, which takes a few minutes. As long as you keep your build trees in this folder, such that the build script can locate vv-thirdparty, this will only happen once.

Once vv-thirdparty is created, you'll need to add the binary directory to PATH:

set PATH=%PATH%;%USERPROFILE%\v\vv-thirdparty\x86\bin

or for 64bit builds

set PATH=%PATH%;%USERPROFILE%\v\vv-thirdparty\amd64\bin

Build Veracity

You now have a build tree, replete with Makefiles or Project files.

For Visual Studio users, simply open the solution, %USERPROFILE%\v\debug\veracity.sln, and build. Note that although the solution will contain both "Debug" and "Release" configurations, only "Debug" will build properly. To build "Release", you'll need to have CMake generate a separate release build tree. See the answer to this question for more detail.

For NMake users,

cd %USERPROFILE%\v\debug
nmake

Run the Test Suite

Only builds that have passed the test suite on all of SourceGear's in-house build machines are ever published. To run the test suite for yourself:

cd %USERPROFILE%\v\debug
ctest

All tests should pass. If there are failures, you can consult the logs.

Install Veracity

The Command Line Applications

To "install" veracity on your computer, update your PATH again, this time to include the Veracity command line tools, vv and vscript.

For Visual Studio Project users, add these to your PATH:

%USERPROFILE%\v\debug\src\cmd\Debug
%USERPROFILE%\v\debug\src\script\Debug

For NMake users, add these:

%USERPROFILE%\v\debug\src\cmd
%USERPROFILE%\v\debug\src\script

Enable the server (and bug tracking)

In order to enable Veracity's scrum bug tracking module or to run a veracity server you will also need to have a config setting called "server/files" pointed at a certain location. Run:

vv config set server/files "%USERPROFILE%\v\veracity\src\server_files"

The Tortoise Client

Important: For Tortoise, Debug and Release builds make a very big difference. Only Release builds will be loaded by Windows Explorer. Debug builds will only be loaded by Windows Explorer if there is a debugger attached to the explorer process. This is done to prevent a long-lived process from loading the dll, which would prevent the dll from being overwritten on a build.

If you want to try the Veracity Tortoise Client, which allows you to perform Veracity operations directly from Windows Explorer, you'll need to run one of the following commands from an administrator (elevated) command prompt:

If you used Visual Studio for the build, run this command:

regsvr32.exe %USERPROFILE%\v\debug\src\tortoise\VeracityShellExtension\Release\VeracityTortoise.dll

If your build was an NMake build:

regsvr32.exe %USERPROFILE%\v\debug\src\tortoise\VeracityShellExtension\VeracityTortoise.dll

Note for 64-bit users: Windows Explorer on 64-bit systems is a 64-bit process. You must build Veracity as 64-bit in order to integrate with it.

link
This answer is marked "community wiki".

answered Jul 15 '11 at 09:27

Ian%20Olsen's gravatar image

Ian Olsen ♦♦
2.7k93355

edited Mar 05 at 08:47

Andy%20Tidball's gravatar image

Andy Tidball ♦
676316

In the "Build vv-thirdparty" section you say "This will create the vv-thirdparty folder at %USERPROFILE%\v\vv-thirdparty." actually, it creates the folder at %USERPROFILE%\v\veracity\vv-thirdparty.
cmaking the Build-Directory expects %USERPROFILE%\v\vv-thirdparty and creates it, if not present. Therefore the whole "Build vv-thirdparty" section can be skipped. (And should be imo, downloading the whole thirdparty stuff a second time can be annoying...)

(Nov 26 '11 at 07:58) Arne Mertz
1

Hi Ian, I am building Veracity again - the Problem with the thirdparty build remains, could you fix either your description or the thirdparty build-script?

Regards, Arne

(Jan 07 at 08:23) Arne Mertz
1

@Arne Sorry about that. Fixed. The other platforms' instructions should get updated later today.

(Jan 09 at 08:36) Ian Olsen ♦♦

You need C:\cygwin\bin in your path when vv-thirdparty gets built (and when running the test suite). That's probably why you have no zlib headers. I've updated the instructions again with that change.

(Jan 09 at 09:55) Ian Olsen ♦♦

see my last comment - even with C:\cygwin\bin in the path I get those errors.

(Jan 09 at 10:21) Arne Mertz

Was it in the path when vv-thirdparty was created?

If that's not the issue, the next thing to check would be the zlib build log: vv-thirdparty/builds-[amd64/x86]/zlib-1.2.5/build_log.txt.

(Jan 09 at 10:27) Ian Olsen ♦♦

ok, I think I got it: when I first tried to build the solution files, cmake noticed the vv-thirdparty folder wasn't there at all, so it tried to build vv-thirdparty but because of the missing cygwin path it failed after creating the directories (vv-thirdparty/builds-x86 existed but was empty)
on the second try with the cygwin path set correctly it just saw the vv-thirdparty directory an assumed everything was in place - and failed because there was nothing but the directory

So, setting the path and deleting the vv-thirdparty dir did the job. Thanks for the hint and for your patience :)

(Jan 09 at 12:30) Arne Mertz

Arne - when you're compiling at the end with cygwin in your path - where in your path is cygwin\\bin? It needs to come after the visual studio directories, otherwise VS may pick up cygwin's link and/or lib commands instead of its own. Not sure that's what's happening here, but it's a definite possibility.

(Jan 10 at 09:53) Paul Roub ♦♦
showing 5 of 8 show all

Small missing step: after running CMake to generate the Solution files, one has to add the thirdparty binary directory to the PATH:

set PATH=%PATH%;%USERPROFILE%\v\vv-thirdparty\x86\bin

or for 64bit builds

set PATH=%PATH%;%USERPROFILE%\v\vv-thirdparty\amd64\bin

@Ian: please feel free to delete the mess I left behind with all those comments ;)

/edit: is it possible to extend the path in the solution someway? Just a thought...

link

answered Jan 13 at 11:36

Arne%20Mertz's gravatar image

Arne Mertz
52061529

edited Jan 13 at 11:40

Thanks, I've fixed that. (Also fwiw, my reply email was rejected by your mail server just now.)

(Jan 13 at 11:51) Ian Olsen ♦♦

fixed the mail server config. Sorry for that.

(Jan 13 at 11:55) Arne Mertz

Looked a bit into it - to avoid appending the thirdparty dir to %PATH% every time before you open the solution, you can add the directory to the executable directories in the projects that need thirdparty stuff. Currently those are sghelpsource and template_check. Take the following steps for each of the projects:
- Right-click on the project in the project explorer, select "properties"
- Navigate to "Configuration Properties -> VC++ Directories"
- Append the absolute path or $(SolutionDir)..vv-thirdpartyx86bin (or corresponding amd64-Path) to the row "Executable Directories"

(Jan 14 at 09:10) Arne Mertz
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×22
×13

Asked: Jul 15 '11 at 09:21

Seen: 1,934 times

Last updated: Mar 05 at 08:47

powered by OSQA