Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
(conan-io#22422) [sentry-native] Default backend + versions cleaning
Browse files Browse the repository at this point in the history
* [sentry-native] Add 0.6.6 / Remove 0.6.3 and 0.4.18

* Remove SENTRY_CRASHPAD_SYSTEM definition for sentry-native >= 0.7.0

* Add upstream repository pull request

* Make crashpad the default backend on Linux from 0.7.0

* Improve transport option logic

* Increase the C++ standard to 17 for crashpad backend

* Use C++17 instead of C++14 in test package

* Use minimum GCC version 7 for crashpad backend too

* Respect upstream CMakelists.txt backend selection

* Always use C++17
  • Loading branch information
MartinDelille authored Mar 4, 2024
1 parent 13bc0dd commit 9de3a90
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 33 deletions.
9 changes: 3 additions & 6 deletions recipes/sentry-native/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ sources:
"0.7.0":
url: "https://github.com/getsentry/sentry-native/releases/download/0.7.0/sentry-native.zip"
sha256: "4dfccc879a81771b9da1c335947ffc9e5987ca3d16b3035efa2c66a06f727543"
"0.6.6":
url: "https://github.com/getsentry/sentry-native/releases/download/0.6.6/sentry-native.zip"
sha256: "7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c"
"0.6.5":
url: "https://github.com/getsentry/sentry-native/releases/download/0.6.5/sentry-native.zip"
sha256: "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995"
"0.6.4":
url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip"
sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38"
"0.6.3":
url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip"
sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9"
"0.5.4":
url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip"
sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d"
"0.4.18":
url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip"
sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece"

patches:
"0.6.5":
Expand Down
32 changes: 10 additions & 22 deletions recipes/sentry-native/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,12 @@ class SentryNativeConan(ConanFile):

@property
def _min_cppstd(self):
if is_msvc(self):
return "17"
if self.options.get_safe("backend") == "breakpad" and Version(self.version) >= "0.5.4":
return 17
return "14"
return "17"

@property
def _minimum_compilers_version(self):
minimum_gcc_version = "5"
if self.options.get_safe("backend") == "breakpad":
if self.options.get_safe("backend") == "breakpad" or self.options.get_safe("backend") == "crashpad":
minimum_gcc_version = "7"
return {
"Visual Studio": "15",
Expand All @@ -82,22 +78,17 @@ def config_options(self):

# Configure default transport
if self.settings.os == "Windows":
self.options.backend = "crashpad"
self.options.transport = "winhttp"
elif self.settings.os in ("FreeBSD", "Linux") or self.settings.os == "Macos": # Don't use tools.is_apple_os(os) here
self.options.transport = "curl"
else:
elif self.settings.os == "Android":
self.options.transport = "none"

# Configure default backend
if self.settings.os == "Windows" or self.settings.os == "Macos": # Don't use tools.is_apple_os(os) here
# FIXME: for self.version < 0.4: default backend is "breakpad" when building with MSVC for Windows xp; else: backend=none
# See https://github.com/getsentry/sentry-native/pull/927
if self.settings.os == "Macos":
self.options.backend = "crashpad"
elif self.settings.os in ("FreeBSD", "Linux"):
self.options.backend = "breakpad"
elif self.settings.os == "Android":
self.options.backend = "inproc"
else:
self.options.backend = "inproc"
if self.settings.os in ("FreeBSD", "Linux"):
self.options.backend = "breakpad" if Version(self.version) < "0.7.0" else "crashpad"
if self.settings.os not in ("Linux", "Android") or self.options.backend != "crashpad" or self.options.with_crashpad != "sentry":
del self.options.crashpad_with_tls

Expand All @@ -120,8 +111,6 @@ def requirements(self):
self.requires("crashpad/cci.20220219")
else:
self.requires("zlib/[>=1.2.11 <2]")
if self.settings.os in ("Linux", "FreeBSD"):
self.requires("libcurl/[>=7.78.0 <9]")
if self.options.get_safe("crashpad_with_tls"):
self.requires("openssl/[>=1.1 <4]")
elif self.options.backend == "breakpad":
Expand Down Expand Up @@ -156,7 +145,8 @@ def generate(self):
VirtualBuildEnv(self).generate()
tc = CMakeToolchain(self)
tc.variables["SENTRY_BACKEND"] = self.options.backend
if self.options.backend == "crashpad":
# See https://github.com/getsentry/sentry-native/pull/928
if Version(self.version) < "0.7.0" and self.options.backend == "crashpad":
tc.variables["SENTRY_CRASHPAD_SYSTEM"] = self.options.with_crashpad == "google"
if self.options.backend == "breakpad":
tc.variables["SENTRY_BREAKPAD_SYSTEM"] = self.options.with_breakpad == "google"
Expand Down Expand Up @@ -248,8 +238,6 @@ def package_info(self):
self.cpp_info.components["crashpad_util"].requires = ["crashpad_compat", "crashpad_mini_chromium", "zlib::zlib"]
if self.settings.os in ("Linux", "FreeBSD"):
self.cpp_info.components["crashpad_util"].system_libs.extend(["pthread", "rt"])
# Requires libcurl https://github.com/getsentry/crashpad/blob/2237d97ee2c38c930c07001e660be57324f69a37/util/CMakeLists.txt#L256
self.cpp_info.components["crashpad_util"].requires.extend(["libcurl::libcurl"])
elif self.settings.os == "Windows":
self.cpp_info.components["crashpad_util"].system_libs.append("winhttp")
elif self.settings.os == "Macos":
Expand Down
2 changes: 1 addition & 1 deletion recipes/sentry-native/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ find_package(sentry REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
6 changes: 2 additions & 4 deletions recipes/sentry-native/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
versions:
"0.7.0":
folder: all
"0.6.6":
folder: all
"0.6.5":
folder: all
"0.6.4":
folder: all
"0.6.3":
folder: all
"0.5.4":
folder: all
"0.4.18":
folder: all

0 comments on commit 9de3a90

Please sign in to comment.