Skip to content

Commit 4a8ac10

Browse files
Add crash handling/debugging support, and version metadata generation (#328)
* Add crash handling/debugging support, and version metadata generation * fixed macos build errors due to crash handler code. * Include a link in the main README to the detailed Crash Handling and Debugging section in DEVELOPMENT.md * Include strings.h for strcasecmp() on POSIX systems * Update GitHub Actions to use macos-14 instead of retired macos-13 The macos-13 runner images have been retired as of December 2024. Update the workflow to use macos-14 for building with older OpenSSL versions (1.1 and 1.0.2). Also simplified the workflow by removing unnecessary matrix strategy. * Update GitHub Actions to use macos-14 instead of retired macos-13 * Add version and libevent verification step to macOS builds After building on macOS, verify that: - memtier_benchmark --version works correctly - The binary is linked against the expected libevent library * Enhance --version output to include detailed build information Update --version to display comprehensive build details in Redis-like format: - Version number (v=) - Git SHA and dirty status (sha=) - Architecture bits (bits=) - libevent version (libevent=) - OpenSSL version if TLS enabled (openssl=) Example output: v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024 * Move detailed version info to first line of --version output Change --version output format to show all build information on the first line: memtier_benchmark v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024 This makes it easier to parse and matches the Redis version output style. * Extra sanity check on CI by printing version and linked libs * Fixed ldd grep * only checking for ssl lib when built with tls
1 parent 8985eb5 commit 4a8ac10

File tree

12 files changed

+1029
-22
lines changed

12 files changed

+1029
-22
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
- name: Build
4343
run: autoreconf -ivf && ./configure && make -j
4444

45+
- name: Verify version, libevent, openssl
46+
run: |
47+
./memtier_benchmark --version
48+
ldd ./memtier_benchmark | grep libevent
49+
ldd ./memtier_benchmark | grep ssl
50+
4551
test-debian-versions:
4652
runs-on: ubuntu-latest
4753
continue-on-error: true
@@ -80,6 +86,12 @@ jobs:
8086
- name: Build
8187
run: autoreconf -ivf && ./configure && make -j
8288

89+
- name: Verify version, libevent, openssl
90+
run: |
91+
./memtier_benchmark --version
92+
ldd ./memtier_benchmark | grep libevent
93+
ldd ./memtier_benchmark | grep ssl
94+
8395
build-notls:
8496
runs-on: ubuntu-latest
8597
steps:
@@ -89,9 +101,14 @@ jobs:
89101
sudo apt-get -qq update
90102
sudo apt-get install lcov autoconf automake pkg-config libevent-dev
91103
92-
- name: Build
104+
- name: Build without TLS
93105
run: autoreconf -ivf && ./configure --disable-tls && make -j
94106

107+
- name: Verify version, libevent
108+
run: |
109+
./memtier_benchmark --version
110+
ldd ./memtier_benchmark | grep libevent
111+
95112
build-ubuntu-latest:
96113
runs-on: ubuntu-latest
97114
steps:
@@ -101,9 +118,14 @@ jobs:
101118
sudo apt-get -qq update
102119
sudo apt-get install lcov autoconf automake pkg-config libevent-dev
103120
104-
- name: Build
121+
- name: Build without TLS
105122
run: autoreconf -ivf && ./configure --disable-tls && make -j
106123

124+
- name: Verify version, libevent, openssl
125+
run: |
126+
./memtier_benchmark --version
127+
ldd ./memtier_benchmark | grep libevent
128+
107129
build-ubuntu:
108130
strategy:
109131
matrix:
@@ -203,29 +225,31 @@ jobs:
203225
run: brew install autoconf automake libtool libevent openssl@${{ matrix.openssl }}
204226
- name: Build
205227
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@${{ matrix.openssl }}`/lib/pkgconfig ./configure && make
228+
- name: Verify version, libevent, openssl
229+
run: |
230+
./memtier_benchmark --version
231+
otool -L ./memtier_benchmark | grep libevent
232+
otool -L ./memtier_benchmark | grep ssl
206233
207-
# According to https://github.com/actions/runner-images/blob/macos-14-arm64/20241119.509/images/macos/macos-14-arm64-Readme.md
208-
# [macOS] OpenSSL 1.1 will be removed and OpenSSL 3 will be the default for all macOS images from November 4, 2024
209-
# so use macos-13 which does not have the deprecation notice
210-
# macos-13 details: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
234+
# macos-13 has been retired as of December 2025, so use macos-14
235+
# macos-14 details: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
211236
build-macos-openssl-1-1:
212-
strategy:
213-
matrix:
214-
platform: [macos-13]
215-
runs-on: ${{ matrix.platform }}
237+
runs-on: macos-14
216238
steps:
217239
- uses: actions/checkout@v4
218240
- name: Install dependencies
219241
run: brew install autoconf automake libtool libevent [email protected]
220242
- name: Build
221243
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix [email protected]`/lib/pkgconfig ./configure && make
244+
- name: Verify version, libevent, openssl
245+
run: |
246+
./memtier_benchmark --version
247+
otool -L ./memtier_benchmark | grep libevent
248+
otool -L ./memtier_benchmark | grep ssl
222249
223250
224251
build-macos-openssl-1-0-2:
225-
strategy:
226-
matrix:
227-
platform: [macos-13]
228-
runs-on: ${{ matrix.platform }}
252+
runs-on: macos-14
229253
steps:
230254
- uses: actions/checkout@v4
231255
- name: Install dependencies
@@ -234,3 +258,8 @@ jobs:
234258
run: brew install rbenv/tap/[email protected]
235259
- name: Build
236260
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix [email protected]`/lib/pkgconfig ./configure && make
261+
- name: Verify version, libevent, openssl
262+
run: |
263+
./memtier_benchmark --version
264+
otool -L ./memtier_benchmark | grep libevent
265+
otool -L ./memtier_benchmark | grep ssl

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ config.log
2222
config.status
2323
libtool
2424
stamp-h1
25+
version.h
2526
*.DS_Store
2627
.vscode/*
2728
.idea/*

0 commit comments

Comments
 (0)