Commit eb464d42 authored by Sophie Wenzel-Teuber's avatar Sophie Wenzel-Teuber
Browse files

clean up build files

parent fdaa6c00
# superFIPhoboServer
The easiest (and maybe most convenient) way to build the fiphoboserver is by creating a Docker image.
When the following code is added to a Dockerfile in the same directory as the superfiphoboserver directory, you can build it with `docker build -t phobos:debian .` from that directory.
```
FROM debian
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install git vim sudo curl tmux python3-pip
RUN mkdir -p /home/project
COPY . /home/project
RUN /home/project/superfiphoboserver/tools/build_proxygen.sh
RUN /home/project/superfiphoboserver/tools/build_phobos.sh
RUN /home/project/superfiphoboserver/tools/build_fiphoboserver.sh
RUN pip3 install boto3
RUN mkdir ~/.aws
RUN echo "[default] \naws_access_key_id = OPEN_KEY \naws_secret_access_key = SECRET_KEY" > ~/.aws/credentials
RUN echo "[default] \noutput = json \nregion = eu-west-1" > ~/.aws/config
```
This will also set up amazon AWS for the s3 tools in the tests folder.
It is recommended to run this docker image by mounting you current local branch of the fiphoboserver project with `docker run -it -v /path/to/fiphoboserver/to/work/on:/home/project/superfiphoboserver/external/fiphoboserver phobos:debian`
The executable fiphoboserver will be in the directory `/home/project/superfiphoboserver/build/fiphoboserver/fiphoboserver`. But remember to rebuilt when mounting a different directory into the container!
#!/bin/bash
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source_dir="${script_dir}/.."
fiphoboserver_source_dir="${source_dir}/external/fiphoboserver"
build_dir="${source_dir}/build/fiphoboserver"
mkdir ${build_dir}
cd ${build_dir}
cmake -DCMAKE_PREFIX_PATH="$source_dir/build/install" ${fiphoboserver_source_dir}
make
......@@ -67,7 +67,7 @@ function setup_folly() {
fi
cd $FOLLY_DIR
git fetch
FOLLY_REV=$(sed 's/Subproject commit //' "$SOURCE_DIR"/external/proxygen/build/deps/github_hashes/facebook/folly-rev.txt)
FOLLY_REV=$(sed 's/Subproject commit //' "$GITHUB_HASH_DIR"/facebook/folly-rev.txt)
git checkout "$FOLLY_REV"
echo -e "${COLOR_GREEN}Building Folly ${COLOR_OFF}"
mkdir -p "$FOLLY_BUILD_DIR"
......@@ -91,7 +91,7 @@ function setup_folly() {
cmake \
-DCMAKE_PREFIX_PATH="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
"$MAYBE_USE_STATIC_DEPS" \
"$MAYBE_BUILD_SHARED_LIBS" \
......@@ -113,7 +113,7 @@ function setup_fizz() {
fi
cd "$FIZZ_DIR"
git fetch
FIZZ_REV=$(sed 's/Subproject commit //' "$SOURCE_DIR"/external/proxygen/build/deps/github_hashes/facebookincubator/fizz-rev.txt)
FIZZ_REV=$(sed 's/Subproject commit //' "$GITHUB_HASH_DIR"/facebookincubator/fizz-rev.txt)
git checkout "$FIZZ_REV"
echo -e "${COLOR_GREEN}Building Fizz ${COLOR_OFF}"
mkdir -p "$FIZZ_BUILD_DIR"
......@@ -130,7 +130,7 @@ function setup_fizz() {
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DBUILD_TESTS=ON \
"$MAYBE_USE_STATIC_DEPS" \
"$MAYBE_BUILD_SHARED_LIBS" \
......@@ -151,7 +151,7 @@ function setup_wangle() {
fi
cd "$WANGLE_DIR"
git fetch
WANGLE_REV=$(sed 's/Subproject commit //' "$SOURCE_DIR"/external/proxygen/build/deps/github_hashes/facebook/wangle-rev.txt)
WANGLE_REV=$(sed 's/Subproject commit //' "$GITHUB_HASH_DIR"/facebook/wangle-rev.txt)
git checkout "$WANGLE_REV"
echo -e "${COLOR_GREEN}Building Wangle ${COLOR_OFF}"
mkdir -p "$WANGLE_BUILD_DIR"
......@@ -171,7 +171,7 @@ function setup_wangle() {
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
"$MAYBE_USE_STATIC_DEPS" \
"$MAYBE_BUILD_SHARED_LIBS" \
"$MAYBE_BUILD_TESTS" \
......@@ -191,7 +191,7 @@ function setup_mvfst() {
fi
cd "$MVFST_DIR"
git fetch
MVFST_REV=$(sed 's/Subproject commit //' "$SOURCE_DIR"/external/proxygen/build/deps/github_hashes/facebookincubator/mvfst-rev.txt)
MVFST_REV=$(sed 's/Subproject commit //' "$GITHUB_HASH_DIR"/facebookincubator/mvfst-rev.txt)
git checkout "$MVFST_REV"
echo -e "${COLOR_GREEN}Building Mvfst ${COLOR_OFF}"
mkdir -p "$MVFST_BUILD_DIR"
......@@ -212,7 +212,7 @@ function setup_mvfst() {
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
"$MAYBE_USE_STATIC_DEPS" \
"$MAYBE_BUILD_SHARED_LIBS" \
"$MAYBE_BUILD_TESTS" \
......@@ -266,6 +266,14 @@ trap 'cd $SOURCE_DIR' EXIT
cd $SOURCE_DIR || exit
BUILD_DIR="$SOURCE_DIR/build"
mkdir -p "$BUILD_DIR"
INSTALL_DIR="$SOURCE_DIR/build/install"
mkdir -p "$INSTALL_DIR"
PROXY_DIR=$SOURCE_DIR/external/proxygen
PROXY_BUILD_DIR=$BUILD_DIR/proxygen/build
GITHUB_HASH_DIR=$PROXY_DIR/build/deps/github_hashes
# Must execute from the directory containing this script
cd $SCRIPT_DIR
......@@ -297,9 +305,6 @@ if [ "$BUILD_FOR_FUZZING" == true ] ; then
MAYBE_BUILD_SHARED_LIBS="-DBUILD_SHARED_LIBS=OFF"
fi
PROXY_DIR=$SOURCE_DIR/external/proxygen
PROXY_BUILD_DIR=$BUILD_DIR/proxygen/build
echo -e "${COLOR_GREEN}Building Proxygen ${COLOR_OFF}"
mkdir -p "$PROXY_BUILD_DIR"
......@@ -308,7 +313,7 @@ cd "$PROXY_BUILD_DIR" || exit
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
"$MAYBE_BUILD_QUIC" \
"$MAYBE_BUILD_TESTS" \
"$MAYBE_BUILD_FUZZERS" \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment