Closed bstrdsmkr closed 1 year ago
Thanks for the thorough explanation!
Is there any chance we can get a new release with this fix in it? We are using this (excellent) plugin in https://github.com/ros2/ros2_documentation/ , and the ability to have incremental builds working would really make my life better. Thanks in advance!
Apologies for the long delay, but 2.5.1 is out now if you want to give it a try: https://github.com/jdillard/sphinx-sitemap/releases/tag/v2.5.1
Apologies for the long delay, but 2.5.1 is out now if you want to give it a try: https://github.com/jdillard/sphinx-sitemap/releases/tag/v2.5.1
Thank you for the release, it is much appreciated!
Incremental builds with this extension are currently broken. #47 added support for parallel building via a multiprocessing.Manager().Queue() proxy object attached to the Environment. Sphinx later pickles the Environment object, including the Queue proxy object. The object pickles successfully, but when the Environment is later unpickled to determine if an incremental build can be used, the proxy object tries to reconnect to the server process that existed at the time of pickling, but no longer exists. This failure is near-silently swallowed with an unintuitive error message and sphinx proceeds with a full rebuild:
The real error isn't revealed until trying to manually unpickle the environment:
Sphinx specifically excludes the instance of
app
that's attached to the Environment from pickling via it's__getstate__()
method: https://github.com/sphinx-doc/sphinx/blob/ba080286b06cb9e0cadec59a6cf1f96aa11aef5a/sphinx/environment/__init__.py#L262The PR moves the Queue proxy object to the instance of
app
provided on the Environment in order to avoid pickling the Queue object while it is connected to it's server process.As an alternative, It should be possible to create a custom Queue class with it's own
__getstate__()
method to not attempt to reconnect upon unpickling, but I believe the Most Right Answer is for upstream Sphinx to provide a way to mark custom Environment attributes as unpicklable