On Sat, Jul 26, 2025 at 11:24:48PM +0100, Gavin Smith wrote: > However, I don't know if we could follow their method. Even if we could, > it wouldn't make the build system any easier to understand.
I do not really see the issue with rebuilding dependencies of data used for code generation when the data is touched even if it is not modified. No reason to complexify the build system for a change that is not different of changing the code manually. What could be possible is to have more granularity by splitting the maintain/generate_code_convert_data.pl script to be able to split the header and code files by type of data, the maximum splitting being by input csv file. This could especially be relevant for the csv rules, but much less for the other data, as explained below. > The more straightforward way to reduce the rebuild requirement would be > to reduce the pervasiveness of the generated header file. It's included > pretty much everywhere, even for code that isn't specifically for HTML > conversion: > > $ fgrep html_conversion_data.h . -R --include="*.c" --include="*.h" > ./convert/html_converter_types.h:#include "html_conversion_data.h" > ./convert/convert_html.c:#include "html_conversion_data.h" > ./convert/format_html.c:#include "html_conversion_data.h" > ./convert/build_html_perl_state.c:#include "html_conversion_data.h" > ./convert/html_prepare_converter.c:#include "html_conversion_data.h" > ./convert/build_html_perl_info.c:#include "html_conversion_data.h" > ./convert/converter.c:#include "html_conversion_data.h" > ./main/option_types.h:#include "html_conversion_data.h" > ./main/html_conversion_data.c:#include "html_conversion_data.h" > ./main/converter_types.h:#include "html_conversion_data.h" > ./main/document_types.h:#include "html_conversion_data.h" > ./main/utils.c:#include "html_conversion_data.h" > > Perhaps it would be enough to structure this better. I can't see much change coming out of that. Indeed, even if the information in html_conversion_data.h is focused on HTML data, this information is used in types used everywhere, because those types are used for both HTML and other formats. This is especially the case for HTML specific options, such as directions and buttons related options. These are only actually used in HTML, but need to be in all the options related types, which means pretty much everywhere. Therefore, even if "html_conversion_data.h" include could be removed from some of those, there would still be a dependency through option_types.h. The issue is actually more problematic for actual code than for headers, as it means that HTML specific code appear in .c files where it would be cleaner if it was not there, especially in main/build_perl_info.c and main/get_perl_info.c. In turn, this requires to have some html related functions in utils.c to avoid having too many HTML specific files included in build_perl_info.c and get_perl_info.c. -- Pat