Changes between Initial Version and Version 1 of Obsolete/MovedToTree/PackageManagement/Bootstrapping


Ignore:
Timestamp:
Sep 28, 2013, 12:55:14 AM (11 years ago)
Author:
bonefish
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Obsolete/MovedToTree/PackageManagement/Bootstrapping

    v1 v1  
     1= Bootstrapping Haiku =
     2
     3Even a very basic Haiku requires a set of third-party packages (ICU, zlib,...), a Haiku sufficiently complete to build software even more (binutils, gcc, make,...). So whenever something fundamental in Haiku (the architecture ABI, the ABI of libroot) changes in a binary incompatible way, or when Haiku is ported to a new architecture, it is necessary to bootstrap Haiku and a basic set of required third-party packages. This document describes how this process works.
     4
     5
     6== Prerequisites ==
     7
     8 * So far the bootstrap build has only been tested on Linux. It will probably also work on FreeBSD and other Unixes. Haiku is not yet supported as a build platform.
     9 * A required prerequisite for the bootstrap build is a checkout of the haikuporter, the haikuports, and the haikuports.cross repositories from the [https://bitbucket.org/haikuports/ Bitbucket HaikuPorts site]. ATM (until they have been merged) the "package-management" branch must be checked out for the former two.
     10 * Additional build tools are required for the build platform:
     11   - autoconf
     12   - automake
     13 * All the usual prerequisites for building Haiku.
     14
     15
     16== Configuring and Building ==
     17
     18 1. Configure the Haiku build with all usual parameters, but add the `--bootstrap` option with its three parameters, the paths to the checked out haikuporter, haikuports.cross, and haikuports repositories:
     19{{{
     20.../configure ... --bootstrap path/to/haikuporter path/to/haikuports.cross path/to/haikuports
     21}}}
     22 1. Build a bootstrap Haiku image:
     23{{{
     24jam -q @bootstrap-raw
     25}}}
     26 1. Boot the bootstrap Haiku (e.g. in a virtual machine), open a Terminal and build the third-party packages:
     27{{{
     28cd haikuports
     29haikuporter --do-bootstrap
     30}}}
     31
     32In the "packages" subdirectory the built packages are collected. This is the initial set of packages for the HaikuPorts packages repository, plus the source packages the Haiku build system put in your generated directory under "objects/haiku/<arch>/packaging/repositories/HaikuPorts-sources-build/packages" (ignore the "rigged" source packages). With these packages a HaikuPorts package repository can be built and in turn a regular Haiku can be built using it. Further packages can then be built on the regular Haiku.
     33
     34Further hints:
     35 * Of course, as usual, "-j<number>" can be passed to the jam building the bootstrap Haiku. Building the bootstrap third-party packages, which is part of this process, will take quite some time anyway. Since those packages are built sequentially, the jam variable "HAIKU_PORTER_CONCURRENT_JOBS" can be defined to the number of jobs that shall be used to build a package.
     36 * Instead of "bootstrap-raw" the build profile "bootstrap-vmware" can be used as well. You can also define your own build profile, e.g. for building to a partition. As long as its name starts with "bootstrap-" that will result in a bootstrap Haiku.
     37 * `haikuporter` also supports the "-j<number>" option to specify the number of jobs to use. Even on real hardware this step will nevertheless take a long time.
     38
     39
     40== How it works ==
     41
     42Building the bootstrap Haiku image is in principle quite similar to building a regular Haiku image, save for the following differences:
     43 * Some parts of a regular Haiku that aren't needed for building packages are omitted (e.g. the Demos, MediaPlayer, the OpenGL API,...).
     44 * Certain third-party packages that aren't needed for building packages are omitted as well.
     45 * The third-party packages are not downloaded from some package repository. Instead for each package a bootstrap version is built from the sources using `haikuporter` and the respective build recipe from haikuports.cross.
     46 * `haikuporter` itself and ready-to-build ("rigged") source packages for all needed final third-party packages are copied to the image.
     47
     48Obviously the last two points are the juicy parts. Building a bootstrap third-party package -- unless it is a pure data package -- requires certain parts of Haiku; usually the headers, libroot and other libraries, and the glue code. For some Haiku libraries we do already need certain third-party packages. So there's a bit of ping pong going on:
     49 * Initially the build system builds a package "haiku_cross_devel_sysroot_stage1_<arch>.hpkg". It contains the essentials for cross-compiling bootstrap third-party packages, but nothing that itself depends on a third-party package.
     50 * Once all third-party packages required for it have been built, a more complete "haiku_cross_devel_sysroot_<arch>.hpkg" is built. It is used to cross-compile the remaining third-party packages.
     51
     52The rigged source packages (and regular source packages) are built via `haikuporter` from the regular haikuports repository checkout. haikuports contains build recipes for a lot of software. Which source packages should be built is determined by the build system by checking what packages are needed for a regular "alpha-raw" image.
     53
     54
     55== Haiku Architecture Ports ==
     56
     57When preparing a new Haiku architecture port for the bootstrap build the following things need to be considered:
     58 * There need to be repository definitions "build/jam/repositories/HaikuPorts/<arch>" and "build/jam/repositories/HaikuPortsCross/<arch>". The former lists the packages available for a regular Haiku, i.e. it must include at least the packages needed for a basic Haiku image that can build third-party packages. The latter lists the available bootstrap third-party packages.
     59 * There needs to be "src/data/package_infos/<arch>/haiku", a package info for the Haiku system package (currently also used for the bootstrap package).
     60 * In the haikuports.cross repository all build recipes need to support the architecture (the architecture must be listed in the "ARCHITECTURES" variable). Some software may need to be patched for cross-building to work for the architecture.
     61 * In the haikuports repository all build recipes for required software need to support the architecture.
     62
     63If the Haiku architecture port doesn't support a working userland yet, the process obviously cannot go further than building the bootstrap Haiku image.