| 1 | [[PageOutline(1-3,)]] |
| 2 | |
| 3 | = Automated building of HelenOS and all ported software = |
| 4 | |
| 5 | {{{#!box type=note |
| 6 | The tool described here is not meant to be used for normal development of HelenOS with |
| 7 | the classical "edit - incrementally compile - test" loop but rather for pre-merge |
| 8 | tests or automated nightly builds. |
| 9 | }}} |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | The tool for automated builds is in the [[source:/ci|CI repository]] and can be obtained |
| 15 | by cloning it: |
| 16 | |
| 17 | {{{ |
| 18 | bzr branch bzr://helenos.org/ci |
| 19 | }}} |
| 20 | |
| 21 | The repository consists of several parts. The `build.py` master script for building everything for HelenOS |
| 22 | (i.e. all ported software and all supported architectures), tool for automated |
| 23 | script execution `test-in-vm.sh` (with several testing scenarios) and a wrapper shell |
| 24 | script `ci.sh` for generating nightly builds (with a web front-end). |
| 25 | |
| 26 | |
| 27 | == Build everything == |
| 28 | |
| 29 | Running `build.py` without any arguments defaults to building HelenOS for all available architectures |
| 30 | (note: the tool assumes the toolchain is installed) and building all harbours from Coastline for all architectures. |
| 31 | `build.py` fetches by default the mainline/coastline branches from helenos.org. |
| 32 | |
| 33 | The tool detects the amount of available CPUs and runs the individual tasks in parallel. |
| 34 | On a decent machine, about 2h are currently needed to build everything. |
| 35 | |
| 36 | Once the tool finishes, directory `out/` contains the results. |
| 37 | `index.html` displays the summary with links to individual log files (basically stdout and stderr of all the started processes) and downloadable files (e.g. HelenOS images or harbour tarballs). |
| 38 | For machine processing, `report.xml` contains the same data. |
| 39 | |
| 40 | {{{#!box type=warning |
| 41 | Note that a lot of disk space is needed. About 1GB alone is the out directory with |
| 42 | downloadable artefacts and tens of GBs are needed for temporary files (build directories). |
| 43 | }}} |
| 44 | |
| 45 | |
| 46 | == Limiting what to build == |
| 47 | |
| 48 | If you are interested in building only for certain architectures or building several harbours only, |
| 49 | following switches might be helpful. |
| 50 | |
| 51 | {{{ |
| 52 | ./build.py --platforms ia32,arm32/* --harbours binutils,gcc |
| 53 | }}} |
| 54 | |
| 55 | Note that dependencies are resolved and added automatically. |
| 56 | |
| 57 | If you do not wish to build Coastline at all, either specify invalid repository (see switch below) or choose to build `none` harbour. |
| 58 | |
| 59 | |
| 60 | |
| 61 | == Limiting the parallelism == |
| 62 | |
| 63 | If you need to keep working on the machine, limit the number of parallel jobs: |
| 64 | |
| 65 | {{{ |
| 66 | ./build.py --jobs 2 |
| 67 | }}} |
| 68 | |
| 69 | Note that the actual load will be a little bit higher as many tools (GCC for example) internally spawn multiple |
| 70 | children that may run in parallel for some time. |
| 71 | |
| 72 | |
| 73 | == Building your branches == |
| 74 | |
| 75 | To build your branch, you can use the `--helenos-repository` switch. |
| 76 | |
| 77 | {{{ |
| 78 | ./build.py --helenos-repository lp:~maresja1/helenos/coastline_qemu_porting |
| 79 | }}} |
| 80 | |
| 81 | By default, `bzr branch` command is used so this will clone up to your latest commit. |
| 82 | If you want to build upon uncommitted changes, prepend `wip://` to use `rsync` instead of `bzr` |
| 83 | to copy the directory. |
| 84 | |
| 85 | {{{ |
| 86 | ./build.py --helenos-repository wip://$HOME/helenos/my_branch |
| 87 | }}} |
| 88 | |