nunavut icon indicating copy to clipboard operation
nunavut copied to clipboard

Add support for incremental builds

Open Cherish-forever opened this issue 3 years ago • 2 comments

I am using nunavut to generate python and C source files, is too slow.

Here is an idea: when nunavt generate source(python or C) file, change the generate file(python or C) timestamp equal to dsdl file, if dsdl file changed, nunavt will recompile, or it will process next dsdl file.

Cherish-forever avatar Mar 19 '21 07:03 Cherish-forever

I am using nunavut to generate python and C source files, is too slow.

This is already tracked in https://github.com/UAVCAN/pydsdl/issues/23; I am soon to start working on the fix by replacing the bit length set derivation logic.

when nunavt generate source(python or C) file, change the generate file(python or C) timestamp equal to dsdl file, if dsdl file changed, nunavt will recompile, or it will process next dsdl file.

In DSDL, the smallest unit of translation is a namespace, not a data type. You technically can treat types as independent entities but that requires jumping through some hoops because the language is designed based on different core assumptions.

I am not saying that there is nothing to improve, though. The first idea that comes to mind is to not overwrite output files if the content is identical to support partial recompilation. The old v0 implementation actually had this optimization in place we just need to re-introduce it into Nunavut.

Namespace-wise, Scott was planning to provide Makefile integration examples that will hopefully demonstrate how does one avoid unnecessary recompilation of DSDL namespaces: #42

pavel-kirienko avatar Mar 19 '21 18:03 pavel-kirienko

Nunavut isn't a build system so I don't want it to try to do too much of the work that Ninja or Make should be doing. There could be improvements to support incremental builds but you would not notice the difference until/unless UAVCAN/pydsdl#23 is fixed.

thirtytwobits avatar Mar 22 '21 15:03 thirtytwobits

Closing this but note that this all gets better with 3.0 which will use a newer pydsdl that only considers a set of target files and their dependencies instead of all files found under a root namespace.

thirtytwobits avatar Jul 25 '24 00:07 thirtytwobits