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

[safetyhook] new port #43983

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

[safetyhook] new port #43983

wants to merge 5 commits into from

Conversation

llm96
Copy link
Contributor

@llm96 llm96 commented Feb 23, 2025

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@llm96
Copy link
Contributor Author

llm96 commented Feb 23, 2025

@microsoft-github-policy-service agree

@jimwang118 jimwang118 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Feb 24, 2025
@llm96
Copy link
Contributor Author

llm96 commented Feb 25, 2025

Is there anything I can do to fix the x64 Linux build? I'm able to build it locally with GCC v14.2, but the CI runner appears to be using v11.4 and I don't think std::expected was made available until v12.

-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
Change Dir: '/mnt/vcpkg-ci/b/safetyhook/x64-linux-dbg'

Run Build Command(s): /mnt/vcpkg-ci/downloads/tools/ninja-1.12.1-linux/ninja -v -v -j33 install
[1/10] /usr/bin/c++ -DZYCORE_STATIC_BUILD -DZYDIS_STATIC_BUILD -I/mnt/vcpkg-ci/b/safetyhook/src/v0.6.4-e3cea2541a.clean/include -isystem /mnt/vcpkg-ci/installed/x64-linux/include -fPIC -g -std=gnu++23 -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -MD -MT CMakeFiles/safetyhook.dir/src/easy.cpp.o -MF CMakeFiles/safetyhook.dir/src/easy.cpp.o.d -o CMakeFiles/safetyhook.dir/src/easy.cpp.o -c /mnt/vcpkg-ci/b/safetyhook/src/v0.6.4-e3cea2541a.clean/src/easy.cpp
FAILED: CMakeFiles/safetyhook.dir/src/easy.cpp.o 
/usr/bin/c++ -DZYCORE_STATIC_BUILD -DZYDIS_STATIC_BUILD -I/mnt/vcpkg-ci/b/safetyhook/src/v0.6.4-e3cea2541a.clean/include -isystem /mnt/vcpkg-ci/installed/x64-linux/include -fPIC -g -std=gnu++23 -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -MD -MT CMakeFiles/safetyhook.dir/src/easy.cpp.o -MF CMakeFiles/safetyhook.dir/src/easy.cpp.o.d -o CMakeFiles/safetyhook.dir/src/easy.cpp.o -c /mnt/vcpkg-ci/b/safetyhook/src/v0.6.4-e3cea2541a.clean/src/easy.cpp
In file included from /mnt/vcpkg-ci/b/safetyhook/src/v0.6.4-e3cea2541a.clean/include/safetyhook/easy.hpp:7,
                 from /mnt/vcpkg-ci/b/safetyhook/src/v0.6.4-e3cea2541a.clean/src/easy.cpp:1:
/mnt/vcpkg-ci/b/safetyhook/src/v0.6.4-e3cea2541a.clean/include/safetyhook/inline_hook.hpp:8:10: fatal error: expected: No such file or directory
    8 | #include <expected>
      |          ^~~~~~~~~~
compilation terminated.

@dg0yt
Copy link
Contributor

dg0yt commented Feb 25, 2025

When x64-linux gcc in CI is too old, add safetyhook:x64-linux=fail to scripts/ci.baseline.txt.

@llm96 llm96 marked this pull request as ready for review February 26, 2025 00:14
@jimwang118
Copy link
Contributor

The following error occurred in the usage test.

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error		CMake Error at F:/safe/installed/x64-windows/share/safetyhook/safetyhook-config.cmake:60 (set_target_properties):
  The link interface of target "safetyhook::safetyhook" contains:

    Zydis::Zydis

  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.		F:/safe/installed/x64-windows/share/safetyhook/safetyhook-config.cmake	60	

@jimwang118 jimwang118 marked this pull request as draft February 26, 2025 02:05
@llm96
Copy link
Contributor Author

llm96 commented Feb 26, 2025

Ah, I've been testing with a project that calls find_package(zydis) before find_package(safetyhook) so I didn't catch that.

I've added a small patch to update the install rules a bit. I contributed the initial ones upstream but it seems like I missed a couple of things. Can you take a look at this updated version and let me know if it works for you now?

I'll try to get any necessary CMake changes merged upstream before switching away from draft again.

@jimwang118
Copy link
Contributor

Ah, I've been testing with a project that calls find_package(zydis) before find_package(safetyhook) so I didn't catch that.

I've added a small patch to update the install rules a bit. I contributed the initial ones upstream but it seems like I missed a couple of things. Can you take a look at this updated version and let me know if it works for you now?

I'll try to get any necessary CMake changes merged upstream before switching away from draft again.

Usage test passed with x64-windows triplet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants