Commit Graph

8 Commits

Author SHA1 Message Date
MicroDev d9d94eacca
run updated pre-commit 2023-02-01 13:38:41 +05:30
Jeff Epler 10d92873c3
Don't generate QSTRs for wrong identifiers
MP_REGISTER_MODULE would use identifiers like
"MODULE_DEF_MP_QSTR___FUTURE__" which would in turn cause
a QSTR to be generated for it. This wasn't desirable, because the
qstr would never be used.

This clears out quite a bit of flash storage on the proxlight trinkey.
2022-11-30 12:06:15 -06:00
Jeff Epler 2b32dce256
genlast: Actually catch errors when preprocessing files
Due to a number of problems, an error calling the preprocessor wasn't
making the whole genlast process fail.

Now, after an execption during preprocess is printed, it is re-raised.
Then, by actually collating the results of executor.map, the exception
will be raised in the main thread context. Any CalledProcessError is simply
converted to a nonzero exit status.
2022-02-17 08:36:29 -06:00
Scott Shawcroft b35fa44c8a
Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Dan Halbert e4c66990e2 compiles 2020-11-20 23:33:39 -05:00
Jeff Epler 479552ce56 build: Make genlast write the "split" files
This gets a further speedup of about 2s (12s -> 9.5s elapsed build time)
for stm32f405_feather

For what are probably historical reasons, the qstr process involves
preprocessing a large number of source files into a single "qstr.i.last"
file, then reading this and splitting it into one "qstr" file for each
original source ("*.c") file.

By eliminating the step of writing qstr.i.last as well as making the
regular-expression-matching part be parallelized, build speed is further
improved.

Because the step to build QSTR_DEFS_COLLECTED does not access
qstr.i.last, the path is replaced with "-" in the Makefile.
2020-10-11 21:18:03 -05:00
Jeff Epler 607e4a905a build: parallelize the creation of qstr.i.last
Rather than simply invoking gcc in preprocessor mode with a list of files, use
a Python script with the (python3) ThreadPoolExecutor to invoke the
preprocessor in parallel.

The amount of concurrency is the number of system CPUs, not the makefile "-j"
parallelism setting, because there is no simple and correct way for a Python
program to correctly work together with make's idea of parallelism.

This reduces the build time of stm32f405 feather (a non-LTO build) from 16s to
12s on my 16-thread Ryzen machine.
2020-10-11 20:19:59 -05:00