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

build with python38? #1

Open
Ch3nYe opened this issue Mar 2, 2023 · 5 comments
Open

build with python38? #1

Ch3nYe opened this issue Mar 2, 2023 · 5 comments

Comments

@Ch3nYe
Copy link

Ch3nYe commented Mar 2, 2023

Can I build pygrap with python38?

The prebuild _pygrap.pyd seems to rely on Python27 DLLs (check with import table), it does not work with python3.

I have already try to build the pygrap in my windows, but it failed due to the identifier errors in xmemory and atomic in path\to\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include. For more detail about the errors:

C2039 "invalid_ parameter": 不是”'global namespace'"的成员" in xmemory line 156.
->_STL_ASSERT<- (_Ptr_user[-2] == _Big_allocation_sentinel, "invalid argument");

C2039 "invalid_ parameter": 不是”'global namespace'"的成员" in xmemory line 206.
->INVALID_MEMORY_ORDER<-;

and unknown identifier in path\to\grap\src\build\bindings\python\CMakeFiles\pygrap.dir

C3861 ”_PyObject_GC_UNTRACK":找不到标识符 in pygrapPYTHON_wrap.cxx

Again, I wanna know if pygrap could be built for python3.

Looking forward to reply. Thanks~

@yaps8
Copy link
Member

yaps8 commented Mar 6, 2023

Hello, thank you for reporting the issue.

grap/pygrap are (now) written in python3 and work in IDA with python3 on Linux.

You are right about the prebuilt _pygrap.pyd for Windows, it was built before migration to python3 and therefore relies on python27.

I am now using grap/pygrap only on Linux so the Windows build has not been maintained, I do not have a working build environment nor up-to-date build instructions, the steps I took to build the existing windows version are here:

Could you try and debug the issue:

  • If this is an issue in the code, could you try to correct it? I can then check if it still compiles on Linux
  • If this is Visual Studio being too picky, maybe there is an option to disable the checks?

@Ch3nYe
Copy link
Author

Ch3nYe commented Mar 8, 2023

Thanks for your reply,

Please keep this issue open for a while, and I will try build the pygrap package for py3 on Windows.

@Ch3nYe
Copy link
Author

Ch3nYe commented Mar 8, 2023

It seems that the files Parser.hpp Lexer.hpp Parser.cpp Lexer.cpp is missing, when I compile the pygrap package. Are they generated dynamically in compliation? I cannot found where are the command line for generation.

Looking for your kind reply.

@Ch3nYe Ch3nYe closed this as completed Mar 8, 2023
@Ch3nYe Ch3nYe reopened this Mar 8, 2023
@yaps8
Copy link
Member

yaps8 commented Mar 9, 2023

Yes, they are generated with flex+bison, the cmake commands are there:

https://github.com/QuoSecGmbH/grap/blob/master/src/libs/dotparser/CMakeLists.txt

The input is in the same directory (Lexer.l, Parser.y and .cpp/.hpp files).

@Ch3nYe
Copy link
Author

Ch3nYe commented Mar 11, 2023

It seems the generation of these files are failed, I will try to fix it

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

No branches or pull requests

2 participants