summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2024-04-10 11:03:49 -0400
committerGitHub <noreply@github.com>2024-04-10 11:03:49 -0400
commite83498256080997528cae1cd2c809ae1e9063317 (patch)
treec9713dc59824421573736cc1d1b6cb933a1d953a
parent7b0a46b71c3c48ae787bc04cbd2fddafe89dedf2 (diff)
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.
-rw-r--r--CMakeLists.txt26
-rw-r--r--packaging/cmake/Modules/NetdataSentry.cmake29
2 files changed, 37 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61bda3abcd..9290be531a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -142,24 +142,6 @@ if(ENABLE_PLUGIN_GO)
find_package(Go "${MIN_GO_VERSION}" REQUIRED)
endif()
-if(ENABLE_SENTRY)
- include(FetchContent)
-
- # ignore debhelper
- set(FETCHCONTENT_FULLY_DISCONNECTED Off)
-
- set(SENTRY_VERSION 0.6.6)
- set(SENTRY_BACKEND "breakpad")
- set(SENTRY_BUILD_SHARED_LIBS OFF)
-
- FetchContent_Declare(
- sentry
- URL https://github.com/getsentry/sentry-native/releases/download/${SENTRY_VERSION}/sentry-native.zip
- URL_HASH SHA256=7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c
- )
- FetchContent_MakeAvailable(sentry)
-endif()
-
if(ENABLE_WEBRTC)
include(FetchContent)
@@ -277,6 +259,10 @@ endif()
include(NetdataJSONC)
include(NetdataYAML)
+if(ENABLE_SENTRY)
+ include(NetdataSentry)
+endif()
+
#
# Checks from custom modules
#
@@ -284,6 +270,10 @@ include(NetdataYAML)
netdata_detect_jsonc()
netdata_detect_libyaml()
+if(ENABLE_SENTRY)
+ netdata_bundle_sentry()
+endif()
+
#
# check include files
#
diff --git a/packaging/cmake/Modules/NetdataSentry.cmake b/packaging/cmake/Modules/NetdataSentry.cmake
new file mode 100644
index 0000000000..647a314457
--- /dev/null
+++ b/packaging/cmake/Modules/NetdataSentry.cmake
@@ -0,0 +1,29 @@
+# Functions and macros for handling of Sentry
+#
+# Copyright (c) 2024 Netdata Inc.
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Handle bundling of Sentry.
+#
+# This pulls it in as a sub-project using FetchContent functionality.
+#
+# This needs to be a function and not a macro for variable scoping
+# reasons. All the things we care about from the sub-project are exposed
+# as targets, which are globally scoped and not function scoped.
+function(netdata_bundle_sentry)
+ include(FetchContent)
+
+ # ignore debhelper
+ set(FETCHCONTENT_FULLY_DISCONNECTED Off)
+
+ set(SENTRY_VERSION 0.6.6)
+ set(SENTRY_BACKEND "breakpad")
+ set(SENTRY_BUILD_SHARED_LIBS OFF)
+
+ FetchContent_Declare(
+ sentry
+ GIT_REPOSITORY https://github.com/getsentry/sentry-native.git
+ GIT_TAG c97bcc63fa89ae557cef9c9b6e3acb11a72ff97d # v0.6.6
+ )
+ FetchContent_MakeAvailable(sentry)
+endfunction()