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

crashpad_handler does not get build on macOS with vcpkg #374

Closed
1 of 3 tasks
kelteseth opened this issue Sep 19, 2020 · 5 comments · Fixed by #522
Closed
1 of 3 tasks

crashpad_handler does not get build on macOS with vcpkg #374

kelteseth opened this issue Sep 19, 2020 · 5 comments · Fixed by #522

Comments

@kelteseth
Copy link

kelteseth commented Sep 19, 2020

Description

crashpad_handler does not get build on macOS with vcpkg. The tool simply is not build via vcpkg on macOS. This results in an invalid cmake file:

[0/1 ?/sec] Re-running CMake...
CMake Error at ScreenPlay/Common/vcpkg/scripts/buildsystems/vcpkg.cmake:366 (_add_executable):
  _add_executable cannot create imported target "sentry_crashpad::handler"
  because another target with the same name already exists.
Call Stack (most recent call first):
  ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry_crashpad-targets.cmake:115 (add_executable)
  ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry-config.cmake:34 (include)
  ScreenPlay/Common/vcpkg/scripts/buildsystems/vcpkg.cmake:478 (_find_package)
  ScreenPlay/ScreenPlay/CMakeLists.txt:22 (find_package)


CMake Error at ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry_crashpad-targets.cmake:135 (message):
  The imported target "sentry_crashpad::handler" references the file

     "/Users/ihaitemini/Documents/screenplayinternal/ScreenPlay/Common/vcpkg/installed/x64-osx/tools/sentry-native/crashpad_handler"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/Users/ihaitemini/Documents/screenplayinternal/ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry_crashpad-targets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry-config.cmake:34 (include)
  ScreenPlay/Common/vcpkg/scripts/buildsystems/vcpkg.cmake:478 (_find_package)
  ScreenPlay/ScreenPlay/CMakeLists.txt:22 (find_package)


-- Configuring incomplete, errors occurred!

Looking at the vcpkg file -> https://github.com/microsoft/vcpkg/blob/49c1b2889def046f875138f06878c939d1ee9793/ports/sentry-native/portfile.cmake#L52
It is disabled for any none win32

When does the problem happen

  • During build
  • During run-time
  • When capturing a hard crash

Environment

  • OS: [macOS 10.15.6]
  • Compiler: [e.g. Clang 10]
  • CMake version and config: [3.17.2]

Steps To Reproduce

  1. Clone ScreenPlay branch mac_fixes:
  2. Run install_dependencies_linux_mac.sh
  3. Follow https://gitlab.com/kelteseth/ScreenPlay/-/blob/refactor/mac_fixes/Docs/DeveloperSetup.md

Log output

@kelteseth
Copy link
Author

kelteseth commented Sep 19, 2020

Ok removing the if WIN32 successfully creates the crashpad_handler. Now it complains about other things:


Führe /Users/ihaitemini/Qt/Tools/CMake/CMake.app/Contents/bin/cmake -S /Users/ihaitemini/Documents/screenplayinternal -B /private/var/folders/n4/lj16683928d9tmqx1jvxt2s40000gn/T/QtCreator-zLxJqS/qtc-cmake-UiMgPrgE in /private/var/folders/n4/lj16683928d9tmqx1jvxt2s40000gn/T/QtCreator-zLxJqS/qtc-cmake-UiMgPrgE aus.
CMake Error at ScreenPlay/Common/vcpkg/scripts/buildsystems/vcpkg.cmake:366 (_add_executable):
  _add_executable cannot create imported target "sentry_crashpad::handler"
  because another target with the same name already exists.
Call Stack (most recent call first):
  ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry_crashpad-targets.cmake:115 (add_executable)
  ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry-config.cmake:34 (include)
  ScreenPlay/Common/vcpkg/scripts/buildsystems/vcpkg.cmake:478 (_find_package)
  ScreenPlay/ScreenPlay/CMakeLists.txt:22 (find_package)


CMake Error at ScreenPlay/Common/vcpkg/installed/x64-osx/share/sentry/sentry-config.cmake:42 (set_property):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.
Call Stack (most recent call first):
  ScreenPlay/Common/vcpkg/scripts/buildsystems/vcpkg.cmake:478 (_find_package)
  ScreenPlay/ScreenPlay/CMakeLists.txt:22 (find_package)

@Swatinem
Copy link
Member

I think this is rather a problem with the package in vcpkg, and you should probably report this upstream.

@david-antiteum
Copy link

@kelteseth Can you please try my version of the port?

https://github.com/david-antiteum/vcpkg-ports/tree/master/ports/sentry

Note that I'm using 0.4.1, you can update it to 0.4.2 changing GIT_REF

To use it you must use the --overlay-ports option

Will you contact the author of the port in vcpkg (AenBleidd)?

@Swatinem
Copy link
Member

CMake Error at ScreenPlay/Common/vcpkg/scripts/buildsystems/vcpkg.cmake:366 (_add_executable):
  _add_executable cannot create imported target "sentry_crashpad::handler"
  because another target with the same name already exists.

Just noticed that. I think this is the same problem as #504 and should be fixed soon by getsentry/crashpad#37

@kelteseth
Copy link
Author

kelteseth commented Apr 20, 2021

@Swatinem thanks! I will enable my sentry for macos if this is merged :)

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 a pull request may close this issue.

3 participants