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-native] Fix windows usage #1005

Closed
wants to merge 4 commits into from

Conversation

JonLiu1993
Copy link

@JonLiu1993 JonLiu1993 commented Jun 7, 2024

Hi!
I have two issues regarding the using of the sentry-native port.

  1. While trying to generate the cmake project build configuration while using sentry-native as vcpkg dependency, i'm getting this error:
1> [CMake] CMake Error at out/build/Windows-x86-Debug/vcpkg_installed/x86-windows/share/sentry/sentry_crashpad-targets.cmake:105 (set_target_properties):
1> [CMake]   The link interface of target "sentry_crashpad::zlib" contains:
1> [CMake] 
1> [CMake]     ZLIB::ZLIB

This problem can be solved by adding additional project dependency for zlib in vcpkg.
Related issue:#596
microsoft/vcpkg#39114

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.83%. Comparing base (235f837) to head (1fea96e).
Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1005      +/-   ##
==========================================
- Coverage   86.53%   83.83%   -2.71%     
==========================================
  Files          40       53      +13     
  Lines        3736     5443    +1707     
  Branches        0     1207    +1207     
==========================================
+ Hits         3233     4563    +1330     
- Misses        503      767     +264     
- Partials        0      113     +113     

Copy link
Collaborator

@supervacuus supervacuus left a comment

Choose a reason for hiding this comment

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

Thanks, @JonLiu1993. The reason for excluding MSVC here is because, by default, crashpad uses a vendored zlib when building on MSVC:

https://github.com/getsentry/crashpad/blob/202c1c21939f6b1d3c72ebeda566b4164a2fd245/CMakeLists.txt#L17-L26

https://github.com/getsentry/crashpad/blob/eb9a5e2d9da8fdfb1e8365fdc611a3916a82c275/third_party/zlib/CMakeLists.txt#L1-L38

Adding a system dependency to the consuming project when the build uses a vendored version fixes the wrong problem.

How about you check for CRASHPAD_ZLIB_SYSTEM instead? Would that fix the issue? The initial committer probably wanted to exclude that case without worrying about propagating the value from the crashpad project to sentry-native. If you wish to check on CRASHPAD_ZLIB_SYSTEM in the exported config, you'd also have to define the option in sentry-native.

sentry-config.cmake.in Outdated Show resolved Hide resolved
@dg0yt
Copy link

dg0yt commented Jun 14, 2024

Outdated, invalid.

@JonLiu1993 JonLiu1993 closed this Jun 17, 2024
@supervacuus
Copy link
Collaborator

Hi @dg0yt and @JonLiu1993, can you minimally explain why this PR is no longer valid? Or provide a link to a vcpkg PR/issue that resolves the mentioned problem differently?

@JonLiu1993 JonLiu1993 reopened this Jun 18, 2024
@JonLiu1993
Copy link
Author

@supervacuus, VCPKG has updated sentry-native to 0.7.6 a few days ago. I thought this PR had been merged into it. I checked and found that it was not. I reopened this PR. Sorry for the confusion.
https://github.com/microsoft/vcpkg/pull/39255/files

@dg0yt
Copy link

dg0yt commented Jun 18, 2024

Hi @dg0yt and @JonLiu1993, can you minimally explain why this PR is no longer valid?

It incorrectly reverts find_package.
It incorrectly reflects the conditions.

@dg0yt
Copy link

dg0yt commented Jun 18, 2024

Cf. #1011 for all recent comments transformed into a PR.

@supervacuus
Copy link
Collaborator

It incorrectly reverts find_package.
It incorrectly reflects the conditions.

True, I saw that, but that could have been fixed here.

Cf. #1011 for all recent comments transformed into a PR.

This includes the proposed feedback from here, so can we close this?

@supervacuus
Copy link
Collaborator

required changes introduced here: #1013

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.

3 participants