Build fail migrating from 25.11 to 26.05 relating to Python and Sphinx

Hi,
I’ve recently found out 26.05 has released and today (2026-05-31) wanted to do the upgrade. Seeing as I use a flake for the NixOS config, I just changed HomeManager’s and Nixpkgs’ version to pull from to 26.05 in the inputs attr. set and hit sudo nixos-rebuild switch.

However, and very unexpectedly on this super-stable OS otherwise, I ran into an issue. Not quite sure why, but the system always fails when building python3.12-3.12.13-doc at the buildSphinx phase (log below). I might be writing incorrectly here and should write to Sphinx devs, but I want to start from the top, i.e. NixOS. Any idea if the issue is known and are there steps how to fix it (I didn’t find anything, but maybe I used the wrong keywords)? Or is this Sphinx-only thing I should discuss there? In that case… any idea how to get the full log file of its output? It says it has some at /build/..., but expectedly there was no such path from the root, so I’m unsure where to look for that.

Thank you for any help.


The output of the nixos-rebuild command:

building the system configuration...
error: Cannot build '/nix/store/i99b9ai081igykh4wwjr464258nl95k1-python3.12-3.12.13-doc.drv'.
       Reason: builder failed with exit code 2.
       Output paths:
         /nix/store/3gwj8amzqnkxzd6r11890822ii9hlb5w-python3.12-3.12.13-doc
       Last 25 log lines:
       >         ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >                              node, match_titles)
       >                              ^^^^^^^^^^^^^^^^^^^
       >       File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 215, in run
       >         results = StateMachineWS.run(self, input_lines, input_offset)
       >       File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 234, in run
       >         context, next_state, result = self.check_line(
       >                                       ~~~~~~~~~~~~~~~^
       >             context, state, transitions)
       >             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >       File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 446, in check_line
       >         return method(match, context, next_state)
       >       File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1409, in enumerator
       >         format, sequence, text, ordinal = self.parse_enumerator(match)
       >                                           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^
       >       File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1494, in parse_enumerator
       >         ordinal = int(self.enum.converters[sequence](text))
       >     TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
       >
       >
       > The full traceback has been saved in:
       > /build/sphinx-err-ykwu7l8f.log
       >
       > To report this error to the developers, please open an issue at <https://github.com/sphinx-doc/sphinx/issues/>. Thanks!
       > Please also report this if it was a user error, so that a better error message can be provided next time.
       For full logs, run:
         nix log /nix/store/i99b9ai081igykh4wwjr464258nl95k1-python3.12-3.12.13-doc.drv
error: Cannot build '/nix/store/napm0273y4j5avnpn8ds77qjd1b79nvz-user-environment.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/yxkajflx8c1yd24l7xm54by8ddbsq5n4-user-environment
error: Build failed due to failed dependency
error: Cannot build '/nix/store/7rapqfp6a4q7pjw5pldb7hp8bl0vccmc-etc.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/48xyri1bzbl0lzp7nyhckric2pgcp0vw-etc
error: Build failed due to failed dependency
error: Cannot build '/nix/store/g1526pir9j3j85kqxs8cyx4p9d7c7j7y-activate.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/k0cdli8s87k1g00a04h26cjzgwh7w41v-activate
error: Cannot build '/nix/store/xqx6qvbxhpir7pqhjvkj3yhapnq7v5az-nixos-system-nixos-26.05.20260529.e8e446a.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/5cqmc81ygi17gp8yj9gby4nvw8y1h0ng-nixos-system-nixos-26.05.20260529.e8e446a
error: Build failed due to failed dependency
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '/etc/nixos#nixosConfigurations."nixos".config.system.build.toplevel' --no-link --show-trace' returned non-zero exit status 1.

The log (output from nix log ... from the previous output):

Sourcing sphinx-hook
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/k06n7vwxpi8bb3kkij87ncid2v08qn0y-Python-3.12.13.tar.xz
source root is Python-3.12.13
setting SOURCE_DATE_EPOCH to timestamp 1772541570 of file "Python-3.12.13/pyconfig.h.in"
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Updating Autotools / GNU config script to a newer upstream version: ./config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config.guess
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
no Makefile or custom installPhase, doing nothing
Running phase: buildSphinxPhase
@nix { "action": "setPhase", "phase": "buildSphinxPhase" }
Executing buildSphinxPhase
Executing sphinx-build with html builder
Running Sphinx v9.1.0
loading translations [en]... locale_dir /build/Python-3.12.13/Doc/locales/en/LC_MESSAGES does not exist
locale_dir /build/Python-3.12.13/Doc/locales/en/LC_MESSAGES does not exist
done
making output directory... done
locale_dir /build/Python-3.12.13/Doc/locales/en/LC_MESSAGES does not exist
locale_dir /build/Python-3.12.13/Doc/locales/en/LC_MESSAGES does not exist
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 501 source files that are out of date
updating environment: locale_dir /build/Python-3.12.13/Doc/locales/en/LC_MESSAGES does not exist
[new config] 501 added, 0 changed, 0 removed
reading sources... [  0%] about
reading sources... [  0%] bugs
reading sources... [  1%] c-api/abstract
reading sources... [  1%] c-api/allocation
reading sources... [  1%] c-api/apiabiversion
reading sources... [  1%] c-api/arg
reading sources... [  1%] c-api/bool
reading sources... [  2%] c-api/buffer
reading sources... [  2%] c-api/bytearray
reading sources... [  2%] c-api/bytes
reading sources... [  2%] c-api/call
reading sources... [  2%] c-api/capsule
reading sources... [  3%] c-api/cell
reading sources... [  3%] c-api/code
reading sources... [  3%] c-api/codec
reading sources... [  3%] c-api/complex
reading sources... [  3%] c-api/concrete
reading sources... [  4%] c-api/contextvars
reading sources... [  4%] c-api/conversion
reading sources... [  4%] c-api/coro
reading sources... [  4%] c-api/datetime
reading sources... [  4%] c-api/descriptor
reading sources... [  5%] c-api/dict
reading sources... [  5%] c-api/exceptions
reading sources... [  5%] c-api/file
reading sources... [  5%] c-api/float
reading sources... [  5%] c-api/frame
reading sources... [  6%] c-api/function
reading sources... [  6%] c-api/gcsupport
reading sources... [  6%] c-api/gen
reading sources... [  6%] c-api/hash
reading sources... [  6%] c-api/import
reading sources... [  7%] c-api/index
reading sources... [  7%] c-api/init
reading sources... [  7%] c-api/init_config
reading sources... [  7%] c-api/intro
reading sources... [  7%] c-api/iter
reading sources... [  8%] c-api/iterator
reading sources... [  8%] c-api/list
reading sources... [  8%] c-api/long
reading sources... [  8%] c-api/mapping
reading sources... [  8%] c-api/marshal
reading sources... [  9%] c-api/memory
reading sources... [  9%] c-api/memoryview
reading sources... [  9%] c-api/method
reading sources... [  9%] c-api/module
reading sources... [  9%] c-api/none
reading sources... [ 10%] c-api/number
reading sources... [ 10%] c-api/objbuffer
reading sources... [ 10%] c-api/object
reading sources... [ 10%] c-api/objimpl
reading sources... [ 10%] c-api/perfmaps
reading sources... [ 11%] c-api/refcounting
reading sources... [ 11%] c-api/reflection
reading sources... [ 11%] c-api/sequence
reading sources... [ 11%] c-api/set
reading sources... [ 11%] c-api/slice
reading sources... [ 12%] c-api/stable
reading sources... [ 12%] c-api/structures
reading sources... [ 12%] c-api/sys
reading sources... [ 12%] c-api/tuple
reading sources... [ 12%] c-api/type
reading sources... [ 13%] c-api/typehints
reading sources... [ 13%] c-api/typeobj
reading sources... [ 13%] c-api/unicode
reading sources... [ 13%] c-api/utilities
reading sources... [ 13%] c-api/veryhigh
reading sources... [ 14%] c-api/weakref
reading sources... [ 14%] contents
reading sources... [ 14%] copyright
reading sources... [ 14%] deprecations/c-api-pending-removal-in-3.14
reading sources... [ 14%] deprecations/c-api-pending-removal-in-3.15
reading sources... [ 15%] deprecations/c-api-pending-removal-in-future
reading sources... [ 15%] deprecations/index
reading sources... [ 15%] deprecations/pending-removal-in-3.13
reading sources... [ 15%] deprecations/pending-removal-in-3.14
reading sources... [ 15%] deprecations/pending-removal-in-3.15
reading sources... [ 16%] deprecations/pending-removal-in-3.16
reading sources... [ 16%] deprecations/pending-removal-in-future
reading sources... [ 16%] distributing/index
reading sources... [ 16%] extending/building
reading sources... [ 16%] extending/embedding
reading sources... [ 17%] extending/extending
reading sources... [ 17%] extending/index
reading sources... [ 17%] extending/newtypes
reading sources... [ 17%] extending/newtypes_tutorial
reading sources... [ 17%] extending/windows
reading sources... [ 18%] faq/design


Versions
========

* Platform:         linux; (Linux-6.12.60-x86_64-with-glibc2.42)
* Python version:   3.13.13 (CPython)
* Sphinx version:   9.1.0
* Docutils version: 0.22.4
* Jinja2 version:   3.1.6
* Pygments version: 2.20.0

Last Messages
=============


    reading sources... [ 17%]
    extending/newtypes_tutorial

    reading sources... [ 17%]
    extending/windows

    reading sources... [ 18%]
    faq/design

Loaded Extensions
=================

* sphinx.ext.mathjax (9.1.0)
* alabaster (1.0.0)
* sphinxcontrib.applehelp (2.0.0)
* sphinxcontrib.devhelp (2.0.0)
* sphinxcontrib.htmlhelp (2.1.0)
* sphinxcontrib.serializinghtml (2.0.0)
* sphinxcontrib.qthelp (2.0.0)
* audit_events (1.0)
* availability (1.0)
* c_annotations (1.0)
* changes (1.0)
* glossary_search (1.0)
* implementation_detail (1.0)
* issue_role (1.0)
* lexers (1.0)
* misc_news (1.0)
* pydoc_topics (1.0)
* pyspecific (1.0)
* sphinx.ext.coverage (9.1.0)
* sphinx.ext.doctest (9.1.0)
* sphinx.ext.extlinks (9.1.0)
* python_docs_theme (2026.4)

Traceback
=========

    Traceback (most recent call last):
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/cmd/build.py", line 432, in build_main
        app.build(args.force_all, args.filenames)
        ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/application.py", line 442, in build
        self.builder.build_update()
        ~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/builders/__init__.py", line 381, in build_update
        self.build(
        ~~~~~~~~~~^
            to_build,
            ^^^^^^^^^
        ...<2 lines>...
            method='update',
            ^^^^^^^^^^^^^^^^
        )
        ^
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/builders/__init__.py", line 409, in build
        updated_docnames = set(self.read())
                               ~~~~~~~~~^^
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/builders/__init__.py", line 525, in read
        self._read_serial(docnames)
        ~~~~~~~~~~~~~~~~~^^^^^^^^^^
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/builders/__init__.py", line 590, in _read_serial
        self.read_doc(docname)
        ~~~~~~~~~~~~~^^^^^^^^^
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/builders/__init__.py", line 653, in read_doc
        doctree = _parse_str_to_doctree(
            content,
        ...<6 lines>...
            transforms=self._registry.get_transforms(),
        )
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/util/docutils.py", line 902, in _parse_str_to_doctree
        parser.parse(content, document)
        ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
      File "/nix/store/7rcmdx7w0lg08rbkb4fd52a19xchdqv1-python3.13-sphinx-9.1.0/lib/python3.13/site-packages/sphinx/parsers.py", line 99, in parse
        self.statemachine.run(inputlines, document, inliner=self.inliner)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 182, in run
        results = StateMachineWS.run(self, input_lines, input_offset,
                                     input_source=document['source'])
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 234, in run
        context, next_state, result = self.check_line(
                                      ~~~~~~~~~~~~~~~^
            context, state, transitions)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 446, in check_line
        return method(match, context, next_state)
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1277, in indent
        elements = self.block_quote(indented, line_offset)
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1294, in block_quote
        self.nested_parse(blockquote_lines, line_offset, blockquote)
        ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 357, in nested_parse
        my_state_machine.run(block, input_offset, self.memo,
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                             node, match_titles)
                             ^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 215, in run
        results = StateMachineWS.run(self, input_lines, input_offset)
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 234, in run
        context, next_state, result = self.check_line(
                                      ~~~~~~~~~~~~~~~^
            context, state, transitions)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 446, in check_line
        return method(match, context, next_state)
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1277, in indent
        elements = self.block_quote(indented, line_offset)
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1294, in block_quote
        self.nested_parse(blockquote_lines, line_offset, blockquote)
        ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 357, in nested_parse
        my_state_machine.run(block, input_offset, self.memo,
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                             node, match_titles)
                             ^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 215, in run
        results = StateMachineWS.run(self, input_lines, input_offset)
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 234, in run
        context, next_state, result = self.check_line(
                                      ~~~~~~~~~~~~~~~^
            context, state, transitions)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/statemachine.py", line 446, in check_line
        return method(match, context, next_state)
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1409, in enumerator
        format, sequence, text, ordinal = self.parse_enumerator(match)
                                          ~~~~~~~~~~~~~~~~~~~~~^^^^^^^
      File "/nix/store/s1fya244ggpq1jhy8cx4ybk2favrn521-python3.13-docutils-0.22.4/lib/python3.13/site-packages/docutils/parsers/rst/states.py", line 1494, in parse_enumerator
        ordinal = int(self.enum.converters[sequence](text))
    TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'


The full traceback has been saved in:
/build/sphinx-err-ykwu7l8f.log

To report this error to the developers, please open an issue at <https://github.com/sphinx-doc/sphinx/issues/>. Thanks!
Please also report this if it was a user error, so that a better error message can be provided next time.
1 Like

This is a known issue.

A workaround from the issue is:

documentation.doc.enable = false;
3 Likes

Thank you for the speedy response! And thank you for copying the workaround.

I wonder how this got through… Anyway, I hope I won’t be missing some docs with this off.

(…Of course I got into another issue with snes9x-gtk missing an unzip.h file and my GNOME also seems to have died after I just decided to not use that program. This migration seems to be rougher than 25.05 to 25.11 for me, haha.)

Edit: GNOME was just weird, seems it works fine now. Still not sure what snes9x-gtk is pissy about, but that’s gonna be a problem for tomorrow me.

1 Like

By definition you will, as the option disables all documentation. It is possible to be more precise with what documentation is disabled, but this requires knowing what pulls in the failing dependency.

1 Like

Yes, I meant it more of in the vein “when I need some I’ll be screwed.” Anyhow, I’ll mark this as fixed, even though the issue still persists, we just hide it.

Once again thanks for the quick and helpful reply! Have a nice rest of your day.

1 Like