summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-01-20 10:38:28 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-01-20 10:38:28 +0100
commit09deaee5b308884b016dc90b984721861a3f8c85 (patch)
treeee46803e3883fec215c2ad06083d5374fba1f4d2 /docs
parentf4967fc5527db28d3148989f245d374c8e4904d1 (diff)
downloadsink-09deaee5b308884b016dc90b984721861a3f8c85.tar.gz
sink-09deaee5b308884b016dc90b984721861a3f8c85.zip
Build instructions
Diffstat (limited to 'docs')
-rw-r--r--docs/building.md87
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
2We 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
4On 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
13First clone the repository containing the docker files and the corresponding wrapper scripts [https://github.com/cmollekopf/docker.git]
14
15It is recommended to setup an alias for the main script "testenv.py".
16To do so add to your .bashrc, .zshrc or similar:
17```
18alias devenv='$PathToRepository/testenv.py'
19```
20
21This guide will from here on use the "devenv" alias.
22
23### Building the container
24First 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
26To build the relevant container use the following command:
27```
28devenv build kdesrcbuild fedora-kde
29```
30
31Various other distribution options exist but this is what we'll use by default.
32
33### Initial build
34Inside the container we use "kdesrcbuild" to build all necessary dependencies that the container doesn't already provide.
35
36To execute an initial build use:
37```
38devenv srcbuild sink kdesrcbuild
39```
40
41This will start a temporary container, execute kdesrcbuild inside (using docker.git/kdesrcbuild/sink/kdesrc-buildrc), and stop the container immediately.
42Note 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
44Once 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
47You can work on the code as usual in "~/kdebuild/sink/source/sink" (dependencies are in the source directory as well).
48
49To execute a regular build and install:
50```
51devenv srcbuild sink sink make install
52```
53
54To install kasync again:
55```
56devenv srcbuild sink kasync make install
57```
58
59To run kdesrcbuild on sink:
60```
61devenv srcbuild sink kdesrcbuild sink
62```
63
64To run sink tests :
65```
66devenv srcbuild sink sink make test
67```
68
69To get a shell in the docker container (You will find the kdebuild directory mounted in "/work/", kdesrcbuild is in "/home/developer/kdesrcbuild/":
70```
71devenv 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
81While 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```
84mkdir build && cd build
85cmake ..
86make install
87```