mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
add gdb to ci runners on debian to catch backtraces if they happen
This commit is contained in:
parent
fc08f92425
commit
52bc2facc2
|
@ -38,16 +38,16 @@ local debian_pipeline(name, image,
|
||||||
'apt-get update',
|
'apt-get update',
|
||||||
'apt-get install -y eatmydata',
|
'apt-get install -y eatmydata',
|
||||||
'eatmydata apt-get dist-upgrade -y',
|
'eatmydata apt-get dist-upgrade -y',
|
||||||
'eatmydata apt-get install -y cmake git ninja-build pkg-config ccache ' + deps,
|
'eatmydata apt-get install -y gdb cmake git ninja-build pkg-config ccache ' + deps,
|
||||||
'mkdir build',
|
'mkdir build',
|
||||||
'cd build',
|
'cd build',
|
||||||
'cmake .. -G Ninja -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_BUILD_TYPE='+build_type+' ' +
|
'cmake .. -G Ninja -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_BUILD_TYPE='+build_type+' ' +
|
||||||
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
|
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
|
||||||
(if lto then '' else '-DWITH_LTO=OFF ') +
|
(if lto then '' else '-DWITH_LTO=OFF ') +
|
||||||
cmake_extra,
|
cmake_extra,
|
||||||
'ninja -v',
|
'ninja clean && ninja -v',
|
||||||
'./test/testAll --gtest_color=yes',
|
'../contrib/ci/drone-gdb.sh ./test/testAll --gtest_color=yes',
|
||||||
'./test/catchAll --use-colour yes',
|
'../contrib/ci/drone-gdb.sh ./test/catchAll --use-colour yes',
|
||||||
] + extra_cmds,
|
] + extra_cmds,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -86,7 +86,7 @@ local windows_cross_pipeline(name, image,
|
||||||
(if lto then '' else '-DWITH_LTO=OFF ') +
|
(if lto then '' else '-DWITH_LTO=OFF ') +
|
||||||
"-DBUILD_STATIC_DEPS=ON -DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON" +
|
"-DBUILD_STATIC_DEPS=ON -DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON" +
|
||||||
cmake_extra,
|
cmake_extra,
|
||||||
'ninja -v',
|
'ninja clean && ninja -v',
|
||||||
] + extra_cmds,
|
] + extra_cmds,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -158,7 +158,7 @@ local mac_builder(name, build_type='Release', werror=true, cmake_extra='', extra
|
||||||
'cmake .. -G Ninja -DCMAKE_CXX_FLAGS=-fcolor-diagnostics -DCMAKE_BUILD_TYPE='+build_type+' ' +
|
'cmake .. -G Ninja -DCMAKE_CXX_FLAGS=-fcolor-diagnostics -DCMAKE_BUILD_TYPE='+build_type+' ' +
|
||||||
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
|
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
|
||||||
cmake_extra,
|
cmake_extra,
|
||||||
'ninja -v',
|
'ninja clean && ninja -v',
|
||||||
'./test/testAll --gtest_color=yes',
|
'./test/testAll --gtest_color=yes',
|
||||||
'./test/catchAll --use-colour yes',
|
'./test/catchAll --use-colour yes',
|
||||||
] + extra_cmds,
|
] + extra_cmds,
|
||||||
|
|
5
contrib/ci/drone-gdb.sh
Executable file
5
contrib/ci/drone-gdb.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
rm -f crash.out.txt exit.out.txt
|
||||||
|
gdb -q -x $(readlink -e $(dirname $0))/gdb-filter.py --args $@
|
||||||
|
test -e crash.out.txt && cat crash.out.txt
|
||||||
|
exit $(cat exit.out.txt)
|
23
contrib/ci/gdb-filter.py
Normal file
23
contrib/ci/gdb-filter.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
def exit_handler (event):
|
||||||
|
code = 1
|
||||||
|
if hasattr(event, "exit_code"):
|
||||||
|
code = event.exit_code
|
||||||
|
with open("exit.out.txt", 'w') as f:
|
||||||
|
f.write("{}".format(code))
|
||||||
|
|
||||||
|
def crash_handler (event):
|
||||||
|
if (isinstance(event, gdb.SignalEvent)):
|
||||||
|
log_file_name = "crash.out.txt"
|
||||||
|
gdb.execute("set logging file " + log_file_name )
|
||||||
|
gdb.execute("set logging on")
|
||||||
|
gdb.execute("set logging redirect on")
|
||||||
|
gdb.execute("thread apply all bt")
|
||||||
|
gdb.execute("q")
|
||||||
|
|
||||||
|
gdb.events.stop.connect(crash_handler)
|
||||||
|
|
||||||
|
gdb.events.exited.connect(exit_handler)
|
||||||
|
gdb.execute("set confirm off")
|
||||||
|
gdb.execute("set pagination off")
|
||||||
|
gdb.execute("r")
|
||||||
|
gdb.execute("q")
|
Loading…
Reference in a new issue