diff --git a/.dockerignore b/.dockerignore index 7cc234ab2f3..e94e8070287 100644 --- a/.dockerignore +++ b/.dockerignore @@ -13,6 +13,7 @@ _build.log _install/ install/ install_manifest.txt +cmake-build-* # ccls .ccls diff --git a/docker/Dockerfile b/docker/Dockerfile index ba9588ab4ee..e5e907c0a43 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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 diff --git a/docker/Dockerfile.graphd b/docker/Dockerfile.graphd index a896791c7ba..436264984f6 100644 --- a/docker/Dockerfile.graphd +++ b/docker/Dockerfile.graphd @@ -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 diff --git a/docker/Dockerfile.metad b/docker/Dockerfile.metad index 6b0a246007c..6a0223f64a2 100644 --- a/docker/Dockerfile.metad +++ b/docker/Dockerfile.metad @@ -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 diff --git a/docker/Dockerfile.storaged b/docker/Dockerfile.storaged index 4d22252dbd2..1a6ee8552bb 100644 --- a/docker/Dockerfile.storaged +++ b/docker/Dockerfile.storaged @@ -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 diff --git a/docker/Dockerfile.tools b/docker/Dockerfile.tools index ebec734e3c3..b94f083caff 100644 --- a/docker/Dockerfile.tools +++ b/docker/Dockerfile.tools @@ -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 diff --git a/package/package.sh b/package/package.sh index ad0d6538202..20bdd62e787 100755 --- a/package/package.sh +++ b/package/package.sh @@ -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 -n -s +# usage: ./package.sh -v -n -s -c # set -e @@ -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) @@ -56,6 +58,9 @@ do t) build_type=$OPTARG ;; + c) + build_console=$OPTARG + ;; j) jobs=$OPTARG ;; @@ -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 @@ -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} \ @@ -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