From d15d11df702d18074738825a5b6b74d1e141aafd Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 11 Oct 2018 17:22:39 +0200 Subject: [PATCH] Revert "Builder.build: save env also with only new documents" This reverts commit 20f625b4d39d0e981b4922f629212acc74271665, which introduced a regression in dependency tracking for build systems invoking sphinx-build (described in issue #5501.) The correct solution is to properly track when the pickle file needs to be written; unfortunately I don't know enough about sphinx to implement this. Also, I'm not sure the intersphinx cache belongs into this at all. --- sphinx/builders/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 9c75376312f..a434c21e8f7 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -369,14 +369,14 @@ def build(self, docnames, summary=None, method='update'): else: logger.info(__('none found')) - # save the environment - from sphinx.application import ENV_PICKLE_FILENAME - logger.info(bold(__('pickling environment... ')), nonl=True) - with open(path.join(self.doctreedir, ENV_PICKLE_FILENAME), 'wb') as f: - pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL) - logger.info(__('done')) - if updated_docnames: + # save the environment + from sphinx.application import ENV_PICKLE_FILENAME + logger.info(bold(__('pickling environment... ')), nonl=True) + with open(path.join(self.doctreedir, ENV_PICKLE_FILENAME), 'wb') as f: + pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL) + logger.info(__('done')) + # global actions self.app.phase = BuildPhase.CONSISTENCY_CHECK logger.info(bold(__('checking consistency... ')), nonl=True)