-
Notifications
You must be signed in to change notification settings - Fork 5.3k
ci: refactor external dep build/install scripts. #687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| FROM ubuntu:xenial | ||
| COPY ./build_container.sh / | ||
| COPY ./build_container.sh ./build_and_install_deps.sh ./Makefile / | ||
| COPY ./build_recipes/*.sh /build_recipes/ | ||
| RUN ./build_container.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # The individual build recipe scripts must contain sufficient information (e.g. SHA, URL, repo, | ||
| # version number, etc.) to uniquely identify the revision of the upstream dependency. This allows | ||
| # make to pick up changes with a simple direct dependency on the build recipe. | ||
| # TODO(htuch): These dependencies should be installed into distinct --prefix directories, so we can | ||
| # easily blow away the lib/ and include/ install directories when we upgrade version. | ||
|
|
||
| all: $(THIRDPARTY_DEPS)/libevent.dep \ | ||
| $(THIRDPARTY_DEPS)/boringssl.dep \ | ||
| $(THIRDPARTY_DEPS)/gperftools.dep \ | ||
| $(THIRDPARTY_DEPS)/nghttp2.dep \ | ||
| $(THIRDPARTY_DEPS)/cares.dep \ | ||
| $(THIRDPARTY_DEPS)/protobuf.dep \ | ||
| $(THIRDPARTY_DEPS)/cotire.dep \ | ||
| $(THIRDPARTY_DEPS)/spdlog.dep \ | ||
| $(THIRDPARTY_DEPS)/http-parser.dep \ | ||
| $(THIRDPARTY_DEPS)/tclap.dep \ | ||
| $(THIRDPARTY_DEPS)/lightstep.dep \ | ||
| $(THIRDPARTY_DEPS)/rapidjson.dep \ | ||
| $(THIRDPARTY_DEPS)/googletest.dep \ | ||
| $(THIRDPARTY_DEPS)/gcovr.dep | ||
|
|
||
| RECIPES := build_recipes | ||
|
|
||
| build-setup = rm -rf $@.build && \ | ||
| mkdir -p $@.build && \ | ||
| mkdir -p $(THIRDPARTY_BUILD)/lib && \ | ||
| mkdir -p $(THIRDPARTY_BUILD)/include && \ | ||
| cd $@.build && \ | ||
| echo "Building in $@.build, logs at $@.log" | ||
|
|
||
| build-complete = rm -rf $@.build && \ | ||
| echo "Successful build of $@" && \ | ||
| touch $@ | ||
|
|
||
| build-recipe = cd $(THIRDPARTY_SRC) && \ | ||
| $(build-setup) && \ | ||
| (((bash $(realpath $<) 2>&1) > $@.log) || (cat $@.log; exit 1)) && \ | ||
| $(build-complete) | ||
|
|
||
| $(THIRDPARTY_DEPS)/%.dep: $(RECIPES)/%.sh | ||
| @+$(build-recipe) | ||
|
|
||
| $(THIRDPARTY_DEPS)/lightstep.dep: $(RECIPES)/lightstep.sh $(THIRDPARTY_DEPS)/protobuf.dep | ||
| @+$(build-recipe) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| mkdir -p "${THIRDPARTY_DEPS}" | ||
| mkdir -p "${THIRDPARTY_BUILD}" | ||
| mkdir -p "${THIRDPARTY_SRC}" | ||
|
|
||
| NUM_CPUS=`grep -c ^processor /proc/cpuinfo` | ||
| make -C "$(dirname "$0")" -j "${NUM_CPUS}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| git clone https://boringssl.googlesource.com/boringssl | ||
| cd boringssl | ||
| git reset --hard b87c80300647c2c0311c1489a104470e099f1531 | ||
| cmake . | ||
| make | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For full job server support aren't you supposed to do
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By prefixing the shell invocation line with +, the top-level make puts the make coordination flags in the environment, so no need to do anything special in the script. |
||
| cp -r include/* $THIRDPARTY_BUILD/include | ||
| cp ssl/libssl.a $THIRDPARTY_BUILD/lib | ||
| cp crypto/libcrypto.a $THIRDPARTY_BUILD/lib | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| wget https://github.com/c-ares/c-ares/archive/cares-1_12_0.tar.gz | ||
| tar xf cares-1_12_0.tar.gz | ||
| cd c-ares-cares-1_12_0 | ||
| ./buildconf | ||
| ./configure --prefix=$THIRDPARTY_BUILD --enable-shared=no --enable-lib-only | ||
| make install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| wget https://github.com/sakra/cotire/archive/cotire-1.7.8.tar.gz | ||
| tar xf cotire-1.7.8.tar.gz | ||
| rsync -av cotire-cotire-1.7.8 $THIRDPARTY_SRC |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| wget -O gcovr-3.3.tar.gz https://github.com/gcovr/gcovr/archive/3.3.tar.gz | ||
| tar xf gcovr-3.3.tar.gz | ||
| rsync -av gcovr-3.3 $THIRDPARTY_SRC | ||
| rm gcovr-3.3.tar.gz |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| wget -O googletest-1.8.0.tar.gz https://github.com/google/googletest/archive/release-1.8.0.tar.gz | ||
| tar xf googletest-1.8.0.tar.gz | ||
| cd googletest-release-1.8.0 | ||
| cmake -DCMAKE_INSTALL_PREFIX:PATH=$THIRDPARTY_BUILD . | ||
| make install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| wget https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz | ||
| tar xf gperftools-2.5.tar.gz | ||
| cd gperftools-2.5 | ||
| ./configure --prefix=$THIRDPARTY_BUILD --enable-shared=no --enable-frame-pointers | ||
| make install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| wget -O http-parser-v2.7.0.tar.gz https://github.com/nodejs/http-parser/archive/v2.7.0.tar.gz | ||
| tar xf http-parser-v2.7.0.tar.gz | ||
| cd http-parser-2.7.0 | ||
| $CC -O2 -c http_parser.c -o http_parser.o | ||
| ar rcs libhttp_parser.a http_parser.o | ||
| cp libhttp_parser.a $THIRDPARTY_BUILD/lib | ||
| cp http_parser.h $THIRDPARTY_BUILD/include |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| wget -o - https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz | ||
| tar xf libevent-2.1.8-stable.tar.gz | ||
| cd libevent-2.1.8-stable | ||
| ./configure --prefix=$THIRDPARTY_BUILD --enable-shared=no --disable-libevent-regress --disable-openssl | ||
| make install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| wget https://github.com/lightstep/lightstep-tracer-cpp/releases/download/v0_36/lightstep-tracer-cpp-0.36.tar.gz | ||
| tar xf lightstep-tracer-cpp-0.36.tar.gz | ||
| cd lightstep-tracer-cpp-0.36 | ||
| ./configure --disable-grpc --prefix=$THIRDPARTY_BUILD --enable-shared=no \ | ||
| protobuf_CFLAGS="-I$THIRDPARTY_BUILD/include" protobuf_LIBS="-L$THIRDPARTY_BUILD/lib -lprotobuf" PROTOC=$THIRDPARTY_BUILD/bin/protoc | ||
| make install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| wget https://github.com/nghttp2/nghttp2/releases/download/v1.20.0/nghttp2-1.20.0.tar.gz | ||
| tar xf nghttp2-1.20.0.tar.gz | ||
| cd nghttp2-1.20.0 | ||
| ./configure --prefix=$THIRDPARTY_BUILD --enable-shared=no --enable-lib-only | ||
| make install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| wget https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz | ||
| tar xf protobuf-cpp-3.2.0.tar.gz | ||
| rsync -av protobuf-3.2.0 $THIRDPARTY_SRC | ||
| cd protobuf-3.2.0 | ||
| ./configure --prefix=$THIRDPARTY_BUILD --enable-shared=no | ||
| make install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| wget -O rapidjson-1.1.0.tar.gz https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz | ||
| tar xf rapidjson-1.1.0.tar.gz | ||
| rsync -av rapidjson-1.1.0 $THIRDPARTY_SRC |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| wget https://github.com/gabime/spdlog/archive/v0.11.0.tar.gz | ||
| tar xf v0.11.0.tar.gz | ||
| rsync -av spdlog-0.11.0 $THIRDPARTY_SRC |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| wget -O tclap-1.2.1.tar.gz https://sourceforge.net/projects/tclap/files/tclap-1.2.1.tar.gz/download | ||
| tar xf tclap-1.2.1.tar.gz | ||
| rsync -av tclap-1.2.1 $THIRDPARTY_SRC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we fix the whitespace indent in this file. It's making my OCD flair up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done