-
Notifications
You must be signed in to change notification settings - Fork 115
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
Unknown error generating cffi file #14
Comments
@zardus: at the very least, it should be @joxeankoret: what did you do involving the vex_dev path? That's not what it usually is, iirc, and if you've changed it so it'll use that folder, you might need to change a few more copies of that path, this time related to the cffi-generation procedure. We parse some of the header files from vex in order to build pyvex, and if it can't find vex in the usual spot it's gonna complain. |
I haven't done anything special. In another x86_64 box it builds perfectly while in that x86 VM it doesn't. I tried to remove the vex symlink so it downloads https://github.com/angr/vex/archive/dev.tar.gz Am I doing something wrong? Do I need to specify some specific path somehow? |
Update: I modified the setup.py script so it shows what is happening:
|
Hi Joxean, It's possible that you're bypassing the dependency resolution, and your
|
Unfortunately, it doesn't, the same happens. |
Bummer... Could you post the output of In the meantime, I looked closer into my code, and that exception should be caught. In the code, there is: try:
ffi.cdef('\n'.join(known_good + questionable))
return questionable
except AssertionError:
return [ ]
except cffi.CDefError as e:
if str(e).count(':') >= 2:
fail = int(str(e).split('\n')[1].split(':')[1])
elif 'unrecognized construct' in str(e):
fail = int(str(e).split()[1][:-1])
elif 'end of input' in str(e):
return find_good_scan(known_good, questionable[:-1])
else:
raise Exception("Unknown error") That first case should catch it ( diff --git a/make_ffi.py b/make_ffi.py
index 3031f10..ba5f071 100644
--- a/make_ffi.py
+++ b/make_ffi.py
@@ -34,6 +34,7 @@ def find_good_scan(known_good, questionable):
except AssertionError:
return [ ]
except cffi.CDefError as e:
+ print repr(str(e))
if str(e).count(':') >= 2:
fail = int(str(e).split('\n')[1].split(':')[1])
elif 'unrecognized construct' in str(e): I can see it print that error and properly continue. Could you apply that and see what it prints? |
Hi, This is the list of pip installed packages:
And this is the ouput after applying your patch:
|
Interesting... I don't see the One thing that jumps out at me is your cffi version. 0.8.2 is the version shipped with ubuntu, and I am fairly sure that it is too old, at least for how we're generating the FFI definitions file. Interestingly enough, it looks like your pycparser is up-to-date; just cffi that's behind. Can you try upgrading it to the latest (1.0.3)? I think it should fix the issue. Using |
I'm getting a different error now :/
I will try to find myself the answer because it seems to be very-very specific to my case. |
Forget it, I had modified the make_ffi.py script as to raise always the errors so I could see. After upgrading cffi myself manually it works as expected. Thanks for all the help! |
No problem; I'm glad it works! |
…eing consistent (angr/archinfo#38); closes angr#14
Hi!
I'm trying to build PyVex in Ubuntu 14.04 (32bits) and I'm getting the following error:
Am I doing something wrong? Thanks!
The text was updated successfully, but these errors were encountered: