Posts tagged 'vc'

Samba 4 and OpenChange daily Ubuntu packages

Daily builds

As of a month ago there are Ubuntu archives with fresh packages of Samba 4 and OpenChange, built on a daily basis day from the latest upstream revision.

This means that it is now possible to run a version of Samba 4 that is less than 24 hours old, without having to know how to extract source code from the version control system that upstream is using, without having to know how to build and install an application from source, but perhaps most importantly: without having to go through the tedious process of manually updating the source code and rebuilding.

OpenChange is tightly coupled to Samba 4, so installing a new version of OpenChange usually involves installing a new version of Samba 4 as well. To make matters more confusing, the two projects use different version control systems (Samba 4 is in Git, while OpenChange is in Subversion) and different build systems (Samba 4 uses waf, OpenChange uses autoconf and make).

I have been involved in Samba 4 and OpenChange as an upstream developer and more recently also as a packager for both Debian and Ubuntu.

As an upstream developer for both these projects it is important for me that users can easily run the development versions. It makes it possible for interested users to confirm the fixes for issues they have reported and to test new features. The more users run the development version, the more confident I can be as a developer that doing a release will not cause any unexpected surprises.

As a packager it is useful to know when there are upstream changes that are going to break my package with the next release.

Recipes

The daily builds work using so-called recipes which describe how to build a Debian source package from a set of Bazaar branches. For example, the Samba 4 recipe looks like this:

1
2
3
4
# bzr-builder format 0.2 deb-version 4.0.0~alpha14~bzr{revno}~ppa{revno:packaging}+{revno:debian}
lp:samba
merge debian lp:~samba-team/samba/unstable
merge packaging lp:~samba-team/samba/4.0-ppa-maverick

This dictates that a source package should be built by taking the upstream Samba branch and merging the Debian packaging and some recipe-specific tweaking. The last bit on the first line indicates the version string to be used when generating a changelog entry for the daily build.

Every night Launchpad (through bzr-builder) merges these branches and attempts to build the resulting source package, e-mailing me in case of build problems. Generally I fix issues that come up by committing directly to upstream VCS or to the Debian packaging branch. There is no overhead in maintaining the daily build after I’ve set it up.

For more information on creating source package recipes, see getting started.

Toolchain

The entire toolchain that does the daily package builds for Ubuntu is Free Software, and I have contributed to various bits of that toolchain over the years. It’s exciting to see everything come together.

Soyuz

Launchpad consists of multiple pillars - one of those pillars is Soyuz, which I hack on as part of my day job at Canonical. Soyuz is responsible for the archive management and package building. Debian source packages (a combination of upstream source code and packaging metadata) get uploaded by users and then built for various architectures on our buildfarm and published to the Ubuntu archive or to users personal package archives.

Launchpad-code

Another pillar of Launchpad is Launchpad-code, which is responsible for the hosting and management of version control branches. Launchpad users can either host their branches on Launchpad directly or mirror branches (either native Bazaar branches or branches in a foreign format such as Subversion, Git or Mercurial). The mirrorring of native and foreign branches happens using standard Bazaar API’s. In the case of Samba and OpenChange we import the branches of the upstream projects (Samba is in Git, OpenChange is in Subversion) and the packaging for both projects is in Bazaar.

Launchad-code calls out to Bazaar to do the actual mirrorring. Over the last few years I have done a lot of work to improve Bazaars support for foreign branches, in particular on supporting Subversion, Git and Mercurial. As the code mirrorring in Launchpad is one of the biggest users of bzr-svn and bzr-git it has helped find some of the more obscure bugs in those plugins over the last few years, to the point where there are only a handful of issues with Git imports and Subversion imports left.

bzr-git and dulwich

bzr-git provides transparent access to Git repositories from within Bazaar and is built on top of Dulwich. Dulwich is a Python library that provides access to the Git file formats and protocols that is completely independent of Bazaar. James Westby originally started it and I adopted it for bzr-git and further extended it. There are now several other projects that use it as well, including hg-git, and rabbitvcs. Apart from James and myself, almost two dozen other people have contributed it so far.

bzr-svn and subvertpy

bzr-svn provides transparant access to Subversion repositories in Bazaar. When I grew frustrated with the existing Subversion Python bindings for various reasons, I decided to create independent Python bindings for Subversion from scratch. These bindings have since been split out into a separate project - subvertpy - and other projects have since also started using them, e.g. hgsubversion and basie.

Using the daily builds

To use the Samba 4 and OpenChange daily builds (Ubuntu Maverick only for now), run:

1
2
$ apt-add-repository ppa:samba-team/ppa
$ apt-add-repository ppa:openchange/daily-builds

Currently Playing: Karnivool - Themata

comments.

Bazaar for dvcs users

John Goerzen has been evaluating various version control systems and his blogs posts on the subject have been interesting. One of the most interesting points he raises about Bazaar is that there is no “darcs send”-like support. The “submit” plugin gets close, but I think it misses some important features - and I agree it should be part of the core.

I’m not sure that the merge support in Bazaar is worse than that in Mercurial or Git. I’ve never had problems with it, and I use it a lot. Performance, other than remote access, is also no longer a problem for medium size projects as of 0.15. Update: it’s no longer as much of a problem as it used to be. Remote access is still significantly slower than it can be, but people are working hard on fixing that problem.

It’s also interesting to see that the Bazaar user interface and documentation is apparently confusing to people who are mostly familiar with other distributed version control systems rather than centralized systems. We definitely need to work on that.

The fact that John doesn’t come from CVS or Subversion also explains that checkouts don’t appeal to him.

comments.

Using bzr-svn in production

At last, I’ve started to use bzr-svn in production. I’m now working on Samba in bzr, pulling from and pushing to Subversion branches as if they were native Bazaar branches.

It seems to work quite well. Bazaar can be slow dealing with large history, but that appears to be a temporary issue rather than a design flaw.

I’ve also published conversions of the two main Samba branches on the web at http://people.samba.org/bzr/jelmer/samba/.

Now, time to get the Subversion Python fixes into all the distro packages.

comments.

Pushing Mercurial branches into Subversion using Bazaar

The example below demonstrates just how well foreign branch support in Bazaar is progressing. Here’s how you can actually push Mercurial branches in Subversion:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
charis:~/bzr/hg-bzr-svn% svnadmin create svn-repos
charis:~/bzr/hg-bzr-svn% mkdir hg-branch; cd hg-branch
charis:~/bzr/hg-bzr-svn/hg-branch% hg init; echo data > afile; hg add afile
charis:~/bzr/hg-bzr-svn/hg-branch% hg ci -m "Add afile"
charis:~/bzr/hg-bzr-svn/hg-branch% cd ..
charis:~/bzr/hg-bzr-svn% bzr branch svn+file://`pwd`/svn-repos bzr-co
Branched 0 revision(s).
charis:~/bzr/hg-bzr-svn% cd bzr-co
charis:~/bzr/hg-bzr-svn/bzr-co% bzr pull ../hg-branch
All changes applied successfully.
1 revision(s) pulled.
charis:~/bzr/hg-bzr-svn/bzr-co% bzr push svn+file://`pwd`/../svn-repos
This transport does not update the working tree of:
svn+file:///home/jelmer/bzr/hg-bzr-svn/bzr-co/../svn-repos
1 revision(s) pushed.
charis:~/bzr/hg-bzr-svn/bzr-co% cd ..
charis:~/bzr/hg-bzr-svn% svn co file://`pwd`/svn-repos svn-co
A    svn-co/afile
 U   svn-co
Checked out revision 1.
charis:~/bzr/hg-bzr-svn% cd svn-co
charis:~/bzr/hg-bzr-svn/svn-co% svn pl
Properties on '.':
  bzr:merge
charis:~/bzr/hg-bzr-svn/svn-co% svn pg bzr:merge
hg:ef40d1bed1d1a1739457191eb979f10bfec793a2
charis:~/bzr/hg-bzr-svn/svn-co% svn log -v
------------------------------------------------------------------------
r1 | jelmer | 2006-07-10 21:33:49 +0200 (Mon, 10 Jul 2006) | 1 line
Changed paths:
   M /
   A /afile

Add afile
------------------------------------------------------------------------

comments.

Pushing to Subversion from Bazaar works

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
charis:~% bzr branch svn+ssh://svn.samba.org/home/svn/smb-build/trunk smb-build
Branched 50 revision(s).
charis:~% cd smb-build
charis:~/smb-build% ls
README        autogen.sh  bla    cflags.map    config.sub    configure.list  include
acinclude.m4  bin         build  config.guess  configure.in  foobar          install-sh
charis:~/smb-build% echo This line was added from Bazaar >> README
charis:~/smb-build% bzr ci -m "Update README"
modified README

You need a passphrase to unlock the secret key for
user: "Jelmer Vernooij <jelmer@samba.org>"
1024-bit DSA key, ID 1EEF5276, created 2001-10-30

Committed revision 51.
charis:~/smb-build% bzr push svn+ssh://svn.samba.org/home/svn/smb-build/trunk
This transport does not update the working tree of:
svn+ssh://svn.samba.org/home/svn/smb-build/trunk
1 revision(s) pushed.
charis:~/smb-build% bzr pull
Using saved location: svn+ssh://svn.samba.org/home/svn/smb-build/trunk
All changes applied successfully.
0 revision(s) pulled.
charis:~/smb-build% svn log -v -r HEAD svn://svn.samba.org/smb-build/trunk
------------------------------------------------------------------------
r61 | jelmer | 2006-07-04 21:37:52 +0200 (Tue, 04 Jul 2006) | 1 line
Changed paths:
   M /trunk
   M /trunk/README

Update README
------------------------------------------------------------------------
charis:~/smb-build% svn diff -r 60:61 svn://svn.samba.org/smb-build/trunk/README
Index: README
===================================================================
--- README      (revision 60)
+++ README      (revision 61)
@@ -1 +1,2 @@
 Bazaar rocks
+This line was added from Bazaar

Or view the screenshot on

Left to do before public announcement:
  • Fix nasty bug when branching off Samba (revno 11098 gives an error because it can’t find a file parent…)
  • Get workingtree fixes integrated into bzr.dev
  • Get Ubuntu bug #51304 fixed (integrate Subversion fixes into package).

comments.

Commits from Bazaar into Subversion work! (-:

After a few days hard work, I finally got commits working! Mandatory screenshots are up:

comments.