sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.25k stars 2.04k forks source link

Restore old build on failure #11810

Closed JasonGrace2282 closed 7 months ago

JasonGrace2282 commented 7 months ago

The Problem If you're working on a big project (in my case, manim), and you're working on the documentation and experimenting with it and an error occurs the next time you try to rebuild the docs it has to rebuild every single piece of documentation again.

Possible Solution One way this could probably be fixed is by restoring the old (I believe pickled?) environment if an error occurs, so that it doesn't try to read every single source under the sun.

picnixz commented 7 months ago

I don't think it's a good idea. There are too many corner cases to handle and depending on the build failure, you really want to wipe everything that was done.

Alternatively, I would suggest that you create your own Makefile rule for that. You can do a 'copy' of the pickled environment before running the target, and if the Makefile target fails, then you can revert whatever you stored.