flatpak / flatpak-docs

Flatpak documentation
https://docs.flatpak.org
Other
79 stars 132 forks source link

Can't build documentation #477

Closed hfiguiere closed 3 months ago

hfiguiere commented 3 months ago

I did:

python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt sphinx-intl
make -C docs html

I get

Running Sphinx v6.2.1
loading pickled environment... failed
failed: No module named 'sphinx.util._pathlib'
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: targets for 35 source files that are out of date
updating environment: [new config] 35 added, 0 changed, 0 removed
reading sources... [100%] using-flatpak                                                                                                                    
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
WARNING: [Social card]: image_mini file doesn't exist, skipping...                                                                                         

Extension error (sphinxext.opengraph):
Handler <function html_page_context at 0x7f8c99bcd440> for event 'html-page-context' threw an exception (exception: [Errno 2] No such file or directory: '/usr/lib/python3.12/site-packages/sphinxext/opengraph/_static/Roboto-Flex.ttf')
make: *** [Makefile:20: html] Error 2
make: Leaving directory '/var/home/hub/source/flatpak-docs/docs'

So there is something missing in the README

hfiguiere commented 3 months ago

WTF does it try to access /usr/lib from the venv?

hfiguiere commented 3 months ago

Seems that it wanted to access the distro (Fedora in toolbox) package. Removing the python3-sphinxext-opengraph worked around this, but python3-sphinx also needd to be removed.

bbhtt commented 3 months ago

Yea, Fedora has a sphinx-build-3 symlink in /usr while pip inside the venv has sphinx-build

If sphinx-build-3 is found first from the system, that is used, which uses python modules from the system.

I can modify the Makefile to be something like:

SPHINXBUILD   = sphinx-build

or

VENVDIR       = .venv
SPHINXBUILD   = PATH=$(VENVDIR)/bin:$$PATH sphinx-build

but that'll drops support for sphinx-build-3