Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Update sentry modules #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
80 changes: 40 additions & 40 deletions cmake/Modules/AddSentry/minidump.patch
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
--- src/backends/sentry_backend_breakpad.cpp
+++ src/backends/sentry_backend_breakpad.cpp
@@ -103,40 +103,57 @@ sentry__breakpad_backend_callback(
sentry_session_t *session = sentry__end_current_session_with_status(
SENTRY_SESSION_STATUS_CRASHED);
sentry__envelope_add_session(envelope, session);
SENTRY_SESSION_STATUS_CRASHED);
sentry__envelope_add_session(envelope, session);

// the minidump is added as an attachment, with type `event.minidump`
sentry_envelope_item_t *item
= sentry__envelope_add_from_path(envelope, dump_path, "attachment");
if (item) {
sentry__envelope_item_set_header(item, "attachment_type",
sentry_value_new_string("event.minidump"));
// the minidump is added as an attachment,
// with type `event.minidump`
sentry_envelope_item_t *item = sentry__envelope_add_from_path(
envelope, dump_path, "attachment");
if (item) {
sentry__envelope_item_set_header(item, "attachment_type",
sentry_value_new_string("event.minidump"));

sentry__envelope_item_set_header(item, "filename",
sentry__envelope_item_set_header(item, "filename",
#ifdef SENTRY_PLATFORM_WINDOWS
sentry__value_new_string_from_wstr(
sentry__value_new_string_from_wstr(
#else
sentry_value_new_string(
sentry_value_new_string(
#endif
sentry__path_filename(dump_path)));
}
sentry__path_filename(dump_path)));
}

+ { // [Greenrooms] duplicate minidump as a regular attachment to store it (sentry deletes minidumps)
+ sentry_envelope_item_t *item
+ = sentry__envelope_add_from_path(envelope, dump_path, "attachment");
+ if (item) {
+ sentry__envelope_item_set_header(item, "attachment_type",
+ sentry_value_new_string("event.attachment"));
+ { // [Greenrooms] duplicate minidump as a regular attachment to store it (sentry deletes minidumps)
+ sentry_envelope_item_t *item
+ = sentry__envelope_add_from_path(envelope, dump_path, "attachment");
+ if (item) {
+ sentry__envelope_item_set_header(item, "attachment_type",
+ sentry_value_new_string("event.attachment"));
+
+ sentry__envelope_item_set_header(item, "filename",
+ sentry__envelope_item_set_header(item, "filename",
+#ifdef SENTRY_PLATFORM_WINDOWS
+ sentry__value_new_string_from_wstr(
+ sentry__value_new_string_from_wstr(
+#else
+ sentry_value_new_string(
+ sentry_value_new_string(
+#endif
+ sentry__path_filename(dump_path)));
+ sentry__path_filename(dump_path)));
+ }
+ }
+ }
+
// capture the envelope with the disk transport
sentry_transport_t *disk_transport
= sentry_new_disk_transport(options->run);
sentry__capture_envelope(disk_transport, envelope);
sentry__transport_dump_queue(disk_transport, options->run);
sentry_transport_free(disk_transport);
// capture the envelope with the disk transport
sentry_transport_t *disk_transport
= sentry_new_disk_transport(options->run);
sentry__capture_envelope(disk_transport, envelope);
sentry__transport_dump_queue(disk_transport, options->run);
sentry_transport_free(disk_transport);

// now that the envelope was written, we can remove the temporary
// minidump file
sentry__path_remove(dump_path);
sentry__path_free(dump_path);
// now that the envelope was written, we can remove the temporary
// minidump file
sentry__path_remove(dump_path);
sentry__path_free(dump_path);
} else {
SENTRY_TRACE("event was discarded by the `on_crash` hook");
sentry_value_decref(event);
}

// after capturing the crash event, try to dump all the in-flight
// data of the previous transports
sentry__transport_dump_queue(options->transport, options->run);
// and restore the old transport
}
SENTRY_DEBUG("crash has been captured");

#ifndef SENTRY_PLATFORM_WINDOWS
// and restore the old transport
2 changes: 1 addition & 1 deletion extra/sentry
Submodule sentry updated 94 files
+33 −34 .github/workflows/ci.yml
+16 −0 .github/workflows/enforce-license-compliance.yml
+2 −0 .gitignore
+170 −0 CHANGELOG.md
+68 −14 CMakeLists.txt
+16 −3 CONTRIBUTING.md
+10 −3 Makefile
+22 −5 README.md
+121 −2 examples/example.c
+12 −7 external/CMakeLists.txt
+1 −1 external/breakpad
+1 −1 external/crashpad
+704 −17 include/sentry.h
+7 −0 src/CMakeLists.txt
+57 −33 src/backends/sentry_backend_breakpad.cpp
+97 −29 src/backends/sentry_backend_crashpad.cpp
+296 −13 src/backends/sentry_backend_inproc.c
+109 −0 src/modulefinder/sentry_modulefinder_aix.c
+103 −17 src/modulefinder/sentry_modulefinder_linux.c
+6 −0 src/modulefinder/sentry_modulefinder_linux.h
+40 −27 src/modulefinder/sentry_modulefinder_windows.c
+29 −3 src/path/sentry_path_unix.c
+1 −0 src/sentry_backend.h
+424 −32 src/sentry_core.c
+39 −7 src/sentry_core.h
+42 −1 src/sentry_database.c
+10 −0 src/sentry_database.h
+62 −1 src/sentry_envelope.c
+6 −0 src/sentry_envelope.h
+19 −0 src/sentry_info.c
+44 −0 src/sentry_json.c
+90 −1 src/sentry_options.c
+7 −0 src/sentry_options.h
+67 −14 src/sentry_os.c
+8 −0 src/sentry_ratelimiter.c
+6 −0 src/sentry_ratelimiter.h
+74 −7 src/sentry_scope.c
+16 −0 src/sentry_scope.h
+10 −6 src/sentry_session.c
+0 −61 src/sentry_string.c
+56 −18 src/sentry_string.h
+76 −1 src/sentry_sync.c
+22 −0 src/sentry_sync.h
+520 −0 src/sentry_tracing.c
+51 −0 src/sentry_tracing.h
+19 −0 src/sentry_transport.c
+7 −0 src/sentry_transport.h
+39 −13 src/sentry_utils.c
+1 −1 src/sentry_utils.h
+22 −0 src/sentry_uuid.c
+13 −3 src/sentry_uuid.h
+67 −3 src/sentry_value.c
+33 −0 src/sentry_value.h
+189 −0 src/symbolizer/sentry_symbolizer_unix.c
+13 −0 src/transports/sentry_transport_curl.c
+18 −0 src/transports/sentry_transport_winhttp.c
+8 −2 src/unwinder/sentry_unwinder_libbacktrace.c
+59 −4 tests/__init__.py
+59 −21 tests/assertions.py
+9 −3 tests/cmake.py
+7 −2 tests/conditions.py
+3 −3 tests/requirements.txt
+1 −1 tests/test_build_static.py
+131 −3 tests/test_integration_crashpad.py
+134 −23 tests/test_integration_http.py
+12 −0 tests/test_integration_ratelimits.py
+127 −28 tests/test_integration_stdout.py
+8 −0 tests/unit/CMakeLists.txt
+0 −2 tests/unit/fuzz.c
+0 −1 tests/unit/test_attachments.c
+116 −6 tests/unit/test_basic.c
+28 −1 tests/unit/test_concurrency.c
+0 −1 tests/unit/test_consent.c
+32 −1 tests/unit/test_envelopes.c
+0 −1 tests/unit/test_failures.c
+1 −1 tests/unit/test_fuzzfailures.c
+16 −0 tests/unit/test_info.c
+0 −1 tests/unit/test_logger.c
+0 −1 tests/unit/test_modulefinder.c
+0 −1 tests/unit/test_mpack.c
+0 −1 tests/unit/test_path.c
+0 −1 tests/unit/test_ratelimiter.c
+37 −0 tests/unit/test_sampling.c
+6 −1 tests/unit/test_session.c
+0 −1 tests/unit/test_slice.c
+12 −1 tests/unit/test_symbolizer.c
+20 −0 tests/unit/test_sync.c
+811 −0 tests/unit/test_tracing.c
+0 −2 tests/unit/test_uninit.c
+11 −2 tests/unit/test_unwinder.c
+43 −7 tests/unit/test_utils.c
+22 −2 tests/unit/test_uuid.c
+74 −1 tests/unit/test_value.c
+29 −0 tests/unit/tests.inc
4 changes: 2 additions & 2 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@rollup/plugin-node-resolve": "^13.2.1",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-typescript": "^8.3.2",
"@sentry/browser": "^6.19.7",
"@sentry/tracing": "^6.19.7",
"@sentry/browser": "^7.9.0",
"@sentry/tracing": "^7.9.0",
"@softmotions/mediasoup-client": "^3.6.54",
"@tsconfig/svelte": "^3.0.0",
"@types/debug": "^4.1.7",
Expand Down
28 changes: 15 additions & 13 deletions front/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const replaceConfigOptions = {
};

const aliasSentryOptions = {
entries: enableSentry ? [{ find: './sentry', replacement: './sentry.internal' }] : [],
entries: enableSentry ? [
{ find: './sentry.disabled', replacement: './sentry.enabled' },
] : [],
};

function onwarn(warning, warn) {
Expand Down Expand Up @@ -106,10 +108,10 @@ async function configAdmin() {
autoprefixer(),
...(isProduction
? [
cssnano({
preset: 'default',
}),
]
cssnano({
preset: 'default',
}),
]
: []),
],
},
Expand Down Expand Up @@ -187,10 +189,10 @@ async function configPublic() {
autoprefixer(),
...(isProduction
? [
cssnano({
preset: 'default',
}),
]
cssnano({
preset: 'default',
}),
]
: []),
],
},
Expand Down Expand Up @@ -267,10 +269,10 @@ async function configMain() {
autoprefixer(),
...(isProduction
? [
cssnano({
preset: 'default',
}),
]
cssnano({
preset: 'default',
}),
]
: []),
],
},
Expand Down
4 changes: 4 additions & 0 deletions front/src/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* along with this program. If not, see http://www.gnu.org/licenses/
*/

// Sentry need to be imported and started very first to handle as much errors as it can
import Sentry from '../sentry/sentry';
Sentry?.onLoad(() => console.log('Crash reporting is loaded'));

import 'focus-visible';
import '../translate';
import Root from './Admin.svelte';
Expand Down
2 changes: 1 addition & 1 deletion front/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

// Sentry need to be imported and started very first to handle as much errors as it can
import Sentry from './sentry';
import Sentry from './sentry/sentry';
Sentry?.onLoad(() => console.log('Crash reporting is loaded'));

import { Config } from './config';
Expand Down
24 changes: 24 additions & 0 deletions front/src/sentry/sentry.disabled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2022 Greenrooms, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*/

// !!! WARNING: Should not be imported directly

// By default import this mock file without module imports
// If need to use sentry build with env ENABLE_SENTRY=1 and ./enabled will be imported instead of ./disabled

import type Sentry from './sentry.enabled';
export default undefined as (undefined | typeof Sentry);
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* along with this program. If not, see http://www.gnu.org/licenses/
*/

// !!! WARNING: Should not be imported directly

import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";

Expand Down
4 changes: 2 additions & 2 deletions front/src/sentry.ts → front/src/sentry/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
// By default import this mock file without module imports
// If need to use sentry build with env SENTRY_FRONT_DSN and instead of ./sentry ./sentry.internal will be imported

import type Sentry from './sentry.internal';
export default undefined as (undefined | typeof Sentry);
export * from './sentry.disabled';
export { default } from './sentry.disabled';
85 changes: 37 additions & 48 deletions front/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1144,67 +1144,56 @@
estree-walker "^1.0.1"
picomatch "^2.2.2"

"@sentry/browser@^6.19.7":
version "6.19.7"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.19.7.tgz#a40b6b72d911b5f1ed70ed3b4e7d4d4e625c0b5f"
integrity sha512-oDbklp4O3MtAM4mtuwyZLrgO1qDVYIujzNJQzXmi9YzymJCuzMLSRDvhY83NNDCRxf0pds4DShgYeZdbSyKraA==
dependencies:
"@sentry/core" "6.19.7"
"@sentry/types" "6.19.7"
"@sentry/utils" "6.19.7"
"@sentry/browser@^7.9.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.9.0.tgz#eb9aeebfd5fb758e484ebdc6ab420a2a620219bb"
integrity sha512-R0/EatdSBPZ+orsD5Mu/Gq8XmEfr/KCzJv05S35GVPDkIgczIJ2AYlHgchnEO0m63jDFyWLzUteQmPZ3pao9PQ==
dependencies:
"@sentry/core" "7.9.0"
"@sentry/types" "7.9.0"
"@sentry/utils" "7.9.0"
tslib "^1.9.3"

"@sentry/core@6.19.7":
version "6.19.7"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.19.7.tgz#156aaa56dd7fad8c89c145be6ad7a4f7209f9785"
integrity sha512-tOfZ/umqB2AcHPGbIrsFLcvApdTm9ggpi/kQZFkej7kMphjT+SGBiQfYtjyg9jcRW+ilAR4JXC9BGKsdEQ+8Vw==
"@sentry/core@7.9.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.9.0.tgz#fb9308e067a4b5794eb49f8bac303bb9c627b1a9"
integrity sha512-WVGd2hV7Clcpl7/GL8LsRr4Zk9o/7o4rZHfs1Qed5lMRNYcxiMwucC1CYILVpJqVfY+8vIRP9v9Ss9ta2VUikw==
dependencies:
"@sentry/hub" "6.19.7"
"@sentry/minimal" "6.19.7"
"@sentry/types" "6.19.7"
"@sentry/utils" "6.19.7"
"@sentry/hub" "7.9.0"
"@sentry/types" "7.9.0"
"@sentry/utils" "7.9.0"
tslib "^1.9.3"

"@sentry/hub@6.19.7":
version "6.19.7"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.19.7.tgz#58ad7776bbd31e9596a8ec46365b45cd8b9cfd11"
integrity sha512-y3OtbYFAqKHCWezF0EGGr5lcyI2KbaXW2Ik7Xp8Mu9TxbSTuwTe4rTntwg8ngPjUQU3SUHzgjqVB8qjiGqFXCA==
"@sentry/hub@7.9.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.9.0.tgz#29d4c796006282a20e5f78a1bb156d8f5eacd772"
integrity sha512-KzPbGCB5mONgsXEzqHy6uOaOuqLnhmFmSpGg+M03J6UJnJaNM7nrNp80MhStmjLMq6whEYVE07DrMAn3+iaQdg==
dependencies:
"@sentry/types" "6.19.7"
"@sentry/utils" "6.19.7"
"@sentry/types" "7.9.0"
"@sentry/utils" "7.9.0"
tslib "^1.9.3"

"@sentry/minimal@6.19.7":
version "6.19.7"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.19.7.tgz#b3ee46d6abef9ef3dd4837ebcb6bdfd01b9aa7b4"
integrity sha512-wcYmSJOdvk6VAPx8IcmZgN08XTXRwRtB1aOLZm+MVHjIZIhHoBGZJYTVQS/BWjldsamj2cX3YGbGXNunaCfYJQ==
"@sentry/tracing@^7.9.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.9.0.tgz#0cbbf5b61ee76b934d2e4160a0ad3daf0001237b"
integrity sha512-X4HQ7jjP7qyc4saCtq31kLqQzcBpRNifE9KccgEbNXAkKoMrg5F22oUlfN2EcEWy0vm1C23juseDsOSSMXAM+A==
dependencies:
"@sentry/hub" "6.19.7"
"@sentry/types" "6.19.7"
"@sentry/hub" "7.9.0"
"@sentry/types" "7.9.0"
"@sentry/utils" "7.9.0"
tslib "^1.9.3"

"@sentry/tracing@^6.19.7":
version "6.19.7"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.19.7.tgz#54bb99ed5705931cd33caf71da347af769f02a4c"
integrity sha512-ol4TupNnv9Zd+bZei7B6Ygnr9N3Gp1PUrNI761QSlHtPC25xXC5ssSD3GMhBgyQrcvpuRcCFHVNNM97tN5cZiA==
dependencies:
"@sentry/hub" "6.19.7"
"@sentry/minimal" "6.19.7"
"@sentry/types" "6.19.7"
"@sentry/utils" "6.19.7"
tslib "^1.9.3"

"@sentry/types@6.19.7":
version "6.19.7"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.19.7.tgz#c6b337912e588083fc2896eb012526cf7cfec7c7"
integrity sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg==
"@sentry/types@7.9.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.9.0.tgz#8fa952865fda76f7c7c7fc6c84043979a22043ae"
integrity sha512-VGnUgELVMpGJCYW1triO+5XSyaPjB2Zu6esUgbb8iJ5bi+OWtxklixXgwhdaTb0FDzmRL/T/pckmrIuBTLySHQ==

"@sentry/utils@6.19.7":
version "6.19.7"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.19.7.tgz#6edd739f8185fd71afe49cbe351c1bbf5e7b7c79"
integrity sha512-z95ECmE3i9pbWoXQrD/7PgkBAzJYR+iXtPuTkpBjDKs86O3mT+PXOT3BAn79w2wkn7/i3vOGD2xVr1uiMl26dA==
"@sentry/utils@7.9.0":
version "7.9.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.9.0.tgz#497c41efe1b32974208ca68570e42c853b874f77"
integrity sha512-4f9TZvAVopgG7Lp1TcPSekSX1Ashk68Et4T8Y+60EVX5se19i0hpytbHWWwrXSrb3w0KpGANk0byoZkdaTgkYA==
dependencies:
"@sentry/types" "6.19.7"
"@sentry/types" "7.9.0"
tslib "^1.9.3"

"@softmotions/mediasoup-client@^3.6.54":
Expand Down