Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix rebuild regression #8955

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Conversation

larsoner
Copy link
Contributor

@larsoner larsoner commented Mar 3, 2021

On fc8247a (good) or earlier or this PR, doing two consecutive builds in a row I see:

$ make clean && make html_dev-noplot && make html_dev-noplot
building [html]: targets for 50 source files that are out of date
updating environment: [new config] 755 added, 0 changed, 0 removed
...
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 7 changed, 0 removed

On #8905 / 102393f (bad) or master, I see:

$ make clean && make html_dev-noplot && make html_dev-noplot
building [html]: targets for 50 source files that are out of date
updating environment: [new config] 755 added, 0 changed, 0 removed
...
building [html]: targets for 755 source files that are out of date
updating environment: 0 added, 7 changed, 0 removed

This regression causes all documents to be rewritten in the writing output... stage, which takes the incremental build from ~10 seconds to ~2 minutes, which is a tough efficiency regression when trying to iteratively write docs.

I think this is due to object() not having a stable repr across runs because the memory location / id can change, and id is in the __repr__ of object instances. So this PR ensures that UNSET has a stable __repr__, and fixes my incremental doc builds.

I went to add a test and realized it's not so easy because you actually need multiple Python processes to get this effect, because within a given process the UNSET will have a stable repr. So that's why there is no test. And maybe this is why it escaped existing tests if there are any that check to make sure things are not unnecessarily rebuilt.

@tk0miya tk0miya added this to the 4.0.0 milestone Mar 4, 2021
@tk0miya tk0miya merged commit 58c0855 into sphinx-doc:master Mar 4, 2021
@tk0miya
Copy link
Member

tk0miya commented Mar 4, 2021

Thanks!

@larsoner larsoner deleted the fix-rebuild branch March 4, 2021 13:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants