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

pycparser 2.14 wheel on PyPI differs from source distribution #148

Closed
indygreg opened this issue Oct 2, 2016 · 6 comments
Closed

pycparser 2.14 wheel on PyPI differs from source distribution #148

indygreg opened this issue Oct 2, 2016 · 6 comments

Comments

@indygreg
Copy link

indygreg commented Oct 2, 2016

Sometime in the past few hours, fresh virtualenvs using pycparser 2.14 started barfing in CFFI parsing with AssertionError: sorry, but this version only supports 100 named groups. Here is an example stack:

py27 runtests: commands[0] | python setup.py clean develop bdist_wheel
Traceback (most recent call last):
  File "setup.py", line 52, in <module>
    import make_cffi
  File "/home/travis/build/indygreg/python-zstandard/make_cffi.py", line 105, in <module>
    ffi.cdef(source.decode('latin1'))
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/cffi/api.py", line 105, in cdef
    self._cdef(csource, override=override, packed=packed)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/cffi/api.py", line 119, in _cdef
    self._parser.parse(csource, override=override, **options)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/cffi/cparser.py", line 299, in parse
    self._internal_parse(csource)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/cffi/cparser.py", line 304, in _internal_parse
    ast, macros, csource = self._parse(csource)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/cffi/cparser.py", line 260, in _parse
    ast = _get_parser().parse(csource)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/cffi/cparser.py", line 40, in _get_parser
    _parser_cache = pycparser.CParser()
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/pycparser/c_parser.py", line 87, in __init__
    outputdir=taboutputdir)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/pycparser/c_lexer.py", line 66, in build
    self.lexer = lex.lex(object=self, **kwargs)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/pycparser/ply/lex.py", line 911, in lex
    lexobj.readtab(lextab, ldict)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/site-packages/pycparser/ply/lex.py", line 233, in readtab
    titem.append((re.compile(pat, lextab._lexreflags | re.VERBOSE), _names_to_funcs(func_name, fdict)))
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/re.py", line 194, in compile
    return _compile(pattern, flags)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/re.py", line 249, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/home/travis/build/indygreg/python-zstandard/.tox/py27/lib/python2.7/sre_compile.py", line 583, in compile
    "sorry, but this version only supports 100 named groups"
AssertionError: sorry, but this version only supports 100 named groups

This CI environment is pinning versions, so it should be deterministic.

Strangely, I was able to reproduce this error on a fresh virtualenv but not an existing one. I diffed the contents of the virtualenvs and saw that a number of .py files related to pycparser had changed!

Looking at https://pypi.python.org/pypi/pycparser, there is a pycparser-2.14.tar.gz uploaded 2015-06-10. There is also a pycparser-2.14-py2.py3-none-any.whl uploaded today.

If you compare the source in the .tar.gz from the wheel, it varies.

It looks like the wheel just uploaded to PyPI was cut from a different commit than what the tar.gz was cut from. And since modern versions of pip prefer downloading wheels over the source distribution, pip is downloading the wheel.

Please delete the bad wheel from PyPI. Please also consider cutting a 2.15 release that is the same commit as 2.14 but with matching sources.

@smtakeda
Copy link

smtakeda commented Oct 2, 2016

came across the same issue. reported in #147

@mdewhirst
Copy link

This issue is apparently preventing Lets Encrypt from working on some systems ...
https://community.letsencrypt.org/t/certbot-auto-fails-while-setting-up-virtual-environment-complains-about-package-hashes/20529/9

@indygreg
Copy link
Author

indygreg commented Oct 3, 2016

This is a dupe of #147 and there are workarounds listed in that issue until the bad wheel is yanked from PyPI.

@rodrigc
Copy link

rodrigc commented Oct 3, 2016

Saw the same problem building https://github.com/buildbot/buildbot

@tardyp the buggy pycparser wheel is affecting latest builds of buildbot

@simquad
Copy link

simquad commented Oct 3, 2016

This is also affecting the install of Sentry

@eliben
Copy link
Owner

eliben commented Oct 3, 2016

I removed the wheel [it was uploaded following a request in #100]

@eliben eliben closed this as completed Oct 3, 2016
hectcastro pushed a commit to raster-foundry/raster-foundry that referenced this issue Oct 18, 2016
Don't use the wheels provided by pycparser because they are inconsistent
with the source.

See:

- eliben/pycparser#148
- pyca/cryptography#3187
niranjan94 added a commit to fossasia/open-event-server that referenced this issue Oct 18, 2016
Added pycparser as a workaround for eliben/pycparser#148
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

Successfully merging a pull request may close this issue.

6 participants