Patch Detail
Show a patch.
GET /api/1.1/patches/14498/?format=api
{ "id": 14498, "url": "https://patchwork.libcamera.org/api/1.1/patches/14498/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14498/", "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": "<20211013122312.1943362-2-naush@raspberrypi.com>", "date": "2021-10-13T12:23:12", "name": "[libcamera-devel,v2,1/1] build: Preserve upstream git versioning using meson dist", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cd656ffcccc705c0ce5222f37b593bcdc3cfdf25", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14498/mbox/", "series": [ { "id": 2622, "url": "https://patchwork.libcamera.org/api/1.1/series/2622/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2622", "date": "2021-10-13T12:23:11", "name": "Save version string with meson dist", "version": 2, "mbox": "https://patchwork.libcamera.org/series/2622/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14498/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14498/checks/", "tags": {}, "headers": { "Return-Path": "<kieran.bingham@ideasonboard.com>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": [ "parsemail@patchwork.libcamera.org", "kbingham@ideasonboard.com" ], "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0B90CBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 9 Nov 2021 17:42:35 +0000 (UTC)", "from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9CDD0DEE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 9 Nov 2021 18:42:34 +0100 (CET)", "from perceval.ideasonboard.com\n\tby perceval.ideasonboard.com with LMTP id CKOcA7jPZmFSRwAA4E0KoQ\n\t(envelope-from <libcamera-devel-bounces@lists.libcamera.org>)\n\tfor <kbingham@ideasonboard.com>; Wed, 13 Oct 2021 14:23:20 +0200", "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[IPv6:2001:4b98:dc0:43:216:3eff:fe33:f827])\tby\n\tperceval.ideasonboard.com (Postfix) with ESMTPS id E9F03291;\n\tWed, 13 Oct 2021 14:23:19 +0200 (CEST)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7799368F4F;\n\tWed, 13 Oct 2021 14:23:19 +0200 (CEST)", "from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6265260501\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Oct 2021 14:23:17 +0200 (CEST)", "by mail-wr1-x432.google.com with SMTP id g25so7789828wrb.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Oct 2021 05:23:17 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:a13d:95a9:c25e:7597])\n\tby smtp.gmail.com with ESMTPSA id\n\tv3sm13412961wrg.23.2021.10.13.05.23.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 13 Oct 2021 05:23:16 -0700 (PDT)" ], "Authentication-Results": [ "perceval.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"CunA1Eg1\"; dkim-atps=neutral", "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature\n\tverification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com header.b=\"CunA1Eg1\";\tdkim-atps=neutral" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=rG8DW+6gx/1Sb+gw8D3PypjPmNytpF2ok91imMRQ66E=;\n\tb=CunA1Eg1cpF//dlMjRLYO+qsYesVdJMkiI5SNLaE6x6beuyzcG2vGB3I1jB/P6cH3T\n\t5IVxnFqBa4MBP4KdhBcZLXnUoL9cxHZCLj6v0h06H2c6aYAPLcQf8fXyz0Pi6UPTHwii\n\t+kUQIAw//f1EthOQe15maktLr/ASxWpODSZKdB2iTeduDFRg2PGTC7UfTsKxy5pz4V6W\n\tfxRAsk6LpU6+Nzw7lhBkQus7UmR+epeqrjzs4Z4pKQdZ6+fOMm/+qFjE86e71kpLHZ0b\n\tvplnIxDUFV9DBY/rkETBP5ORDWZYwtGuaAmfQyZEqTCAoGmgtWClXVlc7ikZpx3C/oGl\n\tD/Zg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=rG8DW+6gx/1Sb+gw8D3PypjPmNytpF2ok91imMRQ66E=;\n\tb=AC6nDL8+XoiIqX4LgghA4llyVd0vP2gsJU2hzpJNOhDeMwZlX7bFSGKAHiNH50fi44\n\tIzmElxChLavOwIisymn+kJYZf5f7gvSMIPUEluYYeIznqROrEnnw/Vb9vJOaTCXHrCzW\n\t10dMentSypsAHJFCDi5fMNRmHmXXvuDrJh3VgYtxkQyzMg8tKnAIR/FDTEaMD1IAUTYr\n\tJBu+DBjVPmTsLzmpm+KHJvVVqC9ksOs8onZdULCn39T5uR2PJ8CVR3nyixJixAoqcSVN\n\tR/2/bBCrvLRmpW0Xi4z+sHSZqrisK3DcngDjm/BDqJNj4mqq5GTS+mItSZGTLYJoSTP8\n\tBCAg==", "X-Gm-Message-State": "AOAM530myWdiNNNovfOvuhKbutLNHSAegsnbjz3ViGoczdHozNBuKs6R\n\tx0jY3YFPIwabLBKi3i+vsjNcZJSrjOFnnQ==", "X-Google-Smtp-Source": "=?utf-8?q?ABdhPJwEJRaPlVW23wl88ZrbufhMrrYqYBz+A6BXO?=\n\t=?utf-8?q?mh3L6139DPSiHYLZV+bpZDA/C45zDiwNOyD5A=3D=3D?=", "X-Received": "by 2002:a7b:cbd1:: with SMTP id\n\tn17mr12328007wmi.113.1634127796821;\n\tWed, 13 Oct 2021 05:23:16 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 13 Oct 2021 13:23:12 +0100", "Message-Id": "<20211013122312.1943362-2-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211013122312.1943362-1-naush@raspberrypi.com>", "References": "<20211013122312.1943362-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 1/1] build: Preserve upstream git\n\tversioning using meson dist", "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>", "X-TUID": "mjMEtvGjIS1s", "Resent-From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "Resent-To": "parsemail@patchwork.libcamera.org" }, "content": "When distributions build and package libcamera libraries, they may not\nnecessarily run the build in the upstream source tree. In these cases, the git\nSHA1 versioning information will be lost.\n\nThis change addresses that problem by requiring package managers to run\n'meson dist' to create a tarball of the source files and build from there.\nOn runing 'meson dist', the utils/run-dist.sh script will create a version.gen\nfile in the release tarball with the version string generated from the existing\nutils/gen-version.sh script.\n\nThe utils/gen-version.sh script has been updated to check for the presence of\nthis version.gen file and read the version string from it instead of creating\none.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n meson.build | 3 +++\n src/libcamera/meson.build | 11 +++++------\n utils/gen-version.sh | 9 +++++++++\n utils/run-dist.sh | 11 +++++++++++\n 4 files changed, 28 insertions(+), 6 deletions(-)\n create mode 100644 utils/run-dist.sh", "diff": "diff --git a/meson.build b/meson.build\nindex a49c484fe64e..85ca0013733e 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -24,6 +24,9 @@ endif\n \n libcamera_version = libcamera_git_version.split('+')[0]\n \n+# This script gererates the version.gen file on a 'meson dist' command.\n+meson.add_dist_script('utils/run-dist.sh')\n+\n # Configure the build environment.\n cc = meson.get_compiler('c')\n cxx = meson.get_compiler('cpp')\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 243dd3c180eb..360eaf80ecf1 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -93,12 +93,11 @@ endforeach\n \n libcamera_sources += control_sources\n \n-gen_version = meson.source_root() / 'utils' / 'gen-version.sh'\n-\n-version_cpp = vcs_tag(command : [gen_version, meson.build_root()],\n- input : 'version.cpp.in',\n- output : 'version.cpp',\n- fallback : meson.project_version())\n+version_data = configuration_data()\n+version_data.set('VCS_TAG', libcamera_git_version)\n+version_cpp = configure_file(input : 'version.cpp.in',\n+ output : 'version.cpp',\n+ configuration : version_data)\n \n libcamera_sources += version_cpp\n \ndiff --git a/utils/gen-version.sh b/utils/gen-version.sh\nindex b09ad495f86a..09cede84c25e 100755\n--- a/utils/gen-version.sh\n+++ b/utils/gen-version.sh\n@@ -5,6 +5,15 @@\n \n build_dir=\"$1\"\n \n+# If version.gen exists, output the version string from the file and exit.\n+# This file is auto-generated on a 'meson dist' command from the run-dist.sh\n+# script.\n+if [ -f \"${MESON_SOURCE_ROOT}\"/version.gen ]\n+then\n+\tcat \"${MESON_SOURCE_ROOT}\"/version.gen\n+\texit 0\n+fi\n+\n # Bail out if the directory isn't under git control\n src_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n src_dir=$(readlink -f \"$src_dir/..\")\ndiff --git a/utils/run-dist.sh b/utils/run-dist.sh\nnew file mode 100644\nindex 000000000000..3b6c0adb05ed\n--- /dev/null\n+++ b/utils/run-dist.sh\n@@ -0,0 +1,11 @@\n+#!/bin/sh\n+\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# On a meson dist run, generate the version string and store it in a file.\n+# This will later be picked up by the utils/gen-version.sh script and used\n+# instead of re-generating it. This way, if we are not building in the upstream\n+# git source tree, the upstream version information will be preserved.\n+\n+cd \"$MESON_SOURCE_ROOT\" || return\n+./utils/gen-version.sh > \"$MESON_DIST_ROOT\"/version.gen\n", "prefixes": [ "libcamera-devel", "v2", "1/1" ] }