This page documents how to install necessary dependencies to work with the wire-server code base.
In addition to the information below, you can also consult the Dockerfiles for Alpine Linux, that could serve as inspiration:
sudo dnf install -y pkgconfig haskell-platform libstdc++-devel libstdc++-static gcc-c++ libtool automake openssl-devel libsodium-devel ncurses-compat-libs libicu-devel GeoIP-devel libxml2-devel snappy-devel protobuf-compilerNote: Debian is not recommended due to this issue when running local integration tests: #327. This issue does not occur with Ubuntu.
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 -yIf openssl-dev does not work for you, try libssl-dev.
# You might also need 'sudo pacman -S base-devel' if you haven't
# installed the base-devel group already.
sudo pacman -S geoip snappy icu openssl
brew install pkg-config libsodium openssl automake icu4c geoip snappy protobufNote: macOS users will need to make sure to link Haskell services against a more recent version of OpenSSL than what ships with the OS by default. Additionally, icu4c is installed in a non-standard location by homebrew. Add the following to your .stack/config.yaml:
extra-include-dirs:
- /usr/local/opt/openssl/include
- /usr/local/opt/icu4c/include
extra-lib-dirs:
- /usr/local/opt/openssl/lib
- /usr/local/opt/icu4c/libNote: if you're getting fatal error: 'libxml/parser.h' file not found and you're on macOS Mojave, try doing:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /Please refer to Stack's installation instructions.
When you're done, ensure stack --version is recent, ideally the same as STACK_ALPINE_VERSION in build/alpine/Dockerfile.prebuilder.
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).
sudo apt install haskell-stack -ycurl -sSL https://get.haskellstack.org/ | sh
# or
wget -qO- https://get.haskellstack.org/ | shsudo apt install rustc cargo -ycurl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/envYou need ormolu on your PATH, get it with stack install ormolu
We use headroom, get it with stack install headroom
This is a tool to create debian-style binary packages. It is optional, and is only used if you want to install debian-style packages on your debian or ubuntu system.
Note: If you want to build debian-style packages of cryptobox-c and other wire utilities, execute this step. otherwise, make sure to execute the 'Generic' version of the cryptobox-c step.
git clone https://github.com/wireapp/wire-server && cd wire-server/tools/makedeb
export VERSION=0
make dist
dpkg -i ../../dist/makedeb*.debgit clone https://github.com/wireapp/cryptobox-c && cd cryptobox-c
make dist
dpkg -i target/release/cryptobox*.debexport TARGET_LIB="$HOME/.wire-dev/lib"
export TARGET_INCLUDE="$HOME/.wire-dev/include"
mkdir -p "$TARGET_LIB"
mkdir -p "$TARGET_INCLUDE"
git clone https://github.com/wireapp/cryptobox-c && cd cryptobox-c
make install
# Add cryptobox-c to ldconfig
sudo bash -c "echo \"${TARGET_LIB}\" > /etc/ld.so.conf.d/cryptobox.conf"
sudo ldconfigMake sure stack knows where to find it. In ~/.stack/config.yaml add:
(using ~ or $HOME doesn't work, needs full paths)
extra-include-dirs:
- /usr/local/include
- <YOUR_HOME_DIR>/.wire-dev/include
extra-lib-dirs:
- /usr/local/lib
- <YOUR_HOME_DIR>/.wire-dev/libNote: While it is possible to use non-docker solutions to set up and configure this software, we recommend using docker and our provided docker images to configure dependent services rapidly, and ensure a consistent environment for all potential developers.
sudo apt install docker.io docker-composeAfter installing docker-io, add your user to the docker group, and restart your shell (usually involving a restart of your graphical environment).
once you've logged in again, if you would like to upload any docker images (optional):
docker login --username=<MY_DOCKER_USERNAME>Using Stack's Nix integration, Stack will take care of installing any system
dependencies automatically - including cryptobox-c. If new system dependencies are needed, add them to the shell.nix file in the project root.
Just type $ nix-shell and you will automatically have make, docker-compose and stack in PATH.
You can then run all the builds, and the native dependencies will be automatically present.
We are currently on a snapshot that uses ghc863 but Nix only ships ghc864 as ghc863 is officially deprecated. The releases should be totally compatible, but we need to convince stack that this is true. Hence, we can add the following to our global stack config in ~/.stack/config.yaml
skip-ghc-check: true