Patch Detail
Show a patch.
GET /api/1.1/patches/17761/?format=api
{ "id": 17761, "url": "https://patchwork.libcamera.org/api/1.1/patches/17761/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17761/", "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": "<mailman.114.1668011787.939.libcamera-devel@lists.libcamera.org>", "date": "2022-11-09T16:36:14", "name": "[libcamera-devel,v1] libcamera: tracing: fix header generation when built as subproject", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c162caddd5b32eb314ff253d3f051997bd5bd105", "submitter": { "id": 133, "url": "https://patchwork.libcamera.org/api/1.1/people/133/?format=api", "name": "Pőcze Barnabás", "email": "pobrn@protonmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17761/mbox/", "series": [ { "id": 3600, "url": "https://patchwork.libcamera.org/api/1.1/series/3600/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3600", "date": "2022-11-09T16:36:14", "name": "[libcamera-devel,v1] libcamera: tracing: fix header generation when built as subproject", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3600/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17761/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17761/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 479FDBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 9 Nov 2022 16:36:28 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A986863083;\n\tWed, 9 Nov 2022 17:36:27 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1668011787;\n\tbh=nIGq9KFof3RXYQNRMB/mECslxVfmPMIL7OiZ8xxzfaw=;\n\th=Date:To:List-Id:List-Post:From:List-Subscribe:List-Unsubscribe:\n\tList-Archive:Reply-To:List-Help:Subject:From;\n\tb=FBVcB2lTpgpKKPx8IT9oKXsvWf0EARFOcBYaNhkv5rldxk4QkT28CZFlkCHYh4nY0\n\tJQh4CevqCKc/t43ocR0NUgdP4JkDGmlTdT7Cr9P3NsEVZyMXTIwHNMHQcjo+x0n5ba\n\tddl1fxnQhRE1ezvg7OkF8z8oHammwYoolKpGDpDFMN7lwJJ/27CIPbNI8jVh2p8uTn\n\t99xpdk9PTY9AxvdoaDjlFb0Lwz+ygH2UoU0wCcWoHwFiGG3bRz3pAUvShxxsgjMBGV\n\tt2wF22izDJRNKzQMafResIuReMTN2dI5pzHPsyx2vkWWy/NB//dLNmNGPlNdzbVpUh\n\t1BUh26eeKrLUA==", "Date": "Wed, 09 Nov 2022 16:36:14 +0000", "To": "libcamera-devel@lists.libcamera.org", "MIME-Version": "1.0", "Message-ID": "<mailman.114.1668011787.939.libcamera-devel@lists.libcamera.org>", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?=\n\t<libcamera-devel@lists.libcamera.org>", "Precedence": "list", "X-Mailman-Version": "2.1.29", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "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/>", "Reply-To": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "Subject": "[libcamera-devel] [PATCH v1] libcamera: tracing: fix header\n\tgeneration when built as subproject", "Content-Type": "message/rfc822", "Content-Disposition": "inline", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The previously used\n\n path = output.replace('include/', '', 1)\n\nlogic is not sufficient to correctly determine the proper path\nwhen libcamera is built as a subproject. Fix it by using Python's\npathlib to calculate the relative path of the output file with\nrespect to the \"include\" directory of libcamera.\n\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n---\n include/libcamera/internal/meson.build | 2 +-\n include/meson.build | 2 ++\n utils/tracepoints/gen-tp-header.py | 13 +++++++------\n 3 files changed, 10 insertions(+), 7 deletions(-)\n\n--\n2.38.1", "diff": "diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\nindex 7a780d48ee57..f8be86e040c5 100644\n--- a/include/libcamera/internal/meson.build\n+++ b/include/libcamera/internal/meson.build\n@@ -6,7 +6,7 @@ libcamera_tracepoint_header = custom_target(\n 'tp_header',\n input: ['tracepoints.h.in', tracepoint_files],\n output: 'tracepoints.h',\n- command: [gen_tracepoints_header, '@OUTPUT@', '@INPUT@'],\n+ command: [gen_tracepoints_header, include_build_dir, '@OUTPUT@', '@INPUT@'],\n )\n\n libcamera_internal_headers = files([\ndiff --git a/include/meson.build b/include/meson.build\nindex 27ce2f41c534..19b93a7bd753 100644\n--- a/include/meson.build\n+++ b/include/meson.build\n@@ -1,4 +1,6 @@\n # SPDX-License-Identifier: CC0-1.0\n\n+include_build_dir = meson.current_build_dir()\n+\n subdir('android')\n subdir('libcamera')\ndiff --git a/utils/tracepoints/gen-tp-header.py b/utils/tracepoints/gen-tp-header.py\nindex bbd472d972d0..a454615e4625 100755\n--- a/utils/tracepoints/gen-tp-header.py\n+++ b/utils/tracepoints/gen-tp-header.py\n@@ -8,22 +8,23 @@\n\n import datetime\n import jinja2\n+import pathlib\n import os\n import sys\n\n def main(argv):\n- if len(argv) < 3:\n- print(f'Usage: {argv[0]} output template tp_files...')\n+ if len(argv) < 4:\n+ print(f'Usage: {argv[0]} include_build_dir output template tp_files...')\n return 1\n\n- output = argv[1]\n- template = argv[2]\n+ output = argv[2]\n+ template = argv[3]\n\n year = datetime.datetime.now().year\n- path = output.replace('include/', '', 1)\n+ path = pathlib.Path(output).absolute().relative_to(argv[1])\n\n source = ''\n- for fname in argv[3:]:\n+ for fname in argv[4:]:\n source += open(fname, 'r', encoding='utf-8').read() + '\\n\\n'\n\n template = jinja2.Template(open(template, 'r', encoding='utf-8').read())\n", "prefixes": [ "libcamera-devel", "v1" ] }