lukeparser / pybison

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

build lib only in temp folder (disables any local intermediate files) #35

Closed da-h closed 2 years ago

da-h commented 2 years ago

This PR moves the whole build process to the /tmp/pybison_X/ directory.

Both problems disappear by moving the whole build process (including bison / flex) to the temporary directory.

da-h commented 2 years ago

A small side-note: As no build files are created besides the PyBison-Parser definition, we can also omit the cleanup in the end of the buildLib-Method. What do you think?

sbrodehl commented 2 years ago

Hey @da-h, totally agree with your points. One thing I would like to check is if bison/flex overwrites already existing files. If I remember correctly we explicitly deleted some files before the subprocess is called, because something did not work right with already existing files.

da-h commented 2 years ago

Sure, I tested this at least for some cases and did not encounter any bugs, but I would not put my hand in the fire for this.

Easiest is probably to just remove the temporary directory? On the other hand, partial rebuilds may decrease compile time during development for larger parsers.