diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-20 10:38:28 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-20 10:38:28 +0100 |
commit | 09deaee5b308884b016dc90b984721861a3f8c85 (patch) | |
tree | ee46803e3883fec215c2ad06083d5374fba1f4d2 /docs/building.md | |
parent | f4967fc5527db28d3148989f245d374c8e4904d1 (diff) | |
download | sink-09deaee5b308884b016dc90b984721861a3f8c85.tar.gz sink-09deaee5b308884b016dc90b984721861a3f8c85.zip |
Build instructions
Diffstat (limited to 'docs/building.md')
-rw-r--r-- | docs/building.md | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/docs/building.md b/docs/building.md new file mode 100644 index 0000000..907827d --- /dev/null +++ b/docs/building.md | |||
@@ -0,0 +1,87 @@ | |||
1 | # Development Environment | ||
2 | We build and test Sink in a set of docker containers that can be build and used using a python based wrapper. This ensures reproducability and decouples the development environment from the host system (so upgrading your host system doesn't break all your builds). To avoid having to develop inside the container directly, source, build and install directories reside on the host system. | ||
3 | |||
4 | On the host system the ~/kdebuild directory will be used (adujustable in settings.py), as root for all builds. Inside ~/kdebuild we have: | ||
5 | |||
6 | * $ENV/source/\* | ||
7 | * $ENV/build/\* | ||
8 | * $ENV/install/\* | ||
9 | |||
10 | $ENV is for this project always "sink". | ||
11 | |||
12 | ## Setting it up | ||
13 | First clone the repository containing the docker files and the corresponding wrapper scripts [https://github.com/cmollekopf/docker.git] | ||
14 | |||
15 | It is recommended to setup an alias for the main script "testenv.py". | ||
16 | To do so add to your .bashrc, .zshrc or similar: | ||
17 | ``` | ||
18 | alias devenv='$PathToRepository/testenv.py' | ||
19 | ``` | ||
20 | |||
21 | This guide will from here on use the "devenv" alias. | ||
22 | |||
23 | ### Building the container | ||
24 | First you will need to build the docker container, so make sure you have docker setup and docker running (try "docker images"), otherwise follow your distributions instructions. | ||
25 | |||
26 | To build the relevant container use the following command: | ||
27 | ``` | ||
28 | devenv build kdesrcbuild fedora-kde | ||
29 | ``` | ||
30 | |||
31 | Various other distribution options exist but this is what we'll use by default. | ||
32 | |||
33 | ### Initial build | ||
34 | Inside the container we use "kdesrcbuild" to build all necessary dependencies that the container doesn't already provide. | ||
35 | |||
36 | To execute an initial build use: | ||
37 | ``` | ||
38 | devenv srcbuild sink kdesrcbuild | ||
39 | ``` | ||
40 | |||
41 | This will start a temporary container, execute kdesrcbuild inside (using docker.git/kdesrcbuild/sink/kdesrc-buildrc), and stop the container immediately. | ||
42 | Note that sed is run on the output that you see so all paths apply to the host system (so you can easily check the logfiles). | ||
43 | |||
44 | Once this succeeds you have Sink installed. Note however that it will only run inthe docker container and not on your host system. | ||
45 | |||
46 | ### Daily business | ||
47 | You can work on the code as usual in "~/kdebuild/sink/source/sink" (dependencies are in the source directory as well). | ||
48 | |||
49 | To execute a regular build and install: | ||
50 | ``` | ||
51 | devenv srcbuild sink sink make install | ||
52 | ``` | ||
53 | |||
54 | To install kasync again: | ||
55 | ``` | ||
56 | devenv srcbuild sink kasync make install | ||
57 | ``` | ||
58 | |||
59 | To run kdesrcbuild on sink: | ||
60 | ``` | ||
61 | devenv srcbuild sink kdesrcbuild sink | ||
62 | ``` | ||
63 | |||
64 | To run sink tests : | ||
65 | ``` | ||
66 | devenv srcbuild sink sink make test | ||
67 | ``` | ||
68 | |||
69 | To get a shell in the docker container (You will find the kdebuild directory mounted in "/work/", kdesrcbuild is in "/home/developer/kdesrcbuild/": | ||
70 | ``` | ||
71 | devenv srcbuild sink shell | ||
72 | ``` | ||
73 | |||
74 | ### Troubleshooting | ||
75 | |||
76 | * If your build starts failing misteriously, rerun kdesrcbuild to ensure all dependencies are up-to date. | ||
77 | |||
78 | * If kdesrcbuild fails, ensure ~/kdebuild is properly mounted into /work and that you have proper rights from both the container and the host (permissions can be a problem if docker creates the directories). To check from the container use "devenv srcbuild sink shell" | ||
79 | |||
80 | # Custom Build | ||
81 | While the above development environment is recommended for anyone interested in contribution to the project regularly, and the only way we can guarantee reproducability of test failures, it is of course also possible to build Sink regularly as any other cmake project. | ||
82 | |||
83 | ``` | ||
84 | mkdir build && cd build | ||
85 | cmake .. | ||
86 | make install | ||
87 | ``` | ||