Skip to contentSkip to conversation

docs: fix sphinx build failure

PATCH In review Pierrick Bouvier 3 participants 5 messages Jul 20 – Jul 21 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: fix sphinx build failure

We recently started to have those failures appearing when building documentation. It's hard to identify if it comes from a python, sphinx or sphinx extension, but it blocks us.

Exception occurred:
File "/usr/lib/python3.13/multiprocessing/connection.py", line 399, in _recv
raise EOFError
EOFError
The full traceback has been saved in /tmp/sphinx-*.log, if you want to report the issue to the developers.

This seems to be the generic error message for "something went wrong in sphinx multiprocess":
- https://github.com/sphinx-doc/sphinx/issues/11449
- https://github.com/sphinx-doc/sphinx/issues/14458
- https://github.com/sphinx-doc/sphinx/issues/8973

Solve the issue by simply going back to sequential builds. We didn't notice a huge speedup anyway.

---
 docs/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/meson.build +1 -1
index a8d893681ec..4d8cc545fcc 100644
@@ -4,7 +4,7 @@ sphinx_build = find_program(fs.parent(python.full_path()) / 'sphinx-build',
 # Check if tools are available to build documentation.
 build_docs = false
 if sphinx_build.found()
-  SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build, '-q', '-j', 'auto']
+  SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build, '-q']
   # If we're making warnings fatal, apply this to Sphinx runs as well
   if get_option('werror')
     SPHINX_ARGS += [ '-W', '-Dkerneldoc_werror=1' ]
Signature · 1 line
2.43.0
#1 lore raw
Quoted 10 lines · Pierrick Bouvier

We recently started to have those failures appearing when building documentation. It's hard to identify if it comes from a python, sphinx or sphinx extension, but it blocks us.

Exception occurred:
File "/usr/lib/python3.13/multiprocessing/connection.py", line 399, in _recv
raise EOFError
EOFError
The full traceback has been saved in /tmp/sphinx-*.log, if you want to report the issue to the developers.

Quoted 5 lines

This seems to be the generic error message for "something went wrong in sphinx multiprocess":
- https://github.com/sphinx-doc/sphinx/issues/11449
- https://github.com/sphinx-doc/sphinx/issues/14458
- https://github.com/sphinx-doc/sphinx/issues/8973

FWIW, this time, it looks like it is a genuine bug in debian update of python3. I was able to reproduce the issue without -j option too, after about 300 retries (did build in a loop), and the python backtrace (it segfaulted) shows pattern similar to what was reported on debian. I haven't reproduced it after installing the fixed packages, but with so many attempts to failure, about 500 successful runs in a row is not conclusive still.

Quoted 2 lines

Solve the issue by simply going back to sequential builds. We didn't notice a huge speedup anyway.

The thing is: it looks like actually, at least the version of sphinx I have on debian stable - sphinx ignores -j option always using single core no matter which -j arg it is given. I weren't able to run it in true parallel mode. Maybe it spawns single "parallel" thread still, exploring the problematic code paths still, and without -j it wont - I dunno.

So, I guess, with this in mind, it should definitely be okay to have this change.

Thanks,

/mjt

Quoted 18 lines
---
  docs/meson.build | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
docs/meson.build +1 -1
index a8d893681ec..4d8cc545fcc 100644
@@ -4,7 +4,7 @@ sphinx_build = find_program(fs.parent(python.full_path()) / 'sphinx-build',
  # Check if tools are available to build documentation.
  build_docs = false
  if sphinx_build.found()
-  SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build, '-q', '-j', 'auto']
+  SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build, '-q']
    # If we're making warnings fatal, apply this to Sphinx runs as well
    if get_option('werror')
      SPHINX_ARGS += [ '-W', '-Dkerneldoc_werror=1' ]
#2 lore raw
Quoted 37 lines · Michael Tokarev
Quoted 12 lines · Pierrick Bouvier

We recently started to have those failures appearing when building documentation. It's hard to identify if it comes from a python, sphinx or sphinx extension, but it blocks us.

Exception occurred:
   File "/usr/lib/python3.13/multiprocessing/connection.py", line 399, in _recv
     raise EOFError
EOFError
The full traceback has been saved in /tmp/sphinx-*.log, if you want to report the issue to the developers.

Quoted 5 lines

This seems to be the generic error message for "something went wrong in sphinx multiprocess":
- https://github.com/sphinx-doc/sphinx/issues/11449
- https://github.com/sphinx-doc/sphinx/issues/14458
- https://github.com/sphinx-doc/sphinx/issues/8973

FWIW, this time, it looks like it is a genuine bug in debian update of python3.  I was able to reproduce the issue without -j option too, after about 300 retries (did build in a loop), and the python backtrace (it segfaulted) shows pattern similar to what was reported on debian. I haven't reproduced it after installing the fixed packages, but with so many attempts to failure, about 500 successful runs in a row is not conclusive still.

Quoted 2 lines

Solve the issue by simply going back to sequential builds. We didn't notice a huge speedup anyway.

The thing is: it looks like actually, at least the version of sphinx I have on debian stable - sphinx ignores -j option always using single core no matter which -j arg it is given.  I weren't able to run it in true parallel mode.  Maybe it spawns single "parallel" thread still, exploring the problematic code paths still, and without -j it wont - I dunno.

Quoted 3 lines

So, I guess, with this in mind, it should definitely be okay to have this change.

Good to know if might be fixed in the future with a python update. We can re-include it at this time.
I can send a PR current fix once the patch has received a reviewed-by.

Regards,
Pierrick

Quoted 25 lines

Thanks,

/mjt

Quoted 20 lines

---
  docs/meson.build | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
docs/meson.build +0 -0
index a8d893681ec..4d8cc545fcc 100644
@@ -4,7 +4,7 @@ sphinx_build =
 find_program(fs.parent(python.full_path()) / 'sphinx-build',
   # Check if tools are available to build documentation.

  build_docs = false
  if sphinx_build.found()
-  SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build, '- q', '-j', 'auto']
+  SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build, '-q'] # If we're making warnings fatal, apply this to Sphinx runs as well if get_option('werror')
      SPHINX_ARGS += [ '-W', '-Dkerneldoc_werror=1' ]

Reviewed-by on v1 1/1
#3 lore raw
In reply to Pierrick Bouvier
Quoted 17 lines · Pierrick Bouvier

We recently started to have those failures appearing when building documentation. It's hard to identify if it comes from a python, sphinx or sphinx extension, but it blocks us.

Exception occurred:
File "/usr/lib/python3.13/multiprocessing/connection.py", line 399, in _recv
raise EOFError
EOFError
The full traceback has been saved in /tmp/sphinx-*.log, if you want to report the issue to the developers.

This seems to be the generic error message for "something went wrong in sphinx multiprocess":
- https://github.com/sphinx-doc/sphinx/issues/11449
- https://github.com/sphinx-doc/sphinx/issues/14458
- https://github.com/sphinx-doc/sphinx/issues/8973

Quoted 7 lines

Solve the issue by simply going back to sequential builds. We didn't notice a huge speedup anyway.

---
 docs/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Michael's reply suggests there might be other factors involved in these errors too, but there is no harm in applying this patch:

Reviewed-by on v1 1/1
#4 lore raw
In reply to Pierrick Bouvier
Quoted 16 lines · Pierrick Bouvier

We recently started to have those failures appearing when building documentation. It's hard to identify if it comes from a python, sphinx or sphinx extension, but it blocks us.

Exception occurred:
File "/usr/lib/python3.13/multiprocessing/connection.py", line 399, in _recv
raise EOFError
EOFError
The full traceback has been saved in /tmp/sphinx-*.log, if you want to report the issue to the developers.

This seems to be the generic error message for "something went wrong in sphinx multiprocess":
- https://github.com/sphinx-doc/sphinx/issues/11449
- https://github.com/sphinx-doc/sphinx/issues/14458
- https://github.com/sphinx-doc/sphinx/issues/8973

Quoted 7 lines

Solve the issue by simply going back to sequential builds. We didn't notice a huge speedup anyway.

---
  docs/meson.build | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,

/mjt