Skip to content

Commit e605163

Browse files
authored
Return breakpad variables and add compatibility info (#17362)
1 parent a77c7bb commit e605163

File tree

7 files changed

+43
-5
lines changed

7 files changed

+43
-5
lines changed

ydb/core/driver_lib/version/version.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <google/protobuf/text_format.h>
22
#include <google/protobuf/util/message_differencer.h>
33
#include <library/cpp/svnversion/svnversion.h>
4+
#include <library/cpp/resource/resource.h>
45
#include <ydb/library/yverify_stream/yverify_stream.h>
56
#include <ydb/core/viewer/json/json.h>
67
#include "version.h"
@@ -730,6 +731,10 @@ TString TCompatibilityInfo::PrintHumanReadable(const NKikimrConfig::TCurrentComp
730731
}
731732
str << "\n";
732733

734+
if (NResource::Has("interanal_breakpad_about")) {
735+
str << " HasInternalBreakpad: true" << Endl;
736+
}
737+
733738
// print common rule
734739
if (current->HasVersion() && current->GetVersion().HasYear() && current->GetVersion().HasMajor()) {
735740
const auto& version = current->GetVersion();

ydb/core/driver_lib/version/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PEERDIR(
1010
ydb/library/actors/interconnect
1111
library/cpp/monlib/service/pages
1212
library/cpp/svnversion
13+
library/cpp/resource
1314
ydb/core/protos
1415
ydb/core/viewer/json
1516
)

ydb/library/breakpad/about.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pluggable Google Breakpad
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
IF (OS_LINUX)
2+
3+
PROGRAM()
4+
5+
PEERDIR (
6+
contrib/libs/breakpad/src
7+
contrib/libs/breakpad/src/client/linux
8+
contrib/libs/llvm16/lib/DebugInfo/Symbolize
9+
library/cpp/getopt
10+
)
11+
12+
SRCS (
13+
main.cpp
14+
)
15+
16+
END()
17+
18+
ENDIF()

ydb/library/breakpad/minidumps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
class TMinidumper {
88
public:
99
TMinidumper() {
10-
if(const char* path = getenv("INTERNAL_BREAKPAD_MINIDUMPS_PATH")) {
10+
if(const char* path = getenv("BREAKPAD_MINIDUMPS_PATH")) {
1111
using namespace google_breakpad;
1212
Handler = MakeHolder<ExceptionHandler>(MinidumpDescriptor(path), nullptr, DumpCallback, nullptr, true, -1, true);
1313
}
1414
}
1515

1616
private:
1717
static bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded) {
18-
if (char* script = getenv("INTERNAL_BREAKPAD_MINIDUMPS_SCRIPT")) {
18+
if (char* script = getenv("BREAKPAD_MINIDUMPS_SCRIPT")) {
1919
if (auto pid = fork()) {
2020
waitpid(pid, 0, 0);
2121
} else {

ydb/library/breakpad/ya.make

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ IF (OS_LINUX)
99
SRCS(
1010
GLOBAL minidumps.cpp
1111
)
12+
13+
RESOURCE(about.txt "interanal_breakpad_about")
14+
1215
ENDIF()
1316

1417
END()

ydb/tests/functional/minidumps/test_break.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def test_create_minidump():
77
dump_path = os.path.join(yatest.common.tempfile.gettempdir(), 'dumps1')
88
os.makedirs(dump_path, exist_ok=True)
9-
os.environ['INTERNAL_BREAKPAD_MINIDUMPS_PATH'] = dump_path
9+
os.environ['BREAKPAD_MINIDUMPS_PATH'] = dump_path
1010
cluster = KiKiMR()
1111
cluster.start()
1212
for node in cluster.nodes.values():
@@ -31,8 +31,8 @@ def test_minidump_script():
3131
'echo $SUCCESS >${PATH}.success\n'
3232
)
3333
os.chmod(script_path, 0o777)
34-
os.environ['INTERNAL_BREAKPAD_MINIDUMPS_SCRIPT'] = script_path
35-
os.environ['INTERNAL_BREAKPAD_MINIDUMPS_PATH'] = dump_path
34+
os.environ['BREAKPAD_MINIDUMPS_SCRIPT'] = script_path
35+
os.environ['BREAKPAD_MINIDUMPS_PATH'] = dump_path
3636
cluster = KiKiMR()
3737
cluster.start()
3838
for node in cluster.nodes.values():
@@ -46,3 +46,13 @@ def test_minidump_script():
4646
successes = list(filter(lambda x: x.endswith('.dmp.success'), files))
4747
assert len(dmps) == len(cluster.nodes)
4848
assert len(successes) == len(cluster.nodes)
49+
50+
51+
def test_compatibility_info():
52+
res = yatest.common.subprocess.run(
53+
[yatest.common.binary_path(os.getenv('YDB_DRIVER_BINARY')), '--compatibility-info'],
54+
capture_output=True,
55+
encoding='utf8',
56+
check=True
57+
)
58+
assert res.stdout.find('HasInternalBreakpad: true') >= 0

0 commit comments

Comments
 (0)