@cryptotaxi247 / netdata-1 / commits / e83498256

Move vendoring of Sentry to it’s own module and switch to using Git instead of the releases page. (#17358)

* Move vendoring of Sentry to it’s own module. Also, switch to pulling from the git repo instead of the release URL, as it’s more reliable, less prone to potential tampering, and also more consistent with all of our other vendoring. * Actually remove the Sentry vendoring code that was in the main file.

Austin S. Hemmelgarn committed Apr 10, 2024 at 11:03 UTC e83498256080997528cae1cd2c809ae1e9063317
2 files changed +37 -18
CMakeLists.txt
+8 -18
@@ -142,24 +142,6 @@ if(ENABLE_PLUGIN_GO)
142 find_package(Go "${MIN_GO_VERSION}" REQUIRED)
143 endif()
144
145 -if(ENABLE_SENTRY)
146 - include(FetchContent)
147 -
148 - # ignore debhelper
149 - set(FETCHCONTENT_FULLY_DISCONNECTED Off)
150 -
151 - set(SENTRY_VERSION 0.6.6)
152 - set(SENTRY_BACKEND "breakpad")
153 - set(SENTRY_BUILD_SHARED_LIBS OFF)
154 -
155 - FetchContent_Declare(
156 - sentry
157 - URL https://github.com/getsentry/sentry-native/releases/download/${SENTRY_VERSION}/sentry-native.zip
158 - URL_HASH SHA256=7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c
159 - )
160 - FetchContent_MakeAvailable(sentry)
161 -endif()
162 -
145 if(ENABLE_WEBRTC)
146 include(FetchContent)
147
@@ -277,6 +259,10 @@ endif()
259 include(NetdataJSONC)
260 include(NetdataYAML)
261
262 +if(ENABLE_SENTRY)
263 + include(NetdataSentry)
264 +endif()
265 +
266 #
267 # Checks from custom modules
268 #
@@ -284,6 +270,10 @@ include(NetdataYAML)
270 netdata_detect_jsonc()
271 netdata_detect_libyaml()
272
273 +if(ENABLE_SENTRY)
274 + netdata_bundle_sentry()
275 +endif()
276 +
277 #
278 # check include files
279 #
packaging/cmake/Modules/NetdataSentry.cmake new
+29
@@ -0,0 +1,29 @@
1 +# Functions and macros for handling of Sentry
2 +#
3 +# Copyright (c) 2024 Netdata Inc.
4 +# SPDX-License-Identifier: GPL-3.0-or-later
5 +
6 +# Handle bundling of Sentry.
7 +#
8 +# This pulls it in as a sub-project using FetchContent functionality.
9 +#
10 +# This needs to be a function and not a macro for variable scoping
11 +# reasons. All the things we care about from the sub-project are exposed
12 +# as targets, which are globally scoped and not function scoped.
13 +function(netdata_bundle_sentry)
14 + include(FetchContent)
15 +
16 + # ignore debhelper
17 + set(FETCHCONTENT_FULLY_DISCONNECTED Off)
18 +
19 + set(SENTRY_VERSION 0.6.6)
20 + set(SENTRY_BACKEND "breakpad")
21 + set(SENTRY_BUILD_SHARED_LIBS OFF)
22 +
23 + FetchContent_Declare(
24 + sentry
25 + GIT_REPOSITORY https://github.com/getsentry/sentry-native.git
26 + GIT_TAG c97bcc63fa89ae557cef9c9b6e3acb11a72ff97d # v0.6.6
27 + )
28 + FetchContent_MakeAvailable(sentry)
29 +endfunction()