sphinx-doc / sphinx-autobuild

Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a hot-reload web server.
MIT License
523 stars 75 forks source link

Server stops rebuilding on changes if the pre-build step fails #158

Open pradyunsg opened 1 month ago

pradyunsg commented 1 month ago

I think the title is a sufficiently clear description. Let me know if more details are necessary.

How to reproduce

  1. Checkout https://github.com/pradyunsg/furo/tree/2024.04.27

  2. Run nox -s docs-live

  3. Wait for the initial build to complete.

  4. Modify source tree such that the pre-build command would fail.

    For this reproducer, modify src/furo/assets/styles/content/_admonitions.sass to be invalid by adding a comma at the end of line 3 of that file.

  5. Notice an exception originating from the pre-build command and the output statement from sphinx-autobuild stating:

    Pre-build command exited with exit code: 3
    Please fix the cause of the error above or press Ctrl+C to stop the server.
  6. Fix the pre-build command and save a file that would be watched by the server.

    For this reproducer, undo the addition done in step 4 (i.e. remove the comma) and save.

  7. Notice that no rebuild was triggered.

The server keeps serving the relevant changes while this is happening.