Skip to content

Commit 66f775e

Browse files
committed
fix: update build.yml to remove unnecessary packages and improve rocketmq.cpp crash handler condition
1 parent 7a455f1 commit 66f775e

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install prerequisites
1616
run: |
1717
set -eux
18-
yum install -y git curl wget xz tar unzip rsync which python3 python3-pip python3-setuptools autoconf automake libtool pkgconfig gcc gcc-c++ make ninja-build cmake file gdb strace vim procps-ng iputils
18+
yum install -y git curl wget xz tar unzip rsync which python3 python3-pip python3-setuptools autoconf automake libtool pkgconfig gcc gcc-c++ make ninja-build cmake file vim procps-ng iputils
1919
2020
- name: Checkout
2121
uses: actions/checkout@v4

src/rocketmq.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
*/
1717
#include <napi.h>
1818

19-
#if !defined(_WIN32)
19+
#if (defined(__GLIBC__) || defined(__APPLE__)) && !defined(_WIN32)
20+
#define ROCKETMQ_HAS_EXECINFO 1
21+
#endif
22+
23+
#if ROCKETMQ_HAS_EXECINFO
2024
#include <csignal>
2125
#include <cstdio>
2226
#include <cstdlib>
@@ -31,7 +35,7 @@
3135
namespace __node_rocketmq__ {
3236

3337
namespace {
34-
#if !defined(_WIN32)
38+
#if ROCKETMQ_HAS_EXECINFO
3539
void CrashSignalHandler(int signo) {
3640
void* frames[64];
3741
const int count = backtrace(frames, 64);
@@ -55,7 +59,7 @@ void MaybeInstallCrashHandler() {
5559
std::signal(SIGABRT, CrashSignalHandler);
5660
}
5761
#else
58-
void MaybeInstallCrashHandler() {}
62+
inline void MaybeInstallCrashHandler() {}
5963
#endif
6064
}
6165

0 commit comments

Comments
 (0)