From af516245167796ba2b7eb2375bdafc4db835c00e Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Thu, 10 Jul 2025 12:56:57 +1000 Subject: [PATCH] doc: Check minimum sphinx version for building hall of fame Building authors/reviewers list (aka Hall of Fame) requires more modern sphinx version than the rest of documentation. Also we have separate meson options, `documentation` and `generate_authors_list`, which both default to `auto`. Auto mode is expected to check the environment and enable the option if environment is suitable - or disable otherwise. The patch check minimun required sphinx version specifically for building hall of fame, the rest of documentation just checks that sphinx is present. So if developer has old version of sphinx, all the documentation will be built, just without hall of fame. Without this patch, developer with generate_authors_list=auto (which is default) and old version of sphinx gets a build error like this: Exception occurred: File "/usr/lib/python3/dist-packages/docutils/nodes.py", line 652, in __getitem__ return self.attributes[key] KeyError: 'colwidth' and a stack trace from sphinx source code Change-Id: I8f0ae62f33dca04c2c5233ea45c6263f10cbe4f9 Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/88373 Tested-by: build bot (Jenkins) Reviewed-by: Peter Marheine --- doc/meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/meson.build b/doc/meson.build index ff1e7bcd7..df68c61ff 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -29,6 +29,14 @@ if sphinx.found() git = find_program('git', native : true, required : with_authors_list) git_dir = meson.project_source_root() / '.git' + # TODO: investigate whether this version can be lowered. + version_for_authors_list = '7.2.0' + # TODO: use sphinx.version().version_compare() instead, after we increase min required meson version to 0.62 + sphinx_for_authors_list = find_program('sphinx-build', + native : true, + required : false, + version : '>=' + version_for_authors_list) + # When with_authors_list is requested, unsatisfied requirements are an error. if with_authors_list.enabled() if not git.found() @@ -37,11 +45,16 @@ if sphinx.found() if not fs.is_dir(git_dir) error('generate_authors_list was force-enabled but a .git directory was not found in the source tree') endif + if not sphinx_for_authors_list.found() + error('generate_authors_list was force-enabled but sphinx version is too old, min required is ' + + version_for_authors_list) + endif endif if ( (with_authors_list.enabled() or with_authors_list.auto()) and git.found() and fs.is_dir(git_dir) + and sphinx_for_authors_list.found() ) # If requirements are met and authors list is allowed, generate it. authors_lst = custom_target(