Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509810 - dev-python/sphinx-1.2.2: generates _static/_static/... dirs up to the path length limit
Summary: dev-python/sphinx-1.2.2: generates _static/_static/... dirs up to the path le...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-07 19:13 UTC by Amadeusz Żołnowski (RETIRED)
Modified: 2018-04-24 16:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info sphinx (sphinx.info,5.56 KB, application/x-info)
2014-05-07 19:15 UTC, Amadeusz Żołnowski (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amadeusz Żołnowski (RETIRED) gentoo-dev 2014-05-07 19:13:57 UTC
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
Comment 1 Amadeusz Żołnowski (RETIRED) gentoo-dev 2014-05-07 19:15:19 UTC
Created attachment 376552 [details]
emerge --info sphinx
Comment 2 Mike Gilbert gentoo-dev 2014-05-07 20:37:26 UTC
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.
Comment 3 Amadeusz Żołnowski (RETIRED) gentoo-dev 2014-05-08 07:13:18 UTC
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.
Comment 4 Mike Gilbert gentoo-dev 2014-05-09 01:51:48 UTC
Can you come up with a reduced test case? I'm having trouble installing the dotnet dependencies of notmuch.
Comment 5 Mike Gilbert gentoo-dev 2014-05-09 01:55:56 UTC
Err... I guess USE=-mono will take care of that.
Comment 6 Mike Gilbert gentoo-dev 2014-05-09 02:06:25 UTC
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.
Comment 7 Mike Gilbert gentoo-dev 2014-05-09 02:13:52 UTC
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.
Comment 9 Mike Gilbert gentoo-dev 2014-05-09 14:32:12 UTC
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. ^_^
Comment 10 Amadeusz Żołnowski (RETIRED) gentoo-dev 2014-05-13 07:30:54 UTC
(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.
Comment 11 Amadeusz Żołnowski (RETIRED) gentoo-dev 2017-05-29 17:16:22 UTC
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.