Lightweight Continuous Integration for a centrally Haskell/Darcs toolchain?
Asked Answered
V

2

10

I want some simple CI for a small dev setup. Two motivations -- a full build takes some time, and an anticipated testsuite will also take some time. I really would rather not dive headfirst into one of the big players that require a java application container or whatever to show fancy graphs with multiple colors and etc. I'd be interested in something "culturally" Haskellish in particular -- preferably command line interaction or config files, and interop with Darcs is the absolute must.

Do any such tools exist, or am I stuck with one of the big players or writing my own?

Speaking of which, I recall that there's a build farm set up for GHC. Looking at it, I notice that it used to use buildbot and now uses a custom builder. Although those are set up for a different workflow, would either of them be a simpler, more straightforward solution?

Edit: I'm going with buildbot for now. Will update with how it works out.

Edit2: Ben Lippmeier has put buildbox on hackage, which also seems to be the foundation for a native Haskell CI solution. It is currently underdocumented, and probably not feature complete for my needs, but here it is: http://hackage.haskell.org/package/buildbox. He's used it to write a buildbot for repa: http://code.haskell.org/repa/repa-head/repa-bot/.

Vanbuskirk answered 22/10, 2010 at 18:54 Comment(0)
S
3

The darcs team itself uses buildbot. I'm not certain off the top of my head where the scripts live, but I'm sure if you ask on the mailing list or IRC they should be easy to get hold of.

Sovran answered 27/10, 2010 at 4:54 Comment(1)
Thanks. I think buildbot is the best solution so far, although its been somewhat of a pain to get familiar with, and the darcs integration is somewhat underdocumented. I might try to write up my experiences after this process is through...Vanbuskirk
V
4

So here's what I did.

  1. install buildbot-server/buildslave as per instructions.
  2. install the darcs_buildbot script: https://github.com/buildbot/buildbot/blob/master/master/contrib/darcs_buildbot.py
  3. change the apply posthook in _darcs/defaults (this is for a shared repo) to the following:

apply posthook chmod a+w myrepo/_darcs/index myrepo/.darcs_buildbot-lastchange; /usr/local/bin/darcs_buildbot.py buildbotmachine:buildbotport;

apply run-posthook

As for the buildbot config file, something like the following is a simple setup:

darcsroot = "/myrepo/"

from buildbot.process import factory
from buildbot.steps.source import Darcs
from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test
f1 = factory.BuildFactory()
f1.addStep(Darcs(repourl=darcsroot))
f1.addStep(Compile(command=["ghc","--make","Setup.hs"]))
f1.addStep(Compile(command=["./Setup","configure"],warningPattern="^\(Warning:"))
f1.addStep(Compile(command=["./Setup","build"],warningPattern="^\(Warning:"))    
b1 = {'name': "buildbot-full",
      'slavename': "bot1name",
      'builddir': "full",
      'factory': f1,
      }
c['builders'] = [b1]

Schedulers, etc. also need to be configured as per docs.

Now whenever anybody pushes to the shared repo, the build is triggered. Additional test commands can be added easily as well.

So far, this has been working out great!

I think I patched the buildslave to pull incrementally rather than the full repo, but I can't remember what I did, and don't know if its still necessary with newer versions.

Vanbuskirk answered 16/12, 2010 at 16:7 Comment(0)
S
3

The darcs team itself uses buildbot. I'm not certain off the top of my head where the scripts live, but I'm sure if you ask on the mailing list or IRC they should be easy to get hold of.

Sovran answered 27/10, 2010 at 4:54 Comment(1)
Thanks. I think buildbot is the best solution so far, although its been somewhat of a pain to get familiar with, and the darcs integration is somewhat underdocumented. I might try to write up my experiences after this process is through...Vanbuskirk

© 2022 - 2024 — McMap. All rights reserved.