Skip to content
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

Disable breakpad in no-release version #3533

Merged
merged 20 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
56985d8
Disable breakpad in debug mode.
Shylock-Hg Dec 22, 2021
ea717dc
Merge branch 'master' into nebula-breakpad
Shylock-Hg Dec 22, 2021
93c2112
Merge branch 'master' into nebula-breakpad
Shylock-Hg Dec 23, 2021
db3bd40
Add option to enable breakpad.
Shylock-Hg Jan 5, 2022
b19c887
Merge branch 'master' of https://github.com/vesoft-inc/nebula into ne…
Shylock-Hg Jan 5, 2022
81fd2d2
Fix package script.
Shylock-Hg Jan 6, 2022
3bd44d9
Merge branch 'master' of https://github.com/vesoft-inc/nebula into ne…
Shylock-Hg Jan 6, 2022
cdab4bd
Merge branch 'master' into nebula-breakpad
Shylock-Hg Jan 7, 2022
bb74be1
Enable breakpad in release only.
Shylock-Hg Jan 11, 2022
371c52d
Merge branch 'master' of https://github.com/vesoft-inc/nebula into ne…
Shylock-Hg Mar 8, 2022
d92a187
Merge branch 'master' into nebula-breakpad
Shylock-Hg Mar 11, 2022
50fbd74
Merge branch 'master' into nebula-breakpad
Shylock-Hg Mar 18, 2022
b2b9d6d
Setup standalone.
Shylock-Hg Mar 18, 2022
abb44bd
Check in cmake.
Shylock-Hg Mar 18, 2022
4f50497
Merge branch 'master' into nebula-breakpad
Shylock-Hg Mar 18, 2022
801cc91
Fix checking logical
Shylock-Hg Mar 18, 2022
f86b084
Merge branch 'nebula-breakpad' of github.com:Shylock-Hg/nebula into n…
Shylock-Hg Mar 18, 2022
0e68356
Fix macro.
Shylock-Hg Mar 21, 2022
d2e0050
Control by macro.
Shylock-Hg Mar 21, 2022
57a5a2c
Merge branch 'master' of https://github.com/vesoft-inc/nebula into ne…
Shylock-Hg Mar 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: ./.github/actions/tagname-action
id: tag
- name: package
run: ./package/package.sh -v ${{ steps.tag.outputs.tagnum }} -t RelWithDebInfo -r OFF -p ON -s TRUE
run: ./package/package.sh -v ${{ steps.tag.outputs.tagnum }} -t RelWithDebInfo -r OFF -p ON -s TRUE -k ON
- name: output some vars
run: |
tar zcf ${{ env.CPACK_DIR }}/nebula-graph-${{ steps.tag.outputs.tagnum }}.tar.gz --exclude=${{ env.BUILD_DIR }} ./*
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ include(GitHooksConfig)
include(GitInfoConfig)
include(NebulaCustomTargets)
include(IncludeWhatYouUse)
include(BreakPadConfig)
include(TimeTrace)

add_custom_target(
Expand Down
12 changes: 12 additions & 0 deletions cmake/nebula/BreakPadConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Breakpad
if (ENABLE_BREAKPAD)
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND NOT ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
MESSAGE(FATAL_ERROR "Breakpad need debug info.")
endif()
endif()
if (NOT ${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64")
set(ENABLE_BREAKPAD OFF)
endif()
if (ENABLE_BREAKPAD)
add_compile_options(-DENABLE_BREAKPAD=1)
endif()
1 change: 1 addition & 0 deletions cmake/nebula/GeneralCMakeOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ option(ENABLE_COMPRESSED_DEBUG_INFO "Compress debug info to reduce binary si
option(ENABLE_CLANG_TIDY "Enable clang-tidy if present" OFF)
option(ENABLE_GDB_SCRIPT_SECTION "Add .debug_gdb_scripts section" OFF)
option(DISABLE_CXX11_ABI "Whether to disable cxx11 abi" OFF)
option(ENABLE_BREAKPAD "Whether to enable breakpad" OFF)
option(ENABLE_STANDALONE_VERSION "Enable standalone version build" OFF)

get_cmake_property(variable_list VARIABLES)
Expand Down
2 changes: 1 addition & 1 deletion cmake/nebula/ThirdPartyConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ find_package(FLEX REQUIRED)
find_package(LibLZMA REQUIRED)
find_package(Fizz REQUIRED)
find_package(Sodium REQUIRED)
if (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64")
if (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64" AND ENABLE_BREAKPAD)
find_package(Breakpad REQUIRED)
endif()
Shylock-Hg marked this conversation as resolved.
Show resolved Hide resolved

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} -c OFF
&& ./package.sh -n OFF -b ${BRANCH} -c OFF -k ON

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 -c OFF
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF -k ON

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 -c OFF
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF -k ON

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 -c OFF
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF -k ON

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 -c OFF
&& ./package.sh -n OFF -b ${BRANCH} -t RelWithDebInfo -s TRUE -c OFF -k ON

FROM centos:7

Expand Down
8 changes: 7 additions & 1 deletion package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -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
# -k: Whether to enable breakpad, default OFF
#
# usage: ./package.sh -v <version> -n <ON/OFF> -s <TRUE/FALSE> -c <ON/OFF>
#
Expand All @@ -35,8 +36,9 @@ dump_symbols="OFF"
dump_syms_tool_dir=
system_name=
install_prefix=/usr/local/nebula
enable_breakpad="OFF"

while getopts v:n:s:b:d:t:r:p:j:c: opt;
while getopts v:n:s:b:d:t:r:p:j:c:k: opt;
do
case $opt in
v)
Expand Down Expand Up @@ -70,6 +72,9 @@ do
p)
dump_symbols=$OPTARG
;;
k)
enable_breakpad=$OPTARG
;;
?)
echo "Invalid option, use default arguments"
;;
Expand Down Expand Up @@ -122,6 +127,7 @@ function _build_graph {
-DENABLE_PACK_ONE=${package_one} \
-DENABLE_COMPRESSED_DEBUG_INFO=${enable_compressed_debug_info} \
-DENABLE_PACKAGE_TAR=${package_tar} \
-DENABLE_BREAKPAD=${enable_breakpad} \
${project_dir}

if ! ( make -j ${jobs} ); then
Expand Down
4 changes: 2 additions & 2 deletions src/daemons/GraphDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using nebula::network::NetworkUtils;
static void signalHandler(nebula::graph::GraphServer *graphServer, int sig);
static Status setupSignalHandler(nebula::graph::GraphServer *graphServer);
static void printHelp(const char *prog);
#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
extern Status setupBreakpad();
#endif

Expand Down Expand Up @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}

#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
status = setupBreakpad();
if (!status.ok()) {
LOG(ERROR) << status;
Expand Down
4 changes: 2 additions & 2 deletions src/daemons/MetaDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static std::unique_ptr<nebula::kvstore::KVStore> gKVStore;
static void signalHandler(apache::thrift::ThriftServer* metaServer, int sig);
static void waitForStop();
static Status setupSignalHandler(apache::thrift::ThriftServer* metaServer);
#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
extern Status setupBreakpad();
#endif

Expand All @@ -74,7 +74,7 @@ int main(int argc, char* argv[]) {
return EXIT_FAILURE;
}

#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
status = setupBreakpad();
if (!status.ok()) {
LOG(ERROR) << status;
Expand Down
2 changes: 1 addition & 1 deletion src/daemons/SetupBreakpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This source code is licensed under Apache 2.0 License.
*/

#if defined(__x86_64__)
#if defined(__x86_64__) && defined(ENABLE_BREAKPAD)
Shylock-Hg marked this conversation as resolved.
Show resolved Hide resolved
#include <breakpad/client/linux/handler/exception_handler.h>

#include "common/base/StatusOr.h"
Expand Down
4 changes: 2 additions & 2 deletions src/daemons/StandAloneDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void printHelp(const char *prog);
void stopAllDaemon();
static void signalHandler(int sig);
static Status setupSignalHandler();
#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
extern Status setupBreakpad();
#endif

Expand Down Expand Up @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}

#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
status = setupBreakpad();
if (!status.ok()) {
LOG(ERROR) << status;
Expand Down
4 changes: 2 additions & 2 deletions src/daemons/StorageDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using nebula::network::NetworkUtils;

static void signalHandler(nebula::storage::StorageServer *storageServer, int sig);
static Status setupSignalHandler(nebula::storage::StorageServer *storageServer);
#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
extern Status setupBreakpad();
#endif

Expand All @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}

#if defined(__x86_64__)
#if defined(ENABLE_BREAKPAD)
status = setupBreakpad();
if (!status.ok()) {
LOG(ERROR) << status;
Expand Down