Setting up Darcs for Laconi.ca Development
Before I went on vacation, I was writing a bit about laconi.ca and about my efforts to make it easier for developers to start contributing. One of the first hurdles to face is getting used to the version control system.
Many people I’ve spoken with are used to using CVS or SVN to get and submit code from a version control repository. I don’t know as many people that are up to speed with darcs. In my case, my hosting service already has CVS and SVN installed, but darcs is not an option. So, I spent a little time playing around to see what I could do.
Ubuntu
I have an Ubuntu box sitting on my home network. It is fairly far behind a firewall, and I only added features as I need them. Adding darcs was incredibly easy.
sudo apt-get install darcs
It install quickly and easily. I like that about Ubuntu. I downloaded laconi.ca and started hacking away.
Windows
To set up darcs on my Windows Vista machine, I went to the Darcs Wiki and read about downloading binaries. There are a bunch of options. First, do you have cygwin installed? Cygwin is a Linux like environment that you can run under windows. I’ve run it on plenty of my machines, but I just haven’t gotten around to installing it on my Vista box yet.
Ruling out Cygwin, I then had to decide if I wanted to download darcs with putty embedded. Putty is a ssh client for Windows. I already have it on my machine so I downloaded it without Putty. Getting a darcs repository this way also seemed to work well. I have subsequently run into one problem that I need to debug.
As an aside, Dan Brickley found TortoiseDarcs. I’ve used TortoiseSVN in the past and liked it, so TortoiseDarcs sound particularly promising. I’ll add that to my ‘to test’ list. In a subsequent email, he noted that the ‘send’ feature was not available, so it has dropped a little lower on my ‘to test’ list.
On a shared host Linux box
On my shared hosting service, the option for installing packages is ‘yum’. However, that requires root access, which isn’t available to me, or to most people using a shared host. Another option is to download the source and compile it. However, darcs is written Haskell and installing a complier on a shared host is often stretching things, especially since the binaries for Haskell are nearly 50 meg, uncompressing the binary tarball can really place a strain on the shared host and it expands to over 350 meg.
Fortunately, the darcs binary repository has quite a few versions of darcs already compiled and statically linked. I pulled down the i386 linux version 2.0.2 and unzipped the tarball. It worked fairly nicely.
Now, on to the fun part
On the Laconi.ca dev mailing list, Mike Cochrane spoke about some of the power of darcs. Specifically, darcs is a distributed source management system, so anyone can set up their own repositories. I wondered if this was possible for shared host users, so I tried to set it up.
With darcs working on my shared host, I pulled down the latest laconica repository. Then, I created a subdirectory on my host called repos. In that, I placed the laconica reposity. A quick test, and it looks like it is working. Anyone who wants to check out what is in my laconica repository, try
darcs get –-partial http://www.orient-lodge.com/repos/laconica
As a side note, I tried this from my Ubuntu box and it seemed to work fine. However, the Windows Vista darcs client blew up when it tried to retrieve the repository. I would love to hear other people’s experiences.
Next Steps
Now that I have a few different instances of darcs up and running, my next step is to submit some changes. I had made some changes to laconi.ca version 0.4.1 which I upgraded to version 0.4.3. However, while I’ve been away, laconi.ca has moved on to version 0.4.4 So, I need to tweak my environment.
One of my first efforts was to come up with a tarball that allows users run Laconica on shared hosts where they may not have the ability to add Pear repositories or other code that Laconica is dependent on. However, this needs to get recreated with each new release, so I’m looking at splitting this in half, so we should have a laconica dependencies tarball which, in theory, it should be possible to add to any other laconica tarball (assuming the dependencies don’t shift).
Then, I can update my instance of laconi.ca more easily. Once this is updated, I’ll work on sending some patches to Evan.
Sending Patches
When Mike spoke about the distributed nature of darcs, he suggested that people could put patches in their own repositories and then send around messages on identi.ca letting others know about the patches. A discussion could occur on identi.ca talking about these patches, if they’ve worked for everyone, etc. Then, at whatever appropriate point, the patch could be sent to Evan to be incorporated into the main tree.
I had tried this early on, and ran into two different problems. The first was that my Ubuntu box wasn’t set up to be able to send emails. I’ve since added that ability. The other was missing a simple part of how darcs works. After you have made your changes, you need to record them with
darcs record
Then you can send them by issuing the command:
darcs send
The darcs send command walks you through a set of prompts about what should be sent, to whom it should be sent, and what any comments you want to add.
So, when I get my installation upgraded, I’ll work on sending in a couple patches.