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

Generate Python Bindings failure #1976

Closed
1 task done
utoni opened this issue May 15, 2023 · 1 comment
Closed
1 task done

Generate Python Bindings failure #1976

utoni opened this issue May 15, 2023 · 1 comment
Assignees
Labels

Comments

@utoni
Copy link
Collaborator

utoni commented May 15, 2023

Describe the bug

Due to fixing CI for PR #1974 it is required to build Python Bindings.

But when I try to build those locally I get an exception I do not understand:

[lns@devlap python]$ python ./setup.py install
/usr/lib/python3.11/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/cffi/cparser.py", line 336, in _parse
    ast = _get_parser().parse(fullcsource)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pycparser/c_parser.py", line 147, in parse
    return self.cparser.parse(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pycparser/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pycparser/ply/yacc.py", line 1199, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pycparser/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
        ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pycparser/c_parser.py", line 1931, in p_error
    self._parse_error(
  File "/usr/lib/python3.11/site-packages/pycparser/plyparser.py", line 67, in _parse_error
    raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: <cdef source string>:1799:24: before: __attribute__

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lns/git/nDPI/python/./setup.py", line 25, in <module>
    setup(
  File "/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 147, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 495, in __init__
    _Distribution.__init__(
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
    self.finalize_options()
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 934, in finalize_options
    ep(self)
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 954, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/usr/lib/python3.11/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
    add_cffi_module(dist, cffi_module)
  File "/usr/lib/python3.11/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
    execfile(build_file_name, mod_vars)
  File "/usr/lib/python3.11/site-packages/cffi/setuptools_ext.py", line 25, in execfile
    exec(code, glob, glob)
  File "ndpi/ndpi_build.py", line 133, in <module>
    ffi_builder.cdef(NDPI_CDEF)
  File "/usr/lib/python3.11/site-packages/cffi/api.py", line 112, in cdef
    self._cdef(csource, override=override, packed=packed, pack=pack)
  File "/usr/lib/python3.11/site-packages/cffi/api.py", line 126, in _cdef
    self._parser.parse(csource, override=override, **options)
  File "/usr/lib/python3.11/site-packages/cffi/cparser.py", line 389, in parse
    self._internal_parse(csource)
  File "/usr/lib/python3.11/site-packages/cffi/cparser.py", line 394, in _internal_parse
    ast, macros, csource = self._parse(csource)
                           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/cffi/cparser.py", line 338, in _parse
    self.convert_pycparser_error(e, csource)
  File "/usr/lib/python3.11/site-packages/cffi/cparser.py", line 367, in convert_pycparser_error
    raise CDefError(msg)
cffi.CDefError: cannot parse "typedef int register_t __attribute__ ((__mode__ (__word__)));"
<cdef source string>:1799:24: before: __attribute__

Expected behavior

The generation of Python Bindings should not only work in the CI.

Obtained behavior

Failure with the aforementioned traceback.

nDPI Environment (please complete the following information):

  • OS name: ArchLinux
  • OS version: current
  • Architecture: amd64
  • nDPI version or commit hash: dev
  • nDPI compilation flags used: CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages --with-sanitizer --with-pcre --with-maxminddb --enable-tls-sigs CC=clang CXX=clang++ && make -j4

How to reproduce the reported bug

Reproducible using ndpiReader?

  • The reported bug is not reproducible using ndpiReader.

config.log

@utoni
Copy link
Collaborator Author

utoni commented May 20, 2023

Nevermind, I created the mistake with the PR...

@utoni utoni closed this as completed May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants