Skip to content
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

Merged
merged 9 commits into from
Jun 11, 2021
Merged

Conversation

madebr
Copy link
Contributor

@madebr madebr commented Jun 2, 2021

Specify library name and version: sentry-breakpad/all


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@madebr madebr force-pushed the sentry_breakpad branch from 4c6cd3d to 55b4e65 Compare June 2, 2021 21:39
@conan-center-bot

This comment has been minimized.

@conan-center-bot

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"
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

SSE4
SSE4 previously approved these changes Jun 3, 2021
# FIXME: convert to patches
import textwrap

files_to_patch = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake.install()

def package_info(self):
self.cpp_info.names["pkg_config"] = "breakpad-client"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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."
Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this.

Comment on lines +7 to +9
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(LINUX ON)
endif()
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the next guy?

Suggested change
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()

Copy link
Member

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strip_root?

Copy link
Contributor Author

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of source build?

Copy link
Contributor Author

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 😄

Copy link
Contributor Author

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"
Copy link
Contributor

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?

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

All green in build 9 (6ebf26c5be5107399f1d00fd01c22a8237af2e5a):

  • sentry-breakpad/0.4.9@:
    All packages built successfully! (All logs)

  • sentry-breakpad/0.4.8@:
    All packages built successfully! (All logs)

  • sentry-breakpad/0.4.7@:
    All packages built successfully! (All logs)

  • sentry-breakpad/0.4.1@:
    All packages built successfully! (All logs)

  • sentry-breakpad/0.2.6@:
    All packages built successfully! (All logs)

for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)

# FIXME: convert to patches
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@conan-center-bot conan-center-bot requested a review from jgsogo June 8, 2021 11:59
Comment on lines +7 to +9
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(LINUX ON)
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that comment.

@conan-center-bot conan-center-bot merged commit 3407e05 into conan-io:master Jun 11, 2021
madebr added a commit to madebr/conan-center-index that referenced this pull request Jun 21, 2021
* 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
@madebr madebr deleted the sentry_breakpad branch September 8, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants