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

Add breakpad recipe #5639

Merged
merged 8 commits into from
Jun 4, 2021
Merged

Conversation

ericriff
Copy link
Contributor

@ericriff ericriff commented May 26, 2021

Specify library name and version: breakpad/cci.20210521

This is the last missing requirement of sentry-native. https://github.com/conan-io/conan-center-index/blob/master/recipes/sentry-native/all/conanfile.py#L66

Some help is required around the components/cpp_info part since this library only provides pkg config files and I'm not familiar with it, so I'm not sure about how to model it on Conan.

CC: @madebr


  • 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.

if self.settings.os == "Linux":
self.requires("linux-syscall-support/cci.20200813")

def _patch_sources(self):
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'll make this a .patch once the PR is ready.

"#include <linux_syscall_support.h>"
)

# Let Conan handle fPIC
Copy link
Contributor Author

@ericriff ericriff May 26, 2021

Choose a reason for hiding this comment

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

Is this something we want? Or should we assume that it is hardcoded "for a reason" and don't mess with it?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is hardcoded so users don't have to change anything to use it in a shared library.

tools.rmdir(os.path.join(self.package_folder, "share"))
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))

def package_info( self ):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some help is needed here. sentry-native consumes this package using pkgConfig, but I'm not familiar with that system, so I don't know how to model it on Conan.
https://github.com/getsentry/sentry-native/blob/master/CMakeLists.txt#L439

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll fork this recipe and open a pr with some fixes.

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 would be interesting to create a sentry-breakpad recipe (such as I'm doing for sentry-crashpad), to see what components are needs to interface it with sentry-native.

@conan-center-bot

This comment has been minimized.

recipes/breakpad/all/conanfile.py Outdated Show resolved Hide resolved
Comment on lines 96 to 97
if self.settings.os == "Linux":
self._patch_sources()
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's okay to always patch?

Suggested change
if self.settings.os == "Linux":
self._patch_sources()
self._patch_sources()

Copy link
Contributor Author

@ericriff ericriff May 26, 2021

Choose a reason for hiding this comment

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

All the changes are Linux specific, but since the paths to the files are hardcored, E.g. src/client/linux/minidump_writer/line_reader.h I don't know if Windows will take them (doesn't it use \ instead of / for the folder separation?)
Besides I was planning on make this a real patch file once it the PR is stable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed.
I don't think the autotools build system was written with support for Windows built-in.
I think we should raise a ConanInvalidConfiguration for win.

I don't have a clue what to do with Macos. Throwing an exception would be fine for me too.

tools.rmdir(os.path.join(self.package_folder, "share"))
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))

def package_info( self ):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll fork this recipe and open a pr with some fixes.

recipes/breakpad/config.yml Outdated Show resolved Hide resolved
return "source_subfolder"

def config_options(self):
if self.settings.os == "Windows":
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it build on Windows?

I tried to build it with gyp, but I couldn't get it working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea :)

"#include <linux_syscall_support.h>"
)

# Let Conan handle fPIC
Copy link
Contributor

Choose a reason for hiding this comment

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

This is hardcoded so users don't have to change anything to use it in a shared library.

@conan-center-bot

This comment has been minimized.

ericriff and others added 2 commits May 26, 2021 13:21
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
@ericriff
Copy link
Contributor Author

ericriff commented May 26, 2021

I'm wondering why the test_package fails to run on Macos

/Users/jenkins/w/BuildSingleReference@2/conan-center-index/recipes/breakpad/all/test_package/test_package.cpp:2:10: fatal error: 'client/linux/handler/exception_handler.h' file not found
#include "client/linux/handler/exception_handler.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm so smart

@conan-center-bot

This comment has been minimized.


def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.join("bin", "test_package")
Copy link
Contributor

@madebr madebr May 26, 2021

Choose a reason for hiding this comment

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

This one does not need to use the binaries in the bin package folder? (as the crashpad test package does?)

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 think everything in bin are tools.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup. I was asking whether breakpad has a handler binary, such as crashpad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nop. Breakpad is easier to use since you just link the library to your app. No need to ship an extra handler.

Copy link
Contributor

Choose a reason for hiding this comment

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

does not match this

Copy link
Contributor

Choose a reason for hiding this comment

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

@prince-chrismc
breakpad ships utility executables to examine stacktraces post-crash, but no crashpad_handler-like executable that must be executed in parallel with the victim-executable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahhhhhh thank you for explaining

@madebr
Copy link
Contributor

madebr commented May 26, 2021

I've opened ericriff#6

A recipe for sentry-breakpad can be found at https://github.com/madebr/conan-center-index/tree/sentry_breakpad
I will open a pr adding that one after #5536 gets merged.

@ericriff
Copy link
Contributor Author

ericriff commented May 27, 2021

Thanks for the help with the components part!
According to the docs this library can be used on Linux, MacOS and Windows. No instructions on how to build though.
On MacOS this builds as is, but the test_package doesn't build since I included a header of client/linux. I inspected the packages built locally and I only have linux headers, so I'm guessing the build system only installs the headers related to the OS you're targeting.
Maybe I can make the test_package work using some #ifdef to change the code built. Any recommendation of which macro to check on the #ifdef?

@madebr
Copy link
Contributor

madebr commented May 27, 2021

This is the build script by sentry. It only builds the client library.
https://github.com/getsentry/sentry-native/blob/master/external/CMakeLists.txt

See https://github.com/madebr/conan-center-index/tree/sentry_breakpad

The autotools build script by google only supports Linux.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@ericriff
Copy link
Contributor Author

ericriff commented May 27, 2021

I cleaned up the recipe to remove all the OS checks since it is now Linux only, here e701de9

I can revert the commit if you think there is some value on keeping that around for the future.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

All green in build 9 (53719d9520b68383dc119973ba2e725034532ed5):

  • breakpad/cci.20210521@:
    All packages built successfully! (All logs)

@SSE4 SSE4 requested a review from uilianries May 28, 2021 07:40
Copy link
Contributor

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

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

Little contradiction, I flagged lines/converstation in question

Comment on lines +75 to +77
bindir = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bindir))
self.env_info.PATH.append(bindir)
Copy link
Contributor

Choose a reason for hiding this comment

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

This


def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.join("bin", "test_package")
Copy link
Contributor

Choose a reason for hiding this comment

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

does not match this

@madebr madebr mentioned this pull request Jun 2, 2021
4 tasks
@prince-chrismc
Copy link
Contributor

@madebr Since you are dependant on this PR you can review it 😝

@conan-center-bot conan-center-bot merged commit d0ce968 into conan-io:master Jun 4, 2021
madebr added a commit to madebr/conan-center-index that referenced this pull request Jun 21, 2021
* Add breakpad recipe

* Build test_package with CXX 11

* Use 2 spaces to indent

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Use double quotes and specify 'provides'

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* breakpad: add components

* Raise if os != Linux

* Cleanup recipe since it is Linux only

* Move source patching to actual patch files

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
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.

None yet

5 participants