1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-19 14:30:54 +02:00

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 <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/88373
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
This commit is contained in:
Anastasia Klimchuk
2025-07-10 12:56:57 +10:00
parent 966cd5194c
commit af51624516

View File

@ -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(