Bug 2105931 - kea fails to build docs with Sphinx 5+
Summary: kea fails to build docs with Sphinx 5+
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kea
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Martin Osvald 🛹
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2082944
TreeView+ depends on / blocked
 
Reported: 2022-07-11 08:43 UTC by Karolina Surma
Modified: 2022-07-21 11:28 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-07-21 11:28:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2022-07-11 08:43:06 UTC
Description of problem:
kea fails to build documentation with Sphinx 5 as it sets language to None instead of a valid language string in its conf.py. 
This setting is newly invalid.

There was an upstream change that set the key correctly: https://github.com/isc-projects/kea/commit/d9ee88c1e61a386fa734a8224ecf77a06b1647ca which was included in much newer package than we have in Fedora.


Version-Release number of selected component (if applicable):
2.0.2

How reproducible:
Always

Steps to Reproduce:
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-5/fedora-rawhide-x86_64/ --no-clean <your.src.rpm>
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-5/fedora-rawhide-x86_64/ shell


Actual results:

/usr/bin/sphinx-build -M html . ./_build -v -E -a -W -j 2 -c "/builddir/build/BUILD/kea-2.0.2/doc/sphinx"
Running Sphinx v5.0.2
make[3]: Leaving directory '/builddir/build/BUILD/kea-2.0.2/doc/sphinx'

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/sphinx/application.py", line 202, in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/sphinx/config.py", line 172, in read
    logger.warning(__("Invalid configuration value found: 'language = None'. "
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 1855, in warning
    self.log(WARNING, msg, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/sphinx/util/logging.py", line 122, in log
    super().log(level, msg, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 1887, in log
    self.logger.log(level, msg, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 1559, in log
    self._log(level, msg, args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 1706, in callHandlers
    hdlr.handle(record)
    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 974, in handle
    rv = self.filter(record)
         ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/logging/__init__.py", line 830, in filter
    result = f.filter(record)
             ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/sphinx/util/logging.py", line 425, in filter
    raise exc
    ^^^^^^^^^
sphinx.errors.SphinxWarning: Invalid configuration value found: 'language = None'. Update your configuration to a valid langauge code. Falling back to 'en' (English).

Expected results:
Build succeeds

Comment 1 Martin Osvald 🛹 2022-07-21 07:13:50 UTC
Hi Karolina,

Thank you for the great reproducer and link to the patch!

I tried to backport the commit you mentioned and test it, but it appears the mock doesn't follow the `--no-clean` option and the BUILD directory is empty for me. Maybe I am doing something wrong?

~~~
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-5/fedora-rawhide-x86_64/ --no-clean kea-2.0.2-1.fc37.src.rpm
...
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-5/fedora-rawhide-x86_64/ shell
...
<mock-chroot> sh-5.1# /usr/bin/sphinx-build -M html . ./_build -v -E -a -W -j 2 -c "/builddir/build/BUILD/kea-2.0.2/doc/sphinx"
Running Sphinx v5.0.2

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/sphinx/application.py", line 202, in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/sphinx/config.py", line 163, in read
    raise ConfigError(__("config directory doesn't contain a conf.py file (%s)") %
sphinx.errors.ConfigError: config directory doesn't contain a conf.py file (/builddir/build/BUILD/kea-2.0.2/doc/sphinx)

Configuration error:
config directory doesn't contain a conf.py file (/builddir/build/BUILD/kea-2.0.2/doc/sphinx)
<mock-chroot> sh-5.1# ls /builddir/build/BUILD/kea-2.0.2/doc/sphinx
ls: cannot access '/builddir/build/BUILD/kea-2.0.2/doc/sphinx': No such file or directory
<mock-chroot> sh-5.1#
~~~


Anyway, I made a scratch build with the included patch so please, could you test it by yourself and report whether it fixes the issue?

https://koji.fedoraproject.org/koji/taskinfo?taskID=89781004

If it works, I will release a new version including the commit.

Thanks!

Comment 2 Martin Osvald 🛹 2022-07-21 07:31:34 UTC
forgot to add needinfo for comment 1

Comment 3 Karolina Surma 2022-07-21 09:11:46 UTC
Hi,

I built kea-2.0.2-2 from the SRPM from your Koji scratch build in Copr: https://copr.fedorainfracloud.org/coprs/ksurma/sphinx-5/build/4655827/ and my local mock to both successes.
I can see the built documentation in the resulting RPM. The issue is fixed. 
Also, please note that current Rawhide's kea is on release 3 after a few mass rebuild bumps, so you'd need to bump the release at least to 4.


Regarding the reproducer, I ran the exact same steps as you in the mock:
<mock-chroot> sh-5.1# /usr/bin/sphinx-build -M html . ./_build -v -E -a -W -j 2 -c "/builddir/build/BUILD/kea-2.0.2/doc/sphinx"

Which resulted in the same error I started the ticket with. 
So I'm afraid I don't have any "proper" ideas to sell here, except for - maybe scrubbing the mock before the build would work?
$ mock -r fedora-rawhide-x86_64 --scrub=all

Comment 4 Martin Osvald 🛹 2022-07-21 09:23:24 UTC
Thank you for the confirmation the backported patch fixed the issue and also for warning me about the mass rebuild!

I will try to play with the repro out of curiosity for a while to see where might be a problem.

Comment 5 Martin Osvald 🛹 2022-07-21 11:28:17 UTC
Fixed in rawhide:

https://bodhi.fedoraproject.org/updates/FEDORA-2022-52c16c875d


Note You need to log in before you can comment on or make changes to this bug.