I have not read all the details, but the pickled environment contains the full 
path to the project.

And at https://www.sphinx-doc.org/en/master/_modules/sphinx/environment.html 
you can find the lines

    def setup(self, app: Sphinx) -> None:
        """Set up BuildEnvironment object."""
        if self.version and self.version != app.registry.get_envversion(app):
            raise BuildEnvironmentError(__('build environment version not 
current'))
        if self.srcdir and self.srcdir != app.srcdir:
            raise BuildEnvironmentError(__('source directory has changed'))

This BuildEnvironment.setup() is called from sphinx.application:
(see https://www.sphinx-doc.org/en/master/_modules/sphinx/application.html)

    def _load_existing_env(self, filename: str) -> BuildEnvironment:
        try:
            with progress_message(__('loading pickled environment')):
                with open(filename, 'rb') as f:
                    env = pickle.load(f)
                    env.setup(self)
                    self._fresh_env_used = False
        except Exception as err:
            logger.info(__('failed: %s'), err)
            env = self._create_fresh_env()
        return env

The environment "env" loaded from the pickled file carries the absolute path
to the former location.  On the other hand the app.srcdir above contains the
absolute path to the new location.

Hence after doing "cp -a originalproject copiedproject" one gets
on next build attempt in new directory:

    loading pickled environment... failed
    failed: source directory has changed

Also other files under _build/doctrees such as index.doctree contain
absolute paths



--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/u201aj%24qpg%241%40ciao.gmane.io.

Reply via email to