=dev-python/sphinx-4.4.0 fails to build with USE=doc It fails to emerge with the error: Warning, treated as error: /var/tmp/portage/dev-python/sphinx-4.4.0/work/Sphinx-4.4.0/doc/tutorial/deploying.rst:162:unknown document: readthedocs:tutorial/index No problems building with USE=-doc Build log and emerge --info attached. Reproducible: Always
Created attachment 765399 [details] Build log
Created attachment 765400 [details] emerge --info
There are two problems: 1. The "unknown document: readthedocs:tutorial/index" error is caused by an intersphinx reference which has to be replaced with an external link. This is completely analogous to Bug 823095 and Bug 728810. 2. When this problem is resolved (see the attached patch), the install phase failes with the following error: FileNotFoundError: [Errno 2] No such file or directory: b'/var/tmp/portage/dev-python/sphinx-4.4.0/work/Sphinx-4.4.0-python3_9/sphinx/html/.' This can be fixed by replacing HTML_DOCS=( "${BUILD_DIR}"/sphinx/html/. ) with HTML_DOCS=( "${S}"/build/sphinx/html/. ) in the the ebuild's python_compile_all() function.
Created attachment 765637 [details, diff] no-intersphinx.patch Patch to replace the intersphinx references with external links
I can confirm that the ebuild change in Comment #3 and patch in Comment #4 fix the issue for me.
Bug confirmed with version 4.4.0-r1.
Bug confirmed with version 4.5.0-r1.
FileNotFoundError: [Errno 2] No such file or directory: b'/var/tmp/portage/dev-python/sphinx-5.0.2/work/Sphinx-5.0.2-python3_10/sphinx/html/.'
FileNotFoundError: [Errno 2] No such file or directory: b'/var/tmp/portage/dev-python/sphinx-5.1.0/work/sphinx-5.1.0-python3_10/sphinx/html/.'
FileNotFoundError: [Errno 2] No such file or directory: b'/var/tmp/portage/dev-python/sphinx-5.1.1/work/sphinx-5.1.1-python3_10/sphinx/html/.'
FileNotFoundError: [Errno 2] No such file or directory: b'/var/tmp/portage/dev-python/sphinx-5.2.3/work/sphinx-5.2.3-python3_10/sphinx/html/.'
None of the broken versions (4.4.0, 5.1.0, 5.1.1, 5.2.3) exists any more so it seems like this bug is fixed.