lukeparser / pybison

Use Bison directly from Python
https://pypi.org/project/pybison
GNU General Public License v2.0
26 stars 6 forks source link

0.3.1 source package missing file #26

Closed sweetgiorni closed 3 years ago

sweetgiorni commented 3 years ago

Building from source fails with the following errors:

pybison-0.3.1.tar.gz (34.9 kB) Source None Mar 3, 2021
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/bison/cython/bison_.c -o build/temp.linux-x86_64-2.7/src/bison/cython/bison_.o
src/bison/cython/bison_.c:599:33: fatal error: ../c/bison_callback.h: No such file or directory

It looks like bison_callback.h is missing from the package:

bash-4.2# find . -name bison_callback.*
./src/bison/c/bison_callback.c
bash-4.2# 
sbrodehl commented 3 years ago

Hi @sweetgiorni, thanks for letting us know!

Indeed, the file bison_callback.h is not in the source package pybison-0.3.1.tar.gz. It seems that this file was missing in MANIFEST.in, which is fixed now (in version v0.4.1)

However, it seems that you are using python 2.7, which is not actively supported. I would recommend to use python 3, if possible.

Best, @sbrodehl

sweetgiorni commented 3 years ago

Thanks. Yeah, I figured out Python 2 wasn't supported but unfortunately I'm stuck with it for now. But I will be coming back when we switch to Python 3!

sbrodehl commented 3 years ago

Maybe the last supported version works for you, which is v0.2.10 and has packages on pypi. I think the main problem was, that our manylinux build environment dropped support for python 2.7, thus, we were unable to (easily) build the release packages for pypi. Maybe there is a way to build the packages yourself?

sweetgiorni commented 3 years ago

Well I played around with this for a bit and got import bison to succeed. Even when working from the v0.2.10 Git tag I ran into a few issues.

That got the import working, but tests still look pretty broken. Are you sure Python2 was supported at some point? :) If so then I'm doing something very wrong.

Would you be interested in getting this package working with Python 2? If so I can try and get it backward compatible and send a PR. I'm currently using PLY which is slow as hell, and unfortunately there aren't many alternatives

sbrodehl commented 3 years ago

I looked into this and added a new branch, which should get it working with Python2. It includes pretty much the changes you mentioned. bison_.c is updated (compiled for Python2 - we probably need to delete this in the source package later on). I replaced the makedirs call with Path(..).mkdir(..), which introduces pathlib2 as a new dependency.

However, the tests are a different story. I fixed a wrong include, but that was only a cosmetic change. The probleme here is, that the tests are all very old (like decades?!), and meanwhile bison/flex got quite some (breaking) changes. I must admit, the tests need some love ..