README-build.md 3.14 KB
Newer Older
Colin Walters's avatar
Colin Walters committed
1 2 3 4 5
Overview
--------

The build process is divided into two levels:

Andres Gomez's avatar
Andres Gomez committed
6 7
1. Yocto
2. ostbuild
Colin Walters's avatar
Colin Walters committed
8 9 10 11 12 13 14 15 16

Yocto is used as a reliable, well-maintained bootstrapping tool.  It
provides the basic filesystem layout as well as binaries for core
build utilities like gcc and bash.  This gets us out of circular
dependency problems.

At the end, the Yocto build process generates two tarballs: one for a
base "runtime", and one "devel" with all of the development tools like
gcc.  We then import that into an OSTree branch
Andres Gomez's avatar
Andres Gomez committed
17
e.g. "bases/yocto/gnomeos-3.6-i686-devel".
Colin Walters's avatar
Colin Walters committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

At present, it's still (mostly) possible to put this data on an ext4
filesystem and boot into it.

We also have a Yocto recipe "ostree-native" which generates (as you
might guess) a native binary of ostree.  That binary is used to import
into an "archive mode" OSTree repository.  You can see it in
$builddir/tmp/deploy/images/repo.

Now that we have an OSTree repository storing a base filesystem, we
can use "ostbuild" which uses "linux-user-chroot" to chroot inside,
run a build on a source tree, and outputs binaries, which we then add
to the build tree for the next module, and so on.

The final result of all of this is that the OSTree repository gains
new commits (which can be downloaded by clients), while still
retaining old build history.

Yocto details
-------------

I have a branch of Yocto here:

https://github.com/cgwalters/poky

It has a collection of patches on top of the "Edison" release of
Yocto, some of which are hacky, others upstreamable.  The most
important part though are the modifications to commit the generated
root filesystem into OSTree.

Andres Gomez's avatar
Andres Gomez committed
48 49 50
For every GNOME OS release, there is a branch on which the needed
patches have landed. By now, that branch is "gnomeos-3.6".

Colin Walters's avatar
Colin Walters committed
51 52 53 54 55
ostbuild details
----------------

The simple goal of ostbuild is that it only takes as input a
"manifest" which is basically just a list of components to build.  You
Andres Gomez's avatar
Andres Gomez committed
56
can see an example of this here:
Colin Walters's avatar
Colin Walters committed
57

58
https://git.gnome.org/gnome-continuous/tree/manifest.json
Colin Walters's avatar
Colin Walters committed
59 60 61 62

A component is a pure metadata file which includes the git repository
URL and branch name, as well as ./configure flags (--enable-foo).

63 64 65 66
While the goal is to always build from Git, it's also possible to use a
tarball as a starting point, especially for low level components, or for
components that are not hosted in Git; ostbuild will take the tarball,
explode it, and put its contents into a Git repository.
Colin Walters's avatar
Colin Walters committed
67 68

The result of a build of a component is an OSTree branch like
Andres Gomez's avatar
Andres Gomez committed
69
"artifacts/gnomeos-3.6-i686-devel/libxslt/master".  Then, a "compose"
Colin Walters's avatar
Colin Walters committed
70
process merges together the individual filesystem trees into the final
Andres Gomez's avatar
Andres Gomez committed
71
branches (e.g. gnomeos-3.6-i686-devel).
Colin Walters's avatar
Colin Walters committed
72 73 74 75 76

Doing local builds
------------------

This is where you want to modify one (or a few) components on top of
77
what comes from the build.gnome.org server, and test the result
Colin Walters's avatar
Colin Walters committed
78 79 80 81 82
locally.  I'm working on this.

Doing a full build on your system
---------------------------------

83 84 85 86 87 88 89 90 91 92 93
The way I have things set up, I use jhbuild to build glib,
gobject-introspection, spidermonkey, gjs, and finally the gnome-ostree
build system.  See install/ostree.modules.

From there, just run:

$ ostbuild resolve --manifest=manifest.json --fetch
$ ostbuild build --prefix=gnomeos-3.8