rene-dev / stmbl

AC Servo Driver for STM32F4
GNU General Public License v3.0
840 stars 404 forks source link

improved build time by having Python generated code preserve it's mod… #107

Closed rene-dev closed 3 years ago

rene-dev commented 3 years ago

…ification date when it's content isn't changing

rene-dev commented 3 years ago

passes on travis, but I cant build. https://travis-ci.org/github/rene-dev/stmbl/builds/727774238

Generating tables Traceback (most recent call last): File "tools/create_hal_tbl.py", line 8, in header = file_updater.FileUpdater(sys.argv[1] + '/inc/hal_tbl.h') File "/home/rene/dev/stmbl/tools/file_updater.py", line 24, in init self.tempFile = tempfile.TemporaryFile(mode='rw+b') File "/usr/lib/python3.8/tempfile.py", line 745, in TemporaryFile return _io.open(fd, mode, buffering=buffering, ValueError: must have exactly one of create/read/write/append mode Exception ignored in: <function FileUpdater.del at 0x7f2a1e909c10> Traceback (most recent call last): File "/home/rene/dev/stmbl/tools/file_updater.py", line 27, in del if not self.tempFile.closed: AttributeError: 'FileUpdater' object has no attribute 'tempFile' make: *** [Makefile:297: tbl] Error 1

fdarling commented 3 years ago

I was doing "rw+b" when you are supposed to only do "r+b", and apparently my installed version of Python is less strict.

https://docs.python.org/3/library/functions.html#open

I perhaps should not be using binary mode in order to correctly generate operating system native line endings, but it shouldn't matter for the purposes of compiling. Let me know if you still have any trouble building.

crinq commented 3 years ago

i merged and extended this in the fast_make branch create_hal_tbl.py now creates a separate header file for each component to solve the cyclic dependency