Vault on Unix with Mono

A collection of information about Vault, including solutions to common problems.

Moderator: SourceGear


Posts: 256
Joined: Thu Nov 06, 2003 10:01 am
Location: SourceGear
PostPosted: Fri Feb 13, 2004 1:14 pm
Due to changes in Mono and Unix which are incompatible with the .NET CLC, Vault no longer supports Mono. This article has been deprecated.

For Unix systems, use the Java Command Line Client for Vault Professional
or Vault Standard.

For Mac OS X, see the KB article Vault CLC on Mac OS X with mono or use the Java Command Line Client.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Starting with Vault 2.0, the command-line client can be run on certain Unix operating systems with the help of Mono, a free, portable .NET runtime.

Currently only Linux on IA32 has been tested. While Mono may run on many different platforms, we've ran into cases where the Vault Command Line Client does not work correctly. We'll try to work with customers and Ximian to try to resolve any platform specific problem.

Also, as of Mono 1.1.13.x, the additional libraries required by the Vault Command Line Client can be found in the mono-extras library. Installing this library along with its dependencies will be required to run Vault.


Requirements

Installing Required Software

Binary packages of ICU and/or Mono may be available for your platform. Check the download pages linked above for these files. If you don't see packages for your platform, or prefer to compile them from source, download the source code packages and follow the installation instructions for ICU, then follow the installation instructions for Mono.

You must install ICU before compiling or installing Mono. ICU is not required to compile or install Mono, but Vault has not been successfully tested on Mono installations without ICU. If you see a message like the following when running the Vault client, you probably don't have ICU installed:

Code: Select all
The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. An invalid argument was specified.


Installing Vault

SourceGear currently does not offer specific Unix packages for the Vault command-line client. Since Mono is a complete .NET run-time, the Vault command-line client and supporting libraries from Windows will run unmodified under Mono. These files can be copied from an existing installation of Vault on a Windows computer. The files are usually found in C:\Program Files\SourceGear\Vault Client\ (paths may vary depending on installation choices). Copy these files to your Unix computer:

  • vault.exe
  • SGDiff.dll
  • VCDiff.dll
  • VaultClientNetLib.dll
  • VaultClientOperationsLib.dll
  • VaultLib.dll

Update: The Vault downloads page now has a Client API zip archive with the files you need: http://www.sourcegear.com/vault/downloads.html

You can keep all of these files in one directory, and run Vault by specifying the full path to vault.exe every time (Mono will search the directory containing vault.exe for the DLL files it needs). You can also place the DLL files in any directory in your MONO_PATH environment variable (man 5 mono-config for details), and they will be found regardless of where vault.exe is placed.

Running Vault

The MONO_PATH environment variable is not searched for vault.exe, so you'll need to invoke it explicitly ("mono /path/to/vault.exe") or create an executable shell script wrapper (in your path) that runs Vault with Mono. If you're running Linux, as an alternative, you can configure the kernel's binfmt_misc module to invoke Mono automatically for all .NET executables (binfmt_misc home page).

Differences Between Vault on Unix and Windows

Although the same program files run under both Windows and Mono, there are a few small differences in the way the CLC behaves on the two platforms.

  • Repository Paths as Arguments This isn't really an issue with Vault or the .NET runtime, but rather the operating system shell. On Unix, shell variables are substituted on the command-line by the use of the dollar sign ($). Vault repository paths begin with $, so that character must be escaped with a backslash when used as an argument to Vault. For example: mono vault.exe [...] get \$/file.txt
  • Application Data Path On Unix, Vault stores its application data in ~/.config/SourceGear/, on Windows in %APPDATA%\SourceGear. Under these directories, however, the file layout is identical.
  • File Locking in Vault 1.x and 2.x [i]On Windows, Vault uses system-wide mutexes to assure only one instance of Vault is modifying its local data (including cache files, working folder data, and user settings). On Unix, no locking is performed. Do not run multiple instances of the command-line client on Unix for the same repository.

    Vault 3.0 uses the .NET library's system-wide named mutex class for locking, which works on all platforms.
  • Working Folder File Encoding Mono will honor a user's locale settings when writing and reading files in working folders. If your LC_CTYPE environment variable is set to a UTF-8 locale (the default on many Linux installations), a BOM (Byte Order Mark) will appear at the beginning of mergeable (text) files in your working folders. This mark will not be sent to the server when you check in your changes.

    You can set your LC_CTYPE environment variable to "POSIX" if you don't want UTF-8 BOM sequences in your files.
Shaw Terwilliger
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`

Return to Knowledge Base (Vault)

Who is online

Users browsing this forum: No registered users and 2 guests