Mono and Gerrit

From LSDevLinux
Revision as of 13:32, 29 May 2012 by Mayhewn (talk | contribs) (Categorize)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes the new way of setting up for building our custom mono and how to submit patches.

Setup and Building

Our custom mono consists of three git repositories: libgdiplus, mono, and mono-basic. The checkout-and-build-mono script will clone, update and build all three of them.

$ git clone git://
$ cd mono-calgary
mono-calgary$ ./checkout-and-build-mono

Providing Patches

To submit patches it's easiest to work in a new branch. It's a good idea to name the branch after the JIRA issue you're working on:

$ cd mono
mono $ git checkout -b FWNX-1234 calgary-2-10

You fix your bug and submit locally. Then you can upload your change to Gerrit for code review:

mono $ git review calgary-2-10

When the change is reviewed either the reviewer or you can submit the patch on the Gerrit website. You can then pull the latest changes and get rid of your working branch:

mono $ git checkout calgary-2-10
mono $ git pull origin calgary-2-10
mono $ git branch -d FWNX-1234

Updating our branch to a newer upstream version

If we want to update our branch to newer changes in the official mono repo, it's easiest to add an "upstream" remote to our local git configuration:

libgdiplus $ git remote add upstream git://

There are two options to do this:

1) Merge the changes from upstream to our branch

libgdiplus (calgary-2-10) $ git fetch upstream mono-2-10
libgdiplus (calgary-2-10) $ git merge upstream/mono-2-10
libgdiplus (calgary-2-10) $ git push origin calgary-2-10

2) Create a new branch and rebase our changes onto that

libgdiplus (calgary-2-10) $ git fetch upstream mono-2-12
libgdiplus (calgary-2-10) $ git checkout -b calgary-2-12 upstream/mono-2-12
libgdiplus (calgary-2-12) $ git rebase --onto mono-2-12 calgary-2-10 calgary-2-12
libgdiplus (calgary-2-12) $ git push origin calgary-2-12

Building packages locally

To build packages for testing locally:

$ cd libgdiplus
libgdiplus $ debuild -b -us -uc

Creating source packages

mono-calgary $ make-source-package libgdiplus calgary-2-10

This will create two files fieldworks-libgdiplus_2.10-1.dsc and fieldworks-libgdiplus_2.10-1.git.