Friday, January 19, 2007

Visual Studio 2005 missing Msi.lib

Visual Studio 2005 only installs msi.lib for the AMD-64 platform. Installing the latest Platform SDK, PSDK will install it for x86, IA-64 and AMD-64. As of this post, Microsoft Platform SDK for Windows Server 2003 R2 was the most recent version. That page should say whether or not there is a more recent version.

Once it is installed, you have to tell Visual Studio where to find the PSDK files. The file path settings are part of the Visual Studio options which are accessed from the ToolsOptions... menu item.

Under Projects and Solutions, select VC++ Directories. Then, pick each item under Show directories for looking for paths have PlatformSDK in them. Insert an entry just before it that refers to the same subdirectory under $(ProgramFiles)\Microsoft Platform SDK for Windows Server 2003 R2.

Visual Studio Options

The up- and down-arrow buttons may be used to move the new entry to the right place in the list.

Now, Rebuild any solution that needs the msi.lib library.

Tuesday, January 16, 2007

Importing Python Subversion Archive into Git

While it is not well advertised, it is possible to download a snapshot of the Python Subversion repository via rsync.
rsync -avP .
Note: I discovered later that it can be downloaded by browser as well,

Once the file is downloaded expand it:
bunzip2 projects-svn-tarballs.tar.bz2|tar xf -
Then use git-svnimport to create the baseline git repository:
git-svnimport -v -C python.git -T python/trunk -t python/tags -b python/branches file://`pwd`/projects
Following this the archive may be brought up to date and kept upto date using:
git-svnimport -v -C python.git -T python/trunk -t python/tags -b python/branches

Thursday, January 11, 2007

Importing SourceForge Subversion Projects into Git

At least for the initial import it is faster to create a local mirror of the desired repository using rsync. Taking the Simplified Wrapper and Interface Generator project, SWIG, as an example:

rsync -avz rsync://* swig.svn
Made a copy of the Subversion SWIG repository in about 10 minutes.

(On CentOS 4, I had to upgrade svn from the source to be able to access this mirror. I installed the RHEL4 RPMs that were pointed to on the Subversion download page. I needed the apr, apr-util, subversion and subversion-perl packages.)

Then I was able to import this into a git repository using:

git-svnimport -C swig.git \
This took about 13 minutes.

After importing a new repository, repacking recommended:

cd swig.git
git repack -a -d
This reduces the amount of space the repository requires. It can be significant on a large or active repository.

Future updates can then be done fairly effeciently from within the swig.git subdirectory with:
git-svnimport -C .
Because it is no longer needed, the swig.svn directory can now be deleted.

Just some statistics
While the rsync'd Subversion repository took up 238MiB, the git repository only used 63MiB. Most of this is the working copy of the code. The actual repository swig.git/.git only occupied 25MiB. (Barely a tenth of what Subversion required.)

While I could have run git-svnimport directly against the remote repository, this would have taken about 32 hours. Even using svm or SVN::Mirror in place of rsync would have required around 10 hours.

If you can use rsync or another tool to make a local copy of the repository, the import will run much more quickly.

Tuesday, January 09, 2007

Fixing Synergy Shift Behavior

When running the Synergy client on CentOS with a Window machine operating as the server, I had problems with the behavior of the [Shift] key. There was a delay from when [Shift] was pressed until it took effect and often the left [Shift] key would not take effect at all.

This was corrected by downloading, building and installing the latest source RPM from the Synergy site. You may have as much luck with the binary RPM. I just didn't try it.

Update: Fixed typo