Holzhaus / sphinx-multiversion

Sphinx extension for building self-hosted versioned docs.
https://holzhaus.github.io/sphinx-multiversion/
BSD 2-Clause "Simplified" License
147 stars 65 forks source link

Documentation build fails on Travis CI #57

Open mschmidt87 opened 3 years ago

mschmidt87 commented 3 years ago

Hi, I am trying to switch our documentation build from normal sphinx to sphinx-multiversion. Locally, I can run everything just fine, but the deployment using Travis fails. This is the output of my job on Travis: https://travis-ci.org/github/Happy-Algorithms-League/hal-cgp/jobs/743167629

I am trying to build the documentation for the master branch and for one release tag (0.2.0) but it fails to find both, if I understand correctly (error message saying:

Failed load config for refs/tags/0.2.0 from /tmp/tmpwju7f358/f6143c5620f203c0d60363154278b294b603734b/docs
Failed load config for refs/heads/master from /tmp/tmpwju7f358/f6143c5620f203c0d60363154278b294b603734b/docs
No matching refs found!```).

I thought that I might need to fetch all tags explicitly, that's why I added a git fetch --all --tags to the .travis.yml but that didn't help.

This is the complete travis config file: https://github.com/Happy-Algorithms-League/hal-cgp/blob/sphinx_doc/multi_version/.travis.yml

and the actual documentation build is done in a deploy.sh script, which is:

make -C docs/ clean
make -C docs/ html
touch docs/_build/html/.nojekyll

where my Makefile then executes (inside the docs/ folder):

sphinx-multiversion  -D reset_argv=1 . _build/html

This is using the latest release (0.2.4).

opcon commented 3 years ago

I ran into a similar issue on GitLab CI. It turns out only remote branches were available (checked by adding git for-each-ref --format '%(objectname) %(refname) %(creatordate:iso)' refs to my ci script), and smv_remote_whitelist was not set in my configuration, disallowing all remote branches by default.

After setting smv_remote_whitelist = r'^(origin)$', the documentation is deployed as expected. Hopefully that might help!

As an aside, @Holzhaus: is there a way to enable debug logging through a command-line switch? This would have helped narrow down the issue.

samuel-emrys commented 3 years ago

@opcon not the author, but having looked at the code it doesn't appear so. If you're willing to put a PR together it would be trivial to add an argparse option and proxy it to sphinx-build, which accepts a -P flag to start a pdb session if an exception is raised.