Fix html build with Sphinx 3.1 and above
Subsystems (29)
Em Thu, 1 Oct 2020 15:48:54 -0600
Jonathan Corbet <[email protected]> escreveu:
Quoted 22 lines
Quoted 19 lines · On Wed, 30 Sep 2020 15:24:23 +0200 Mauro Carvalho Chehab…
This series add proper support for Sphinx 3.1 and above for building the html docs.
This series comes after the one I wrote fixing the warnings.
With this series applied on the top of next-20200922, there are just 12 warnings:
- 2 of them happens also on Sphinx 2.4.4
(both seem easy to fix: I'll send later fixes for those);
- 10 happens only on Sphinx 3.2.1.The new warnings are all due to duplicated C domain cross-reference symbols.
Basically, the C domain on Sphinx doesn't allow to have an struct and a function with the same name. I opened an issue on Sphinx.:
https://github.com/sphinx-doc/sphinx/issues/8241Hopefully, some newer version may have it fixed.
Quoted 8 lines
Quoted 4 lines
There is still one thing that requires a fix: the
automarkup.py. The way cross-references are stored with Sphinx 3 are different. I didn't try yet to address it, but I suspect that it shouldn't be hard to address it.Modulo my comment on part 4, I think this is what we want. It's kind of unfortunate that it's all necessary, but that's the way things are these days, I guess.
Yes, it is unfortunate. Yet, my feeling is that this approach provides us a good way to transition to the new C domain parser, which has some advantages over the older code.
Quoted 3 lines
This part is a bit intimidating, though:
Quoted 1 line
288 files changed, 1709 insertions(+), 2183 deletions(-)
Yes. Yet, the media userspace API is responsible for most of it:
224 files changed, 1076 insertions(+), 1716 deletions(-)
As most of the uAPI documentation doesn't rely on kernel-doc (mostly due to historic reasons).
To be fair, most of the other changes outside the building system are due to already-existing issues at the documentation. There are several kernel-doc tags creating duplicated C references.
While Sphinx < 3 C domain parser were able to detect them, such warnings are disabled by default.
Quoted 3 lines
Should we maybe position this as an end-of-merge-window blast, once other stuff has hopefully mostly settled? I can certainly warn Linus that it's coming when I send the main docs pull.
Yeah, adding this series, together with the remaining patches fixing all warnings with Sphinx < 3 at the end of the merge window seems the right thing to do, IMO.
Quoted 2 lines
I wonder how soon we could pull our minimum version forward to 3.1 and drop a bunch of stuff? I fear it may not be for a while, alas...
I guess it may take some time. In any case, for the next minimal version, I would set for the upcoming one that will fix those issue reported here:
https://github.com/sphinx-doc/sphinx/issues/7819 https://github.com/sphinx-doc/sphinx/issues/8241
One such example is this warning:
.../Documentation/driver-api/miscellaneous:48: ../drivers/pwm/core.c:669: WARNING: Duplicate C declaration, also defined in 'driver-api/miscellaneous'. Declaration is 'int pwm_capture (struct pwm_device *pwm, struct pwm_capture *result, unsigned long timeout)'.
(See: we have a function pwm_capture and a struct with the
same name. Both have kernel-doc tags at drivers/pwm/core.c)
Without fixing it, there's no way to produce a zero-warning docs building[1] with Sphinx versions above 2.4.x.
[1] Well, it could be possible to rename such kAPI symbols to make Sphinx happy, but IMO, the C domain there should be able to fully support the C language.
Quoted 1 line
Thanks for doing all this work,
Anytime.
Thanks,
Mauro
Re: [PATCH v4 35/52] docs: fs: fscrypt.rst: get rid of :c:type: tags
In reply to Eric BiggersHi Eric,
Em Wed, 30 Sep 2020 10:06:37 -0700
Eric Biggers <[email protected]> escreveu:
Quoted 9 lines
Quoted 7 lines
I double checked: it is against next-20200922. The reason of not being today's next is that I didn't want any new warnings to be introduced before I finish this patch series.
Anyway, I'm planning to do a rebase tomorrow on the top of the latest -next.
Doesn't work. Here's what I did:
...
Quoted 20 lines
Cover: ./v4_20200930_mchehab_huawei_fix_html_build_with_sphinx_3_1_and_above.cover
Base: not found
git am ./v4_20200930_mchehab_huawei_fix_html_build_with_sphinx_3_1_and_above.mbxe@sol ~/linux $ git am ./v4_20200930_mchehab_huawei_fix_html_build_with_sphinx_3_1_and_above.mbx
Applying: docs:cdomain.py: add support for a new Sphinx 3.1+ tag
Applying: docs:cdomain.py: extend it to handle new Sphinx 3.x tags
Applying: docs:conf.py: disable automarkup for Sphinx 3.x
Applying: scripts: kernel-doc: make it more compatible with Sphinx 3.x
Applying: scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x
Applying: scripts: kernel-doc: fix troubles with line counts
Applying: scripts: kernel-doc: reimplement -nofunction argument
Applying: scripts: kernel-doc: fix typedef identification
Applying: scripts: kernel-doc: don't mangle with parameter list
Applying: docs:kerneldoc.py: append the name of the parsed doc file
Applying: docs:kerneldoc.py: add support for kerneldoc -nosymbol
Applying: media: docs: make CEC documents compatible with Sphinx 3.1+
Applying: media: docs: make V4L documents more compatible with Sphinx 3.1+
error: patch failed:Documentation/userspace-api/media/v4l/hist-v4l2.rst:202
Quoted 8 lines
error:
Documentation/userspace-api/media/v4l/hist-v4l2.rst: patch does not apply
error: patch failed:Documentation/userspace-api/media/v4l/vidioc-enum-fmt.rst:227
error:Documentation/userspace-api/media/v4l/vidioc-enum-fmt.rst: patch does not apply Patch failed at 0013 media: docs: make V4L documents more compatible with Sphinx 3.1+
hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Well, the media patches were indeed based at the media upstream tree. As I maintain the media tree, and the changes for it are huge, I opted to merge from media before applying this series. Btw, the series is also after the other fix patches for the warnings with Sphinx 2.x that I sent previously. It might eventually conflict with the Sphinx 3.x patch series.
At the current version, there are 101 patches against next-20201002, being about half of them fixing all doc warnings on Sphinx 2.x, and the other ones fixing almost all Sphinx 3.x warnings.
The latest version at:
https://git.linuxtv.org/mchehab/experimental.git/log/?h=sphinx3-fixes-v4
In the specific case of fscript.rst, there are only two patches on my series affecting it, both as part of this /52 series:
$ git log next-20200922..devel/sphinx3-fixes-v4 Documentation/filesystems/fscrypt.rst commit ee4af6dd20dd6d2ac7f5d970abac960a36679e13 Author: Mauro Carvalho Chehab <[email protected]> Date: Tue Sep 29 09:13:18 2020 +0200
docs: fs: fscrypt.rst: get rid of :c:type: tags
The :c:type: tag has problems with Sphinx 3.x, as structs there should be declared with c:struct.
So, remove them, relying at automarkup.py extension to convert them into cross-references.
commit 0945e3961d006e210e374b6d3224d9108c1dfa25
Author: Mauro Carvalho Chehab <[email protected]>
Date: Fri Sep 25 12:01:25 2020 +0200
docs: get rid of :c:type explicit declarations for structs
The :c:type:foo only works properly with structs before Sphinx 3.x.
On Sphinx 3.x, structs should now be declared using the .. c:struct, and referenced via :c:struct tag.
As we now have the automarkup.py macro, that automatically convert:
struct foo
into cross-references, let's get rid of that, solving several warnings when building docs with Sphinx 3.x.
Anyway, I'm waiting for the today's next, in order to do another rebase, fixing any new warning that might be added, and to post the patches that weren't merged yet via other trees.
The end goal is to have zero warnings with Sphinx 2.x, and the minimal number of warnings with 3.x (right now, there's just 6 warnings with 3.x - fixing those require fixes at Sphinx C domain parser).
Thanks,
Mauro
Eric Biggers
maintainerRe: [PATCH v4 35/52] docs: fs: fscrypt.rst: get rid of :c:type: tags
Quoted 3 lines · Mauro Carvalho Chehab
The latest version at:
https://git.linuxtv.org/mchehab/experimental.git/log/?h=sphinx3-fixes-v4
Doesn't work either.
$ git remote add mchehab https://git.linuxtv.org/mchehab/experimental.git $ git fetch mchehab warning: alternate disabled by http.followRedirects: https://git.linuxtv.org/git/linux.git/ warning: alternate disabled by http.followRedirects: https://git.linuxtv.org/git/media_tree.git/ warning: alternate disabled by http.followRedirects: https://git.linuxtv.org/git/linux.git/ error: Unable to find 4d9f4b7b8bf7af2d8deb4435833a7e165b9bdd21 under https://git.linuxtv.org/mchehab/experimental.git Fetching objects: 286, done. Cannot obtain needed object 4d9f4b7b8bf7af2d8deb4435833a7e165b9bdd21 while processing commit 0a0cde580853340e1a585a1959eaaf055b7cff9a. error: fetch failed.
Quoted 2 lines
In the specific case of
fscript.rst, there are only two patches on my series affecting it, both as part of this /52 series:
But those two patches don't apply because they also change other files.
I need to apply patches to do a proper review. Reviewers shouldn't have to waste time trying to figure out how to apply your patches.
- Eric
Re: [PATCH v4 35/52] docs: fs: fscrypt.rst: get rid of :c:type: tags
Em Mon, 5 Oct 2020 12:08:23 -0700
Eric Biggers <[email protected]> escreveu:
Quoted 7 lines · Mauro Carvalho Chehab
Quoted 3 lines
The latest version at:
https://git.linuxtv.org/mchehab/experimental.git/log/?h=sphinx3-fixes-v4
Doesn't work either.
Quoted 10 lines
$ git remote add mchehab https://git.linuxtv.org/mchehab/experimental.git $ git fetch mchehab warning: alternate disabled by http.followRedirects: https://git.linuxtv.org/git/linux.git/ warning: alternate disabled by http.followRedirects: https://git.linuxtv.org/git/media_tree.git/ warning: alternate disabled by http.followRedirects: https://git.linuxtv.org/git/linux.git/ error: Unable to find 4d9f4b7b8bf7af2d8deb4435833a7e165b9bdd21 under https://git.linuxtv.org/mchehab/experimental.git Fetching objects: 286, done. Cannot obtain needed object 4d9f4b7b8bf7af2d8deb4435833a7e165b9bdd21 while processing commit 0a0cde580853340e1a585a1959eaaf055b7cff9a. error: fetch failed.
Well, support for https was broken at linuxtv.org. Not many media developers use https instead of git.
The main issue is that we heavily use alternates there, in order to minimize disk space usage. After some server upgrade, https stopped working properly.
I just fixed it, by adding some new rewrite rules that will call git http-backend in order to solve alternates.
Thanks for reporting it.
Quoted 7 lines
Quoted 2 lines
In the specific case of
fscript.rst, there are only two patches on my series affecting it, both as part of this /52 series:But those two patches don't apply because they also change other files.
I need to apply patches to do a proper review. Reviewers shouldn't have to waste time trying to figure out how to apply your patches.
Yeah, agreed. Sorry for that.
Not sure what would be the best way to minimize the issues, though.
I mean, I might place those documentation patches on my linux-next branch, making them visible at tomorrow's linux-next, but that doesn't sound a good idea, as this will be a source of conflicts, since several patches from my tree are based on patches applied via someone's else's tree.
Hopefully, after getting this series merged upstream, the docs build for html will finally went into a clean state. Any new warnings that might sleep though maintainer's reviews could easily be fixed without depending on a 100+ patch series.
-
Btw, there was no new linux-next tag yesterday. The last one is still next-20201002.
I'll wait for a while a today's linux-next. After rebasing on the top of that, I'll submit a v5 of this series.
Thanks,
Mauro