File: debugging.md

package info (click to toggle)
cyclonedds 0.10.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 21,372 kB
  • sloc: ansic: 224,361; perl: 1,904; xml: 1,894; yacc: 1,018; sh: 882; python: 106; makefile: 94
file content (75 lines) | stat: -rw-r--r-- 2,263 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Troubleshooting Travis CI builds locally in a Docker image

This document describes how to run a Travis CI build locally using docker.

Most of the information is available in the Getting Started guide under
[Common Build Problems](https://docs.travis-ci.com/user/common-build-problems/#running-a-container-based-docker-image-locally),
but this guide is specifically tailored towards building Cyclone.

> Ensure [Docker](https://www.docker.com/) is installed, the daemon is running
> and you have the required privileges.

> See this [entry](https://developer.fedoraproject.org/tools/docker/about.html)
> on the Fedora Developer Portal for setting up and using Docker on Fedora.

> The *instance:* line under *Worker information* in the *Job log* will show
> exactly which instance of the *ci-garnet* image is used, but the latest image
> will do just fine.

```
Worker information
...
instance: travis-job-70cf1506-780a-445e-8f0d-da928d16ed65 travis-ci-garnet-trusty-1512502259-986baf0 (via amqp)
...
```

1. Start a Docker container detached with `/sbin/init`.

 ```
$ docker run --name travis-debug --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -dit travisci/ci-garnet:packer-1515445631-7dfb2e1 /sbin/init
```

 > The image is quite large (4 GB) and it will take some time to download.

2. Open a login shell in the running container.

 ```
$ docker exec -it travis-debug bash -l
```

3. Install all packages required to build Cyclone.

 ```
$ add-apt-repository ppa:ubuntu-toolchain-r/test
$ echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main" >> /etc/apt/sources.list.d/llvm-toolchain-6.0.list
$ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
$ apt-get update
$ apt-get install gcc-8 g++-8 clang-6.0 bison
```

4. Switch to the *travis* user.

 ```
su - travis
```

5. Clone the git repository.

 ```
$ git clone https://github.com/eclipse-cyclonedds/cyclonedds.git
```

6. Build the project and run the tests.

 > By default CMake and Conan will choose *gcc*. To switch to *clang*, set the
 > CC and CXX environment variables to clang and clang++ respectively.

 ```
$ export CC=gcc-8
$ export CXX=g++-8
$ cd cyclonedds
$ mkdir build
$ cmake -DBUILD_TESTING=on ../src
$ cmake --build .
$ ctest -T test
```