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

docbuild: Ignore "source directory has changed" #33354

Closed
mkoeppe opened this issue Feb 15, 2022 · 2 comments
Closed

docbuild: Ignore "source directory has changed" #33354

mkoeppe opened this issue Feb 15, 2022 · 2 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 15, 2022

From #33103 comment:101:

Currently we are not able to warmstart a docbuild from a new source directory (SAGE_ROOT).

To reproduce: After a docbuild in some OLD_SAGE_ROOT (which installs documentation in OLD_SAGE_ROOT/local, create a new worktree or clone of the Sage source and configure it using configure --prefix=OLD_SAGE_ROOT/local. Then the docbuild in the new source tree will show:

[sagemath_doc_html-none] make doc-inventory--reference-references
[sagemath_doc_html-none] cd /workspace/sage && ./sage --docbuild --no-pdf-links reference/references inventory 
[sagemath_doc_html-none] [reference] loading pickled environment... failed
[sagemath_doc_html-none] [reference] failed: source directory has changed

(see also comment in docker/.gitpod.Dockerfile)

This blocks fast incremental builds of the documentation for Gitpod (see #33113) and the per-ticket documentation build (added in #31415).

CC: @tobiasdiez @jhpalmieri @kwankyu

Component: build

Issue created by migration from https://trac.sagemath.org/ticket/33354

@mkoeppe mkoeppe added this to the sage-9.6 milestone Feb 15, 2022
@kwankyu
Copy link
Collaborator

kwankyu commented Feb 16, 2022

comment:1

This code in sphinx/environment/__init__.py is relevant:

    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'))
        elif self.srcdir and self.srcdir != app.srcdir:
            raise BuildEnvironmentError(__('source directory has changed'))

        if self.project:
            app.project.restore(self.project) 

Sphinx rebuilds everything when it detected changes in "environment", in this case, the path to the source doc files.

It seems hard to cheat Sphinx...

@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 2, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe removed this from the sage-10.0 milestone Apr 30, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 6, 2023

Closing in favor of just building in the same directory, as done in #35652

@mkoeppe mkoeppe closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants