Coder Social home page Coder Social logo

Comments (6)

dg0yt avatar dg0yt commented on June 28, 2024

Linux: It seems that the issue had been raised in sentry-native before, but the proposed fixed was never forwarded to vcpkg:
getsentry/sentry-native#596
(My first impression is that it needs a patch to compile pthread_create_linux.cc only if BUILD_SHARED_LIBS.)

from vcpkg.

JonLiu1993 avatar JonLiu1993 commented on June 28, 2024

@Patrix9999, Thanks for posting this issue, regarding the first problem on Windows, I have not reproduced your problem locally. Here is my reproduction example.
CMakeLists:

cmake_minimum_required(VERSION 3.5)

project(test)

find_package(sentry CONFIG REQUIRED)

add_executable(test CMakeProject1.cpp)
target_link_libraries(test PRIVATE sentry::sentry)

CMakeProject1.cpp:

=#include <stdio.h>
#include <sentry.h>

int main()
{
    printf("%s\n", "HELLO WORLD");
    return 0;
}

Config:

1> CMake generation started for configuration: 'x64-Debug'.
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Visual Studio 17 2022" -A x64  -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\test\source\repos\CMakeProject1\out\install\x64-Debug"  -DCMAKE_TOOLCHAIN_FILE=F:/Feature-test/vcpkg/scripts/buildsystems/vcpkg.cmake "C:\Users\test\source\repos\CMakeProject1" 2>&1"
1> Working directory: C:\Users\test\source\repos\CMakeProject1\out\build\x64-Debug
1> [CMake] -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
1> [CMake] -- The C compiler identification is MSVC 19.39.33523.0
1> [CMake] -- The CXX compiler identification is MSVC 19.39.33523.0
1> [CMake] -- Detecting C compiler ABI info
1> [CMake] -- Detecting C compiler ABI info - done
1> [CMake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting C compile features
1> [CMake] -- Detecting C compile features - done
1> [CMake] -- Detecting CXX compiler ABI info
1> [CMake] -- Detecting CXX compiler ABI info - done
1> [CMake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting CXX compile features
1> [CMake] -- Detecting CXX compile features - done
1> [CMake] -- Configuring done (7.3s)
1> [CMake] -- Generating done (0.1s)
1> [CMake] -- Build files have been written to: C:/Users/test/source/repos/CMakeProject1/out/build/x64-debug
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted toolchain configurations.
1> Extracted includes paths.
1> CMake generation finished.

from vcpkg.

Patrix9999 avatar Patrix9999 commented on June 28, 2024

@Patrix9999, Thanks for posting this issue, regarding the first problem on Windows, I have not reproduced your problem locally. Here is my reproduction example. CMakeLists:

cmake_minimum_required(VERSION 3.5)

project(test)

find_package(sentry CONFIG REQUIRED)

add_executable(test CMakeProject1.cpp)
target_link_libraries(test PRIVATE sentry::sentry)

CMakeProject1.cpp:

=#include <stdio.h>
#include <sentry.h>

int main()
{
    printf("%s\n", "HELLO WORLD");
    return 0;
}

Config:

1> CMake generation started for configuration: 'x64-Debug'.
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Visual Studio 17 2022" -A x64  -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\test\source\repos\CMakeProject1\out\install\x64-Debug"  -DCMAKE_TOOLCHAIN_FILE=F:/Feature-test/vcpkg/scripts/buildsystems/vcpkg.cmake "C:\Users\test\source\repos\CMakeProject1" 2>&1"
1> Working directory: C:\Users\test\source\repos\CMakeProject1\out\build\x64-Debug
1> [CMake] -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
1> [CMake] -- The C compiler identification is MSVC 19.39.33523.0
1> [CMake] -- The CXX compiler identification is MSVC 19.39.33523.0
1> [CMake] -- Detecting C compiler ABI info
1> [CMake] -- Detecting C compiler ABI info - done
1> [CMake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting C compile features
1> [CMake] -- Detecting C compile features - done
1> [CMake] -- Detecting CXX compiler ABI info
1> [CMake] -- Detecting CXX compiler ABI info - done
1> [CMake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting CXX compile features
1> [CMake] -- Detecting CXX compile features - done
1> [CMake] -- Configuring done (7.3s)
1> [CMake] -- Generating done (0.1s)
1> [CMake] -- Build files have been written to: C:/Users/test/source/repos/CMakeProject1/out/build/x64-debug
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted toolchain configurations.
1> Extracted includes paths.
1> CMake generation finished.

I'll try to come up with reproducable sample project that has this issue.

from vcpkg.

Patrix9999 avatar Patrix9999 commented on June 28, 2024

From my initial tests i can conclude that this missing ZLIB::ZLIB issue (windows-only) occurs when we will be using a triplet that statically compiles, everything works fine when the sentry gets compiled as dynamic library.

Here's a very simple project that has this issue (i've removed all of the fancy configuration files, to present the issue in a simplest way)
test-app.zip

The problem occurs during generation stage while using triplet that statically compiles the code, e.g: x64-windows-static.

How to generate/build the project:

  • create build subfolder inside the project structure
  • cd into build directory
  • run cmake .. -DCMAKE_TOOLCHAIN_FILE=ABSOLUTE_PATH_TO_VCPKG_ROOT_DIR/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static

Such project won't be generated correctly, and it will produce the following error:

CMake Error at build/vcpkg_installed/x64-windows-static/share/sentry/sentry_crashpad-targets.cmake:105 (set_target_prope          rties):
  The link interface of target "sentry_crashpad::zlib" contains:

    ZLIB::ZLIB

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

The issue can be avoided by compiling the vcpkg ports as dynamic libraries, or by adding additional zlib port dependency, but i still think that this is unintended behaviour, mostly because accoring to vcpkg, port should be self contained, correct me if i'm wrong (maybe i'm missing something out).

from vcpkg.

JonLiu1993 avatar JonLiu1993 commented on June 28, 2024

@Patrix9999, thanks for the repro project, I have reproduced this Windows bug and fixed it, I will submit it in my PR.

from vcpkg.

Patrix9999 avatar Patrix9999 commented on June 28, 2024

No problem, i'm just glad that i was able to help you to find a solution to this problem quicker (i would personally try to open a pull request, but unfortunately i didn't have time to investigate what might be the issue).
Good job 👍

from vcpkg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.