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

[New port] Add Triton port #23111

Merged
merged 17 commits into from
Feb 22, 2022
Merged

[New port] Add Triton port #23111

merged 17 commits into from
Feb 22, 2022

Conversation

illera88
Copy link
Contributor

Describe the pull request
This PR adds support for Triton

  • What does your PR fix?

Lack of Triton port

  • Which triplets are supported/not supported? Have you updated the CI baseline?

All

Yes

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

Yes

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout b1642553ec6049bb5ccdf59bea6b4aaca1033e82 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 716c99c..d35fd12 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7008,6 +7008,10 @@
       "baseline": "1.6",
       "port-version": 2
     },
+    "triton": {
+      "baseline": "v0.9",
+      "port-version": 0
+    },
     "trompeloeil": {
       "baseline": "41",
       "port-version": 0

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout b1642553ec6049bb5ccdf59bea6b4aaca1033e82 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 716c99c..d35fd12 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7008,6 +7008,10 @@
       "baseline": "1.6",
       "port-version": 2
     },
+    "triton": {
+      "baseline": "v0.9",
+      "port-version": 0
+    },
     "trompeloeil": {
       "baseline": "41",
       "port-version": 0

@illera88
Copy link
Contributor Author

illera88 commented Feb 16, 2022

Hi @NancyLi1013
I've tried again to port Triton to vcpkg. I made all the changes you suggested at #17224

Can you give me a hand here. How can I see the output error in the CI to know what went wrong?

The compilation output is not shown in the CI and needs to be gotten from D:\buildtrees\triton\install-x64-windows-static-dbg-out.log
How can I see that file?

Thank you

@JonLiu1993 JonLiu1993 self-assigned this Feb 16, 2022
@JonLiu1993 JonLiu1993 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Feb 16, 2022
@JonLiu1993
Copy link
Member

@illera88 ,Thanks for your pr,
This is D:\buildtrees\triton\install-x64-windows-static-dbg-out.log
install-x64-windows-static-dbg-out.log

For other log files, you can click on the button I circled in yellow step by step to get the log you want

  1. https://dev.azure.com/vcpkg/public/_build/results?buildId=67464&view=logs&j=878666d5-db33-5b27-9e7d-b0c7ee352005

image

  1. https://dev.azure.com/vcpkg/public/_build/results?buildId=67464&view=artifacts&pathAsName=false&type=publishedArtifacts

image

@illera88
Copy link
Contributor Author

@illera88 ,Thanks for your pr, This is D:\buildtrees\triton\install-x64-windows-static-dbg-out.log install-x64-windows-static-dbg-out.log

For other log files, you can click on the button I circled in yellow step by step to get the log you want

  1. https://dev.azure.com/vcpkg/public/_build/results?buildId=67464&view=logs&j=878666d5-db33-5b27-9e7d-b0c7ee352005

image

  1. https://dev.azure.com/vcpkg/public/_build/results?buildId=67464&view=artifacts&pathAsName=false&type=publishedArtifacts

image

thanks! I'll get into it

@illera88
Copy link
Contributor Author

illera88 commented Feb 16, 2022

The error is weird:

FAILED: src/libtriton/CMakeFiles/triton.dir/arch/arm/arm32/arm32Semantics.cpp.obj 
C:\PROGRA~2\MICROS~3\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe   /TP  -ID:\installed\x64-windows-static\include -IC:\a\1\s\installed\x64-windows-static\include\capstone -ID:\buildtrees\triton\src\v0.9-f0430e9d31.clean\src\libtriton\includes -ID:\buildtrees\triton\x64-windows-static-dbg\src\libtriton\includes /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP  /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1  -MTd /showIncludes /Fosrc\libtriton\CMakeFiles\triton.dir\arch\arm\arm32\arm32Semantics.cpp.obj /Fdsrc\libtriton\CMakeFiles\triton.dir\triton.pdb /FS -c D:\buildtrees\triton\src\v0.9-f0430e9d31.clean\src\libtriton\arch\arm\arm32\arm32Semantics.cpp
D:\buildtrees\triton\src\v0.9-f0430e9d31.clean\src\libtriton\includes\triton/externalLibs.hpp(38): fatal error C1083: Cannot open include file: 'capstone.h': No such file or directory

it's complaining about not finding capstone:

externalLibs.hpp(38): fatal error C1083: Cannot open include file: 'capstone.h': No such file or directory

but capstone is being added to the include path:

 -IC:\a\1\s\installed\x64-windows-static\include\capstone 

Do you know why that weird path C:\a\1\s\...?

@JonLiu1993 do you have any idea why this can be happening?

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout b1642553ec6049bb5ccdf59bea6b4aaca1033e82 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 52a2bf0..35eae61 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7010,7 +7010,7 @@
     },
     "triton": {
       "baseline": "v0.9",
-      "port-version": 0
+      "port-version": 3
     },
     "trompeloeil": {
       "baseline": "41",
diff --git a/versions/t-/triton.json b/versions/t-/triton.json
index 78ae43e..a327bbe 100644
--- a/versions/t-/triton.json
+++ b/versions/t-/triton.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "3644b66aeb7fa748fc71da5949f104dcdc1f8951",
+      "version-string": "v0.9",
+      "port-version": 3
+    },
     {
       "git-tree": "4a5375cb3821109f648393170e4a062c52cb7b8e",
       "version-string": "v0.9",

@JackBoosY JackBoosY self-assigned this Feb 16, 2022
@illera88
Copy link
Contributor Author

Hi @JackBoosY,

Maybe you know what could be failing.

thank you so much

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout b1642553ec6049bb5ccdf59bea6b4aaca1033e82 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 52a2bf0..4b01347 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7009,7 +7009,7 @@
       "port-version": 2
     },
     "triton": {
-      "baseline": "v0.9",
+      "baseline": "0.9",
       "port-version": 0
     },
     "trompeloeil": {
diff --git a/versions/t-/triton.json b/versions/t-/triton.json
index a327bbe..eec00a4 100644
--- a/versions/t-/triton.json
+++ b/versions/t-/triton.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "9522fbfccc6dbd7c0f4fcbfef39eda7482e8f6bd",
+      "version": "0.9",
+      "port-version": 0
+    },
     {
       "git-tree": "3644b66aeb7fa748fc71da5949f104dcdc1f8951",
       "version-string": "v0.9",

@JackBoosY
Copy link
Contributor

The Config.cmake.in also needs to be fixed.

@JackBoosY
Copy link
Contributor

JackBoosY commented Feb 16, 2022

[51/59] : && /Library/Developer/CommandLineTools/usr/bin/c++ -pthread -g -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -static src/examples/cpp/CMakeFiles/ir.dir/ir.cpp.o -o src/examples/cpp/ir  src/libtriton/libtriton.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libz3.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libcapstone.a && :
FAILED: src/examples/cpp/ir 
: && /Library/Developer/CommandLineTools/usr/bin/c++ -pthread -g -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -static src/examples/cpp/CMakeFiles/ir.dir/ir.cpp.o -o src/examples/cpp/ir  src/libtriton/libtriton.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libz3.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libcapstone.a && :
ld: library not found for -lcrt0.o

No idea where crt0.o comes from.

Edit: https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag
https://github.com/JonathanSalwan/Triton/blob/master/src/examples/cpp/CMakeLists.txt#L6

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout b1642553ec6049bb5ccdf59bea6b4aaca1033e82 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 52a2bf0..4b01347 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7009,7 +7009,7 @@
       "port-version": 2
     },
     "triton": {
-      "baseline": "v0.9",
+      "baseline": "0.9",
       "port-version": 0
     },
     "trompeloeil": {
diff --git a/versions/t-/triton.json b/versions/t-/triton.json
index a327bbe..642eac7 100644
--- a/versions/t-/triton.json
+++ b/versions/t-/triton.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "7ff7b5b2333d632ad879cc5e9f80224a5963ec55",
+      "version": "0.9",
+      "port-version": 0
+    },
     {
       "git-tree": "3644b66aeb7fa748fc71da5949f104dcdc1f8951",
       "version-string": "v0.9",

@JackBoosY
Copy link
Contributor

This port still have some cmake bugs, we should wait for the upstream to fix them completely.

@JackBoosY JackBoosY added the requires:all-feature-testing vcpkg install port[all features supported by that port] needs to be demonstrated to function label Feb 21, 2022
@JackBoosY
Copy link
Contributor

When building triton[*]:x86-windows:

[1/81] "C:\PROGRA~2\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86\cl.exe"   /TP -DBUILDING_DLL -DG:/23111/vcpkg/installed/x86-windows/debug/lib/python310_d.lib" -DG:/23111/vcpkg/installed/x86-windows/lib/python310.lib -DPYTHON_LIBRARIES=\"optimized -Ddebug -Dtriton_EXPORTS -IG:\23111\vcpkg\installed\x86-windows\include\python3.10 -IG:\23111\vcpkg\installed\x86-windows\include\capstone -IG:\23111\vcpkg\buildtrees\triton\src\14e2382e7a-dbfc11990e.clean\src\libtriton\includes -IG:\23111\vcpkg\buildtrees\triton\x86-windows-dbg\src\libtriton\includes -IG:\23111\vcpkg\installed\x86-windows\include /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP  /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1  -MDd /showIncludes /Fosrc\libtriton\CMakeFiles\triton.dir\api\api.cpp.obj /Fdsrc\libtriton\CMakeFiles\triton.dir\ /FS -c G:\23111\vcpkg\buildtrees\triton\src\14e2382e7a-dbfc11990e.clean\src\libtriton\api\api.cpp
FAILED: src/libtriton/CMakeFiles/triton.dir/api/api.cpp.obj 
"C:\PROGRA~2\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86\cl.exe"   /TP -DBUILDING_DLL -DG:/23111/vcpkg/installed/x86-windows/debug/lib/python310_d.lib" -DG:/23111/vcpkg/installed/x86-windows/lib/python310.lib -DPYTHON_LIBRARIES=\"optimized -Ddebug -Dtriton_EXPORTS -IG:\23111\vcpkg\installed\x86-windows\include\python3.10 -IG:\23111\vcpkg\installed\x86-windows\include\capstone -IG:\23111\vcpkg\buildtrees\triton\src\14e2382e7a-dbfc11990e.clean\src\libtriton\includes -IG:\23111\vcpkg\buildtrees\triton\x86-windows-dbg\src\libtriton\includes -IG:\23111\vcpkg\installed\x86-windows\include /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP  /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1  -MDd /showIncludes /Fosrc\libtriton\CMakeFiles\triton.dir\api\api.cpp.obj /Fdsrc\libtriton\CMakeFiles\triton.dir\ /FS -c G:\23111\vcpkg\buildtrees\triton\src\14e2382e7a-dbfc11990e.clean\src\libtriton\api\api.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27045 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Any ideas?

@JackBoosY JackBoosY removed requires:author-response requires:all-feature-testing vcpkg install port[all features supported by that port] needs to be demonstrated to function labels Feb 21, 2022
@JackBoosY
Copy link
Contributor

Already test all features in x86-windows and x64-windows-static.

@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Feb 21, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

Error: Local changes detected for triton but no changes to version or port version.
-- Version: 0.9
-- Old SHA: 7bb96cd4335af94137d15e10afd60be62a8f6e6d
-- New SHA: c42e8b0b38297c41dc4f9a6beab124d9912a6939
-- Did you remember to update the version or port version?
-- Pass `--overwrite-version` to bypass this check.
***No files were updated.***

@illera88
Copy link
Contributor Author

illera88 commented Feb 21, 2022

Hi @JackBoosY

I made a change to the code so capstone is required to be installed with:

{
      "name": "capstone",
      "default-features": false,
      "features": [
        "arm",
        "arm64",
        "static-crt",
        "x86"
      ]
    },

static-crt capstone feature has not yet been merged into master but it is on its way. So please don't merge until that's done so we can test it properly.

Here is the PR to add static-crt to Capstone for reference.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

Error: Local changes detected for triton but no changes to version or port version.
-- Version: 0.9
-- Old SHA: 7bb96cd4335af94137d15e10afd60be62a8f6e6d
-- New SHA: 168cc90ef1373fadb8b05ad53430eb37a022dd50
-- Did you remember to update the version or port version?
-- Pass `--overwrite-version` to bypass this check.
***No files were updated.***

@illera88
Copy link
Contributor Author

Hi @JackBoosY

I think now it is ready

@JackBoosY JackBoosY removed the info:reviewed Pull Request changes follow basic guidelines label Feb 22, 2022
@JonLiu1993
Copy link
Member

All features are tested successfully in the following triplet:

  • x86-windows
  • x64-windows
  • x64-windows-static

@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Feb 22, 2022
@vicroms vicroms merged commit 3d7ff26 into microsoft:master Feb 22, 2022
@illera88
Copy link
Contributor Author

Hi @JackBoosY and @JonLiu1993

I think this port is not working. When adding to CMakelists.txt:

 find_package(triton CONFIG REQUIRED)

It ends up with:

CMake Error at C:/Users/user/Documents/code/vcpkg/installed/x64-windows-static/share/triton/tritonConfig.cmake:53 (include_directories):
  include_directories given empty-string as include directory.
Call Stack (most recent call first):
  C:/Users/user/Documents/code/vcpkg/scripts/buildsystems/vcpkg.cmake:782 (_find_package)
  CMakeLists.txt:17 (find_package)

If I check C:/Users/user/Documents/code/vcpkg/installed/x64-windows-static/share/triton/tritonConfig.cmake:53
I can see:

# Z3 include directories
if (TRITON_Z3_INTERFACE)
    include_directories("")
endif()

Who creates tritonConfig.cmake? Why are the Z3 include directories empty?

Thanks

@JackBoosY JackBoosY mentioned this pull request Feb 24, 2022
BillyONeal added a commit to BillyONeal/vcpkg that referenced this pull request Feb 24, 2022
84: Pass StartDate and EndDate to Get-MergedPullRequests instead of special casing only Credentials
109+130: Fix calculating negative progress caused by seeing PRs in the future because GitHub returns times in UTC
268: Actually make filtering for infrastructure PRs functional
303: Fix extraction of port-version from vcpkg.json. This really should be handled by diffing baseline.json in the future.
374-382: Fix expression ordering and casting problem which prevented non-CONTROL ports from ever being considered "new"

Also skip emitting headers for empty blocks, update and sort current triplet list, and move infrastructure bits below
port modifications.

Example output:

vcpkg (2022.02.19 - 2022.02.22)
---
#### Total port count:
#### Total port count per triplet (tested):
|triplet|ports available|
|---|---|
|x86-windows|NUM|
|**x64-windows**|NUM|
|x64-windows-static|NUM|
|x64-windows-static-md|NUM|
|x64-uwp|NUM|
|arm64-windows|NUM|
|arm-uwp|NUM|
|**x64-osx**|NUM|
|**x64-linux**|NUM|
<details>
<summary><b>The following 2 ports have been added:</b></summary>

|port|version|
|---|---|
|[libcurl-simple-https](microsoft#22917
|[triton](microsoft#23111

</details>
<details>
<summary><b>The following 18 ports have been updated:</b></summary>

- polyhook2 `2022-02-06#0` -> `2022-02-21#0`
    - [(microsoft#23203)](microsoft#23203) [polyhook2] Update to latest (2022-02-21) (by @acidicoala)
- graphviz `2.49.1#1` -> `2.49.1#2`
    - [(microsoft#23148)](microsoft#23148) [graphviz] Fix tools (by @Ace314159)
- itk `5.1.0#7` -> `5.2.1#0`
    - [(microsoft#23158)](microsoft#23158) [ITK] update to v5.2.1 (by @Adela0814)
- qhull `8.0.2#2` -> `8.0.2#3`
    - [(microsoft#23129)](microsoft#23129) [qhull] Fix copyright, pc files, cmake usage (by @dg0yt)
- tgui `2021-04-19#2` -> `2021-04-19#3`
    - [(microsoft#23211)](microsoft#23211) [tgui] fix absolute paths (by @autoantwort)
- json-dto `0.3.0#0` -> `0.3.1#0`
    - [(microsoft#23224)](microsoft#23224) [json-dto] Update to 0.3.1 (by @eao197)
- leveldb `1.22#4` -> `1.22#5`
    - [(microsoft#23180)](microsoft#23180) [leveldb] Fix homepage (by @MarcoFalke)
- openxr-loader `1.0.22#0` -> `1.0.22#1`
    - [(microsoft#23191)](microsoft#23191) [openxr-loader] Fix build failure in world rebuild CI. (by @Hoikas)
- ngspice `35#1` -> `35#2`
    - [(microsoft#23151)](microsoft#23151) [ngspice] Fix error C2065 (by @Cheney-W)
- openmvg `2.0#1` -> `2.0#2`
    - [(microsoft#23114)](microsoft#23114) [cereal] Update to 1.3.1 (by @mapret)
- lazy-importer `2021-10-23#0` -> `2022-02-09#0`
    - [(microsoft#23192)](microsoft#23192) [lazy-importer] Update to 2022-02-09 (by @Thomas1664)
- gstreamer `1.19.2#3` -> `1.19.2#4`
    - [(microsoft#23125)](microsoft#23125) [gstreamer] Support arm-windows and add features (by @JackBoosY)
- charls `2.2.0#2` -> `2.3.4#0`
    - [(microsoft#23189)](microsoft#23189) [charls] Update to 2.3.4 (by @Thomas1664)
- arrow `7.0.0#0` -> `7.0.0#1`
    - [(microsoft#23188)](microsoft#23188) [arrow] add plasma support for non Windows platforms (by @fran6co)
- trantor `1.5.4#0` -> `1.5.5#0`
    - [(microsoft#23182)](microsoft#23182) [trantor] Update to 1.5.5 (by @an-tao)
- capstone `4.0.2#2` -> `4.0.2#3`
    - [(microsoft#23122)](microsoft#23122) [capstone] Use static runtime if capstone wants to be statically linked (by @illera88)
- gainput `1.0.0#4` -> `1.0.0#5`
    - [(microsoft#23219)](microsoft#23219) [gainput] Support Linux (by @JackBoosY)
- cereal `1.3.0#1` -> `1.3.1#0`
    - [(microsoft#23114)](microsoft#23114) [cereal] Update to 1.3.1 (by @mapret)

</details>
<details>
<summary>The following additional changes have been made to vcpkg's infrastructure:</summary>

- [(microsoft#23045)](microsoft#23045) [vcpkg docs] Update ko_KR translation (by @jnooree)
- [(microsoft#23181)](microsoft#23181) [vcpkg doc] Fixes typo in vcpkg_download_distfile.cmake (by @acd1034)

</details>
-- vcpkg team vcpkg@microsoft.com Thu, 24 February 00:29:57 -0800
@JackBoosY
Copy link
Contributor

@illera88 Fixed.

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! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants