-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sentry-breakpad: add recipe #5737
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sources: | ||
"0.4.9": | ||
url: "https://github.com/getsentry/sentry-native/releases/download/0.4.9/sentry-native.zip" | ||
sha256: "559344bad846b7868c182b22df0cd9869c31ebf46a222ac7a6588aab0211af7d" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need all these minor versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're the same versions the sentry-native
recipe provides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can create them once, but they might be removed from the repository in the future (like patch versions from cmake
, meson
,...). IMO It can be good to have them available in the remote for at least one revision.
# FIXME: convert to patches | ||
import textwrap | ||
|
||
files_to_patch = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can take the patch from my PR, it should work.
https://github.com/conan-io/conan-center-index/pull/5639/files#diff-46f93bc4248cb2a5f042278e731395de3ffdbdc16f1c3e78935b713a652d28f7
cmake.install() | ||
|
||
def package_info(self): | ||
self.cpp_info.names["pkg_config"] = "breakpad-client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.cpp_info.names["pkg_config"] = "breakpad-client" | |
self.cpp_info.names["pkg_config"] = "breakpad-client" | |
self.cpp_info.names["cmake_find_package"] = "breakpad" | |
self.cpp_info.names["cmake_find_package_multi"] = "breakpad" |
So the package is a drop in replacement to google/breakpad #5639
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that the provides attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean from CMake's perspective. With this change you can have have find_package(breakpad)
regardless of the breakpad package you're using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the provides
only prevents two packages with the same libraries/APIs from colliding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prince-chrismc
This is done to switch between breakpad
and sentry-breakpad
seamlessly.
sentry-breakpad
is a forked version that, so far I know, don't has any intention to become standalone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't hurt to have it even if we're not planning on someone using it as a standalone version.
I can totally see someone trying to do it since the official version only builds on Linux.
|
||
class SentryBreakpadConan(ConanFile): | ||
name = "sentry-breakpad" | ||
description = "A set of client and server components which implement a crash-reporting system." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only client in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed.
I don't think it matters much, but I'll change it.
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::BREAKPAD) | ||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is OK but upstream also sets C_STANDARD to 11
https://github.com/getsentry/sentry-native/blob/master/CMakeLists.txt#L28-L34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this.
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
set(LINUX ON) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a little odd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is logic from the main sentry-native
cmake script that is repeated in the breakpad cmake script.
It's really crucial to have the LINUX
variable defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the next guy?
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | |
set(LINUX ON) | |
endif() | |
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | |
set(LINUX ON) # See https://github.com/conan-io/conan-center-index/pull/5737#discussion_r646140190 | |
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that comment.
tools.check_min_cppstd(self, 11) | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strip_root?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sentry-native
's releases don't have a root folder.
All files are in the root folder.
See https://github.com/getsentry/sentry-native/releases/tag/0.4.9 (the manually uploaded sentry-native.zip
)
if self._cmake: | ||
return self._cmake | ||
self._cmake = CMake(self) | ||
self._cmake.configure() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of source build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally possible, not that it will change anything 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted since I don't know a built-in way to refer to the generated conanbuildinfo.cmake
cmake.install() | ||
|
||
def package_info(self): | ||
self.cpp_info.names["pkg_config"] = "breakpad-client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that the provides attribute?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
All green in build 9 (
|
for patch in self.conan_data.get("patches", {}).get(self.version, []): | ||
tools.patch(**patch) | ||
|
||
# FIXME: convert to patches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this FIXME on the scope of this PR? Or it will be addressed in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I waited to convert them until I got it building successfully on c3i.
I will convert them asap.
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
set(LINUX ON) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that comment.
* sentry-breakpad: add recipe * sentry-breakpad: needs c++11 * sentry-breakpad: bump minimum required cmake version * sentry-breakpad: implement feedback + MSVC support * sentry-breakpad: no build_subfolder * sentry-breakpad: add macos support to test_package * sentry-breakpad: don't do global use namespace * sentry-breakpad: older versions don't support apple or android * sentry-breakpad: old versions do not support Windows as well
Specify library name and version: sentry-breakpad/all
sentry-native
.conan-center hook activated.