Skip to content

Commit 187d52c

Browse files
Leif Battermannjschaul
andauthored
Update documentation of dependency setup (#1900)
* added pcre packages (perl compatible regex needed for headroom) * put more emphasis on the stack version which should match the one on the Dockerfile and added a note on how to downgrade if necessary * moved and updated nix and direnv instruction * Update docs/developer/dependencies.md Co-authored-by: jschaul <[email protected]> * added a note on building nginz Co-authored-by: jschaul <[email protected]>
1 parent 65c2080 commit 187d52c

File tree

3 files changed

+36
-11
lines changed

3 files changed

+36
-11
lines changed

docs/developer/dependencies.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,32 @@ In addition to the information below, you can also consult the Dockerfiles for A
1111

1212
## General package dependencies (needed to compile Haskell services)
1313

14+
*Note: all the below sections for getting compile-time dependencies necessary to compile all of wire-server may potentially go out of date; if you spot a mistake please open an issue or PR*
15+
16+
### Nix + Direnv
17+
18+
Using Stack's [Nix integration](https://docs.haskellstack.org/en/stable/nix_integration/), Stack will take care of installing any system
19+
dependencies automatically - including `cryptobox-c`. If new system dependencies are needed, add them to the `stack-deps.nix` file in the project root.
20+
21+
If you have `direnv` and `nix`, you will automatically have `make`, `docker-compose` and `stack` in `PATH` once you `cd` into the project root and `direnv allow`.
22+
You can then run all the builds, and the native dependencies will be automatically present.
23+
24+
1. Install [Nix](https://nixos.org/download.html)
25+
* MacOS users with a recent Mac might need to follow [these
26+
instructions](https://nixos.org/nix/manual/#sect-macos-installation)
27+
* Debian users can use their distro's `nix` package, and should remember
28+
29+
to add their user to the `nix-users` group in /etc/group, and re-start
30+
their login session.
31+
2. Install [Direnv](https://direnv.net/).
32+
* On debian, you can install the `direnv` package. On MacOS use `brew install direnv`.
33+
* On NixOS with home-manager, you can set `programs.direnv.enable = true;`.
34+
* Make sure direnv is hooked into your shell via it's appripriate `rc` file.
35+
Add `eval "$(direnv hook bash|zsh|fish)"` to your ~/.(bash|zsh|fish)rc .
36+
* When successfully installed and hooked, direnv should ask you to `direnv allow`
37+
the current `.envrc` when you cd to this repository.
38+
See the [Installation documentation](https://direnv.net/docs/installation.html) for further details.
39+
1440
### Fedora:
1541

1642
```bash
@@ -22,7 +48,7 @@ sudo dnf install -y pkgconfig haskell-platform libstdc++-devel libstdc++-static
2248
_Note_: Debian is not recommended due to this issue when running local integration tests: [#327](https://github.com/wireapp/wire-server/issues/327). This issue does not occur with Ubuntu.
2349

2450
```bash
25-
sudo apt install pkg-config libsodium-dev openssl-dev libtool automake build-essential libicu-dev libsnappy-dev libgeoip-dev protobuf-compiler libxml2-dev zlib1g-dev libtinfo-dev liblzma-dev -y
51+
sudo apt install pkg-config libsodium-dev openssl-dev libtool automake build-essential libicu-dev libsnappy-dev libgeoip-dev protobuf-compiler libxml2-dev zlib1g-dev libtinfo-dev liblzma-dev libpcre3 libpcre3-dev -y
2652
```
2753

2854
If `openssl-dev` does not work for you, try `libssl-dev`.
@@ -63,7 +89,13 @@ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_heade
6389

6490
Please refer to [Stack's installation instructions](https://docs.haskellstack.org/en/stable/README/#how-to-install).
6591

66-
When you're done, ensure `stack --version` is recent, ideally the same as `STACK_ALPINE_VERSION` in [`build/alpine/Dockerfile.prebuilder`](../../build/alpine/Dockerfile.prebuilder).
92+
When you're done, ensure `stack --version` is the same as `STACK_ALPINE_VERSION` in [`build/alpine/Dockerfile.prebuilder`](../../build/alpine/Dockerfile.prebuilder).
93+
94+
If you have to, you can downgrade stack with this command:
95+
96+
```bash
97+
stack upgrade --binary-version <version>
98+
```
6799

68100
### Ubuntu / Debian
69101
_Note_: The packaged versions of `haskell-stack` are too old. It is recommended to follow the generic instructions or to use stack to update stack (`stack upgrade`).
@@ -174,14 +206,6 @@ docker login --username=<MY_DOCKER_USERNAME>
174206
* [Install docker](https://docker.com)
175207
* [Install docker-compose](https://docs.docker.com/compose/install/)
176208

177-
## Nix + Direnv
178-
179-
Using Stack's [Nix integration](https://docs.haskellstack.org/en/stable/nix_integration/), Stack will take care of installing any system
180-
dependencies automatically - including `cryptobox-c`. If new system dependencies are needed, add them to the `stack-deps.nix` file in the project root.
181-
182-
If you have `direnv` and `nix`, you will automatically have `make`, `docker-compose` and `stack` in `PATH` once you `cd` into the project root and `direnv allow`.
183-
You can then run all the builds, and the native dependencies will be automatically present.
184-
185209
## Telepresence
186210

187211
You can instead use [telepresence](https://www.telepresence.io) to allow you to talk to services installed in a given kubernetes namespace on a local or remote kubernetes cluster using easy DNS names like: `curl http://elasticsearch:9200`.

docs/developer/how-to.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Terminal 1:
99

1010
Terminal 2:
1111
* Compile all services: `make services`
12+
* Note that you have to [import the public signing keys for nginx](../../services/nginz/README.md#common-problems-while-compiling) to be able to build nginz
1213
* Run services including nginz: `export INTEGRATION_USE_NGINZ=1; ./services/start-services-only.sh`
1314

1415
Open your browser at:

tools/nginz_disco/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
Due to nginx not supporting DNS names for its list of upstream servers (unless you pay extra), the nginz-disco container is a simple bash script to do DNS lookups and write the resulting IPs to a file. Nginz reloads on changes to this file.
44

5-
This is useful as a sidecar container to nginz in kubernetes. See also [wire-server-deploy/nginz](https://github.com/wireapp/wire-server-deploy/charts/nginz/)
5+
This is useful as a sidecar container to nginz in kubernetes. See also [wire-server-deploy/nginz](https://github.com/wireapp/wire-server-deploy/charts/nginz/) <!-- todo: this link is broken >
66

0 commit comments

Comments
 (0)