Skip to content

Commit

Permalink
Disable console compiling when building docker image (#3987)
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed Mar 9, 2022
1 parent 18ee54c commit 3ed69c6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ _build.log
_install/
install/
install_manifest.txt
cmake-build-*

# ccls
.ccls
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -n OFF -b ${BRANCH}
&& ./package.sh -n OFF -b ${BRANCH} -c OFF

FROM centos:7 as graphd

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.graphd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY . /home/nebula/BUILD
ARG BRANCH=master

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF

FROM centos:7

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.metad
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF

FROM centos:7

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.storaged
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF

FROM centos:7

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF

FROM centos:7

Expand Down
20 changes: 13 additions & 7 deletions package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# -d: Whether to enable sanitizer, default OFF
# -t: Build type, default Release
# -j: Number of threads, default $(nproc)
# -r: Whether enable compressed debug info, default ON
# -p: Whether dump the symbols from binary by dump_syms
# -r: Whether to enable compressed debug info, default ON
# -p: Whether to dump the symbols from binary by dump_syms
# -c: Whether to enable console building, default ON
#
# usage: ./package.sh -v <version> -n <ON/OFF> -s <TRUE/FALSE>
# usage: ./package.sh -v <version> -n <ON/OFF> -s <TRUE/FALSE> -c <ON/OFF>
#

set -e
Expand All @@ -26,15 +27,16 @@ build_dir=${project_dir}/pkg-build
enablesanitizer="OFF"
static_sanitizer="OFF"
build_type="Release"
build_console="ON"
branch=$(git rev-parse --abbrev-ref HEAD)
jobs=$(nproc)
enable_compressed_debug_info=ON
dump_symbols=OFF
dump_symbols="OFF"
dump_syms_tool_dir=
system_name=
install_prefix=/usr/local/nebula

while getopts v:n:s:b:d:t:r:p:j: opt;
while getopts v:n:s:b:d:t:r:p:j:c: opt;
do
case $opt in
v)
Expand All @@ -56,6 +58,9 @@ do
t)
build_type=$OPTARG
;;
c)
build_console=$OPTARG
;;
j)
jobs=$OPTARG
;;
Expand Down Expand Up @@ -96,6 +101,7 @@ strip_enable: $strip_enable
enablesanitizer: $enablesanitizer
static_sanitizer: $static_sanitizer
build_type: $build_type
build_console: $build_console
branch: $branch
enable_compressed_debug_info: $enable_compressed_debug_info
dump_symbols: $dump_symbols
Expand All @@ -112,7 +118,7 @@ function _build_graph {
-DENABLE_STATIC_UBSAN=${ssan} \
-DCMAKE_INSTALL_PREFIX=${install_prefix} \
-DENABLE_TESTING=OFF \
-DENABLE_CONSOLE_COMPILATION=ON \
-DENABLE_CONSOLE_COMPILATION=${build_console} \
-DENABLE_PACK_ONE=${package_one} \
-DENABLE_COMPRESSED_DEBUG_INFO=${enable_compressed_debug_info} \
-DENABLE_PACKAGE_TAR=${package_tar} \
Expand Down Expand Up @@ -208,7 +214,7 @@ function dump_syms {
# The main
build $version $enablesanitizer $static_sanitizer $build_type "OFF" "/usr/local/nebula"
package $strip_enable
if [[ $dump_symbols == ON ]]; then
if [[ "$dump_symbols" == "ON" ]]; then
echo ">>> start dump symbols <<<"
dump_syms
fi
Expand Down

0 comments on commit 3ed69c6

Please sign in to comment.