sphinx-build always reads and writes outoput for *all* files, updated or not

449 views
Skip to first unread message

Tzach Livyatan

unread,
Aug 7, 2019, 3:16:08 PM8/7/19
to sphinx-users
Hi all
As the subject says, sphinx-build started to update all files, on every run. I suspect it started when I moved to from Sphinx 1.6 to 1.8, but I'm not sure
Any idea?

Thanks
Tzach

Example output below


$ make preview 
bin/sphinx-build -b dirhtml -d _build/doctrees   . _build/dirhtml
Running Sphinx v1.8.5
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [dirhtml]: targets for 6 source files that are out of date
updating environment: [config changed] 413 added, 1 changed, 0 removed
reading sources... [100%] using-scylla/workload-prioritization                                                                                                                                                     
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%]                                                                                                                                                       
generating indices... genindex
writing additional pages... search
copying images... [100%]                                                                                                                                                       copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded.



Eric Larson

unread,
Aug 7, 2019, 3:27:59 PM8/7/19
to sphinx...@googlegroups.com
It says "config changed", which means that Sphinx believes that something in your `conf.py` file has changed. There are a few ways this can happen.

The first is that you actually changed some value in `conf.py`, but it sounds like this is not it.

The next is that something in your `conf.py` that ends up in the env config does not have a stable `repr`. For example, in sphinx-gallery for a while we had things where people could pass in functions, like in `conf.py` they could pass a callable like (simplified):
sphinx_gallery_conf = {
    'something': lambda x: x * 2,
}
And this ended up in the env config. However, functions in general (lambdas included) do not have stable `repr`s, so Sphinx would detect a `conf.py` change despite the file not actually changing, because the `repr` of the `lambda` would contain a random memory address each run. Hence the warning we added in sphinx-gallery here.

Then in numpydoc Sphinx extension we had a problem (that I introduced!) where we updated the config vars during the run to include some reasonable defaults. Sphinx stores/pickles the values at the *end* of the run, but on subsequent runs checks the values at the *beginning* of the run to see if they have changed to decide if the config has changed, so our modification in the middle caused a full rebuild to happen every time. This was fixed in numpydoc by not modifying the env config values that were there at the start of the run.

There might be other ways, too, but these are the "gotcha"s I've hit.

For what it's worth, on the branch from this PR the config var that actually causes the problem should actually be reported, you could give it a shot:


You can probably install with some variant of:

HTH,
Eric




--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/5c1a8db3-94d4-4de0-8d9b-39653c39535c%40googlegroups.com.

Tzach Livyatan

unread,
Aug 8, 2019, 2:58:12 AM8/8/19
to sphinx-users
Thanks, Eric

I took a hard look into my config.py but did not find anything similar to what you describe here, like an env change.
I did manage to pinpoint the issue to Sphinx 1.8.1: With 1.8.0, a second consecutive build does nothing, as it should, while on 1.8.1 it reads and writes all the file.

Tzach
 
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx...@googlegroups.com.

Eric Larson

unread,
Aug 8, 2019, 8:21:44 AM8/8/19
to sphinx...@googlegroups.com
I took a hard look into my config.py but did not find anything similar to what you describe here, like an env change.

Part of what I was trying to convey was that these changes can actually be hidden from you, for example caused by sphinx extensions under your hood without your knowledge (e.g., the numpydoc example)

Did you try the branch that I recommended? It should say what the cause was. (And if it doesn't, we should fix it so that it does!)

Eric

Stefano David

unread,
Aug 8, 2019, 8:47:14 AM8/8/19
to sphinx-users


On Wednesday, 7 August 2019 21:16:08 UTC+2, Tzach Livyatan wrote:
Hi all
As the subject says, sphinx-build started to update all files, on every run. I suspect it started when I moved to from Sphinx 1.6 to 1.8, but I'm not sure
Any idea?
Have you tried to pass to sphinx-build a -vv or a -vvv option to see if some more informative message is emitted? This would be SPHINXOPTION = -vvv in Makefile. Beware that there will be a loooot of output, perhaps pipe it in a file.

HTH,
Stefano

Paul Everitt

unread,
Aug 23, 2019, 4:51:17 PM8/23/19
to sphinx-users
FTR, that, good sir, is a high-quality reply.

--Paul
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx...@googlegroups.com.

Tzach Livyatan

unread,
Apr 6, 2020, 3:56:31 PM4/6/20
to sphinx-users
Thanks.
I pinpoint the issue to using recommonmark.parser
With it every build generate the following:
building [mo]: targets for 0 po files that are out of date
building [dirhtml]: targets for 0 source files that are out of date
updating environment: [config changed ('source_parsers')] 504 added, 1 changed, 0 removed

I'm investigate why



 

mahiviajes agencia en ligne

unread,
Apr 6, 2020, 5:06:47 PM4/6/20
to sphinx...@googlegroups.com
Hello, I am also looking at the messages you send me every day, but I am going to tell you that I am sending some messages in French or Spanish to help me know a little more about what explains the content of the message.

--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/8d289942-18f5-439d-9ee9-15214cf69adb%40googlegroups.com.


--
soum de mahiviajes

Komiya Takeshi

unread,
Apr 8, 2020, 1:03:46 PM4/8/20
to sphinx...@googlegroups.com
Hi,

>updating environment: [config changed ('source_parsers')] 504 added, 1 changed, 0 removed

Could you let me know your `source_parsers` configuration in conf.py please?

Note: In latest recommonmark, the source parser is configured
automatically. So you don't need to configure it on your own.

Thanks,
Takeshi KOMIYA

2020年4月7日(火) 4:56 Tzach Livyatan <tz...@scylladb.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/8d289942-18f5-439d-9ee9-15214cf69adb%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages