It can be easily reproduced with notmuch ebuild which uses sphinx to generate html docs for python bindings. Another way to reproduce is described below. I've got Python 3.3 as a default. Reproducible: Always Steps to Reproduce: 1. git clone git://git.notmuchmail.org 2. cd notmuch/bindings/python/docs 3. make html 4. find -name _static Actual Results: With sphinx-1.2.2: $ make html sphinx-build -b html -d build/doctrees source html Making output directory... Running Sphinx v1.2.2 loading pickled environment... failed: [Errno 2] No such file or directory: '/home/aidecoe/src/notmuch/bindings/python/docs/build/doctrees/environment.pickle' loading intersphinx inventory from http://docs.python.org/objects.inv... building [html]: targets for 12 source files that are out of date updating environment: 12 added, 0 changed, 0 removed reading sources... [100%] threads /home/aidecoe/src/notmuch/bindings/python/docs/source/status_and_errors.rst:17: WARNING: error while formatting arguments for notmuch.STATUS: 'Status' object has no attribute '__mro__' looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] threads writing additional files... genindex search copying static files... done copying extra files... done dumping search index... done dumping object inventory... done build succeeded, 1 warning. Build finished. The HTML pages are in html. $ find -name _static | head # without head it takes 505 lines ./html/_static ./html/_static/_static ./html/_static/_static/_static ./html/_static/_static/_static/_static ./html/_static/_static/_static/_static/_static ./html/_static/_static/_static/_static/_static/_static ./html/_static/_static/_static/_static/_static/_static/_static ./html/_static/_static/_static/_static/_static/_static/_static/_static ./html/_static/_static/_static/_static/_static/_static/_static/_static/_static ./html/_static/_static/_static/_static/_static/_static/_static/_static/_static/_static Expected Results: With sphinx-1.1.3-r7: $ make html sphinx-build -b html -d build/doctrees source html Making output directory... Running Sphinx v1.1.3 loading pickled environment... failed: [Errno 2] No such file or directory: '/home/aidecoe/src/notmuch/bindings/python/docs/build/doctrees/environment.pickle' loading intersphinx inventory from http://docs.python.org/objects.inv... building [html]: targets for 12 source files that are out of date updating environment: 12 added, 0 changed, 0 removed reading sources... [100%] threads looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] threads writing additional files... genindex search copying static files... done dumping search index... done dumping object inventory... done build succeeded. Build finished. The HTML pages are in html. $ find -name _static ./html/_static ./html/_static/_static
Created attachment 376552 [details] emerge --info sphinx
sphinx is able to build its own docs without exhibiting this behavior, so I doubt this is a general problem. I suspect the problem is isolated to the notmuch package; if you have other examples please share.
General or not, it shouldn't behave like that for any output. It's a bug that it creates such a structure. It hasn't in previous versions.
Can you come up with a reduced test case? I'm having trouble installing the dotnet dependencies of notmuch.
Err... I guess USE=-mono will take care of that.
Hmm... seems to be something to do with the html_static_path setting in source/conf.py. This patch makes the problem go away. diff --git a/bindings/python/docs/source/conf.py b/bindings/python/docs/source/conf.py index 9db377f..c93b2ee 100644 --- a/bindings/python/docs/source/conf.py +++ b/bindings/python/docs/source/conf.py @@ -140,7 +140,7 @@ html_theme = 'default' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['../html'] +#html_static_path = ['../html'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format.
Yeah, it creates html/_sphinx, and then creates a nested copy because it sees _static in html_static_path, and repeats. Seems like a mis-configuration to me. I guess you could call it a bug in sphinx that it does not catch the infinite recursion, but that's a lot to expect from a documentation builder.
I filed https://bitbucket.org/birkenfeld/sphinx/issue/1464/sanity-checking-for-html_static_path.
To clarify, the problem in this case is that the sphinx output directory and the html_static_path are the same directory. It makes no sense to ask sphinx look in the output directory for static assets to copy to the output directory. ^_^
(In reply to Mike Gilbert from comment #9) > To clarify, the problem in this case is that the sphinx output directory and > the html_static_path are the same directory. Thanks for pointing this out. I've fixed it notmuch, but it would be still good if sphinx would detect it, especially that older version did it.
I think this can be closed. I have fixed/worked around it in notmuch, but maybe you want to keep it open if you think it's an issue needs to be fixed in sphinx.