docs/ci: treat warnings as errors

When we moved building the docs to Meson, we accidentally dropped the -W
flag that we used to have. This lead to us no longer detecting certain
problems in the docs, which is unfortunate.

Let's bring this back gated by the werror meson-option, and wire that up
on the CI end.

Fixes: fdd204538b ("ci: build docs using meson")
Reviewed-by: Dylan Baker <None>
(cherry picked from commit cf07e89d06)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32852>
This commit is contained in:
Erik Faye-Lund
2025-01-02 11:54:44 +01:00
committed by Dylan Baker
parent c4aa2be477
commit 40cb39104d
3 changed files with 8 additions and 1 deletions

View File

@@ -24,7 +24,7 @@
"description": "docs/ci: treat warnings as errors",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "fdd204538b93e17cecd32786603e0e2452e459c4",
"notes": null

View File

@@ -10,6 +10,7 @@
- meson setup _build -D prefix=$(pwd) --auto-features=disabled
-D vulkan-drivers="" -D gallium-drivers="" -D platforms=[] -D glx=disabled
-D video-codecs="" -D html-docs=enabled -D html-docs-path=public
-D werror=true
- meson compile -C _build
- meson install -C _build

View File

@@ -11,12 +11,18 @@ assert Version(hawkmoth.__version__) >= Version("0.16.0")
error_message: 'hawkmoth >= 0.16.0 required'
)
sphinx_args = []
if get_option('werror')
sphinx_args += '-W'
endif
html_docs = custom_target(
'html',
depfile: 'docs.d',
depend_files: files('conf.py'),
command: [sphinx, '-b', 'html', '-q',
'-Ddepfile=@DEPFILE@',
sphinx_args,
meson.current_source_dir(), '@OUTPUT@'],
output: 'html',
build_by_default: get_option('html-docs').enabled(),