Patch Detail
Show a patch.
GET /api/1.1/patches/24042/?format=api
{ "id": 24042, "url": "https://patchwork.libcamera.org/api/1.1/patches/24042/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24042/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20250730115045.3481-4-laurent.pinchart@ideasonboard.com>", "date": "2025-07-30T11:50:44", "name": "[v3,3/3] Documentation: Use Sphinx doxylink to generate links to doxygen", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "86c3e83b86c33ecc4288bba26949432c1b71493c", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24042/mbox/", "series": [ { "id": 5351, "url": "https://patchwork.libcamera.org/api/1.1/series/5351/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5351", "date": "2025-07-30T11:50:41", "name": "Documentation: Use doxylink to generate Sphinx-to-Doxygen links", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5351/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24042/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24042/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A03B9C32B5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Jul 2025 11:51:02 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 78E686920A;\n\tWed, 30 Jul 2025 13:51:01 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9E7769206\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jul 2025 13:50:58 +0200 (CEST)", "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 42049A57\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jul 2025 13:50:15 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"lOCqiYU4\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753876215;\n\tbh=9EMGxRYikEA3Buy07NWsDLZVV7GvR+INhVxUMQTiTnQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=lOCqiYU4K4484y7vVXsgu76hjj/r86LTGLvaxp9egrQAvUckSw9SUJPN1w1XZxLrn\n\tksZeG4VIw8m5KBf+wRYY8tQ2p8J6sv9LKEofchvrAgGLMjwgwia70w2vs3mqBibYPd\n\tZYURlH7giKPzKhuaDMLmbmUDNaszFdP/tx1jwkPk=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH v3 3/3] Documentation: Use Sphinx doxylink to generate links\n\tto doxygen", "Date": "Wed, 30 Jul 2025 14:50:44 +0300", "Message-ID": "<20250730115045.3481-4-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.49.1", "In-Reply-To": "<20250730115045.3481-1-laurent.pinchart@ideasonboard.com>", "References": "<20250730115045.3481-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The libcamera Sphinx documentation needs to link to the API\ndocumentation generated by Doxygen. The links currently point to the\ndocumentation hosted on the official https://libcamera.org/ website.\nThis causes multiple issues:\n\n- Doxygen generates URLs with MD5 hashes of function signatures, making\n the link targets unstable.\n\n- When testing documentation builds that include API changes, links to\n new API elements will be broken.\n\n- The generated documentation can't be browsed offline.\n\nFix this by using the Sphinx doxylink extension. This allows specifying\nlink targets as class and function names, with the link being\nautomatically generated using the same MD5 hashing as Doxygen. The root\nof the link target is configured in a central location, which defaults\nto the build directory and can be overridden to point to the libcamera\nwebsite when pushing the documentation.\n\nThis commit only introduces the infrastructure to use doxylink. Manual\nlinks will be replaced separately.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nChanges since v2:\n\n- Manually check the doxylink version\n\nChanges since v1:\n\n- Add sphinxcontrib.doxylink to py_modules\n---\n Documentation/Doxyfile-internal.in | 2 +\n Documentation/Doxyfile-public.in | 2 +\n Documentation/conf.py | 13 +++++-\n Documentation/meson.build | 69 ++++++++++++++++++++----------\n README.rst | 3 +-\n 5 files changed, 65 insertions(+), 24 deletions(-)", "diff": "diff --git a/Documentation/Doxyfile-internal.in b/Documentation/Doxyfile-internal.in\nindex 5343bc2b131c..a422bb0719da 100644\n--- a/Documentation/Doxyfile-internal.in\n+++ b/Documentation/Doxyfile-internal.in\n@@ -3,6 +3,8 @@\n @INCLUDE_PATH = @TOP_BUILDDIR@/Documentation\n @INCLUDE = Doxyfile-common\n \n+GENERATE_TAGFILE = @TOP_BUILDDIR@/Documentation/internal-api-html/tagfile.xml\n+\n HIDE_UNDOC_CLASSES = NO\n HIDE_UNDOC_MEMBERS = NO\n HTML_OUTPUT = internal-api-html\ndiff --git a/Documentation/Doxyfile-public.in b/Documentation/Doxyfile-public.in\nindex 36bb57584a07..c3a8b0dd003a 100644\n--- a/Documentation/Doxyfile-public.in\n+++ b/Documentation/Doxyfile-public.in\n@@ -3,6 +3,8 @@\n @INCLUDE_PATH = @TOP_BUILDDIR@/Documentation\n @INCLUDE = Doxyfile-common\n \n+GENERATE_TAGFILE = @TOP_BUILDDIR@/Documentation/api-html/tagfile.xml\n+\n HIDE_UNDOC_CLASSES = YES\n HIDE_UNDOC_MEMBERS = YES\n HTML_OUTPUT = api-html\ndiff --git a/Documentation/conf.py b/Documentation/conf.py\nindex 870937289eb4..f50be60a1559 100644\n--- a/Documentation/conf.py\n+++ b/Documentation/conf.py\n@@ -37,7 +37,8 @@ author = 'The libcamera documentation authors'\n # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n # ones.\n extensions = [\n- 'sphinx.ext.graphviz'\n+ 'sphinx.ext.graphviz',\n+ 'sphinxcontrib.doxylink',\n ]\n \n graphviz_output_format = 'svg'\n@@ -71,6 +72,16 @@ exclude_patterns = [\n # The name of the Pygments (syntax highlighting) style to use.\n pygments_style = None\n \n+doxylink = {\n+ 'doxy-pub': (\n+ 'Documentation/api-html/tagfile.xml',\n+ '../api-html/',\n+ ),\n+ 'doxy-int': (\n+ 'Documentation/internal-api-html/tagfile.xml',\n+ '../internal-api-html/',\n+ ),\n+}\n \n # -- Options for HTML output -------------------------------------------------\n \ndiff --git a/Documentation/meson.build b/Documentation/meson.build\nindex 3afdcc1a87af..b898ba3a0b7e 100644\n--- a/Documentation/meson.build\n+++ b/Documentation/meson.build\n@@ -81,16 +81,16 @@ if doxygen.found() and dot.found()\n '@INPUT@',\n ])\n \n- custom_target('doxygen-public',\n- input : [\n- doxyfile,\n- doxyfile_common,\n- ],\n- output : 'api-html',\n- command : [doxygen, doxyfile],\n- install : true,\n- install_dir : doc_install_dir,\n- install_tag : 'doc')\n+ doxygen_public = custom_target('doxygen-public',\n+ input : [\n+ doxyfile,\n+ doxyfile_common,\n+ ],\n+ output : 'api-html',\n+ command : [doxygen, doxyfile],\n+ install : true,\n+ install_dir : doc_install_dir,\n+ install_tag : 'doc')\n \n # This is the internal documentation, which hard-codes a list of directories\n # to parse in its doxyfile.\n@@ -99,18 +99,18 @@ if doxygen.found() and dot.found()\n output : 'Doxyfile-internal',\n configuration : cdata)\n \n- custom_target('doxygen-internal',\n- input : [\n- doxyfile,\n- doxyfile_common,\n- doxygen_public_input,\n- doxygen_internal_input,\n- ],\n- output : 'internal-api-html',\n- command : [doxygen, doxyfile],\n- install : true,\n- install_dir : doc_install_dir,\n- install_tag : 'doc-internal')\n+ doxygen_internal = custom_target('doxygen-internal',\n+ input : [\n+ doxyfile,\n+ doxyfile_common,\n+ doxygen_public_input,\n+ doxygen_internal_input,\n+ ],\n+ output : 'internal-api-html',\n+ command : [doxygen, doxyfile],\n+ install : true,\n+ install_dir : doc_install_dir,\n+ install_tag : 'doc-internal')\n endif\n \n #\n@@ -121,6 +121,27 @@ sphinx = find_program('sphinx-build-3', 'sphinx-build',\n required : get_option('documentation'))\n \n if sphinx.found()\n+ # Many distributions do not provide a recent-enough version of the doxylink\n+ # module. This results in a build error with a cryptic message. Check the\n+ # version manually and print clear error messages.\n+ py_mod = import('python')\n+ py3 = py_mod.find_installation('python3')\n+\n+ mod = 'sphinxcontrib.doxylink'\n+ min_version = '>=1.6.1'\n+ version = run_command(py3, '-c',\n+ 'import @0@ ; print(@0@.__version__)'.format(mod),\n+ check : false).stdout().strip()\n+\n+ if version == ''\n+ error('@0@ module not found'.format(mod))\n+ endif\n+\n+ if not version.version_compare(min_version)\n+ error('@0@ module v@1@ is too old, @2@ is needed'\n+ .format(mod, version, min_version))\n+ endif\n+\n docs_sources = [\n 'camera-sensor-model.rst',\n 'code-of-conduct.rst',\n@@ -154,6 +175,10 @@ if sphinx.found()\n input : docs_sources,\n output : 'html',\n build_by_default : true,\n+ depends : [\n+ doxygen_public,\n+ doxygen_internal,\n+ ],\n install : true,\n install_dir : doc_install_dir,\n install_tag : 'doc')\ndiff --git a/README.rst b/README.rst\nindex e2a6e275895e..e9a7dd82de74 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -67,7 +67,8 @@ for device hotplug enumeration: [optional]\n libudev-dev\n \n for documentation: [optional]\n- python3-sphinx doxygen graphviz texlive-latex-extra\n+ doxygen graphviz python3-sphinx python3-sphinxcontrib.doxylink (>= 1.6.1)\n+ texlive-latex-extra\n \n for gstreamer: [optional]\n libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev\n", "prefixes": [ "v3", "3/3" ] }