[{"id":25414,"web_url":"https://patchwork.libcamera.org/comment/25414/","msgid":"<Y0fmZ2aHC689uCu6@pendragon.ideasonboard.com>","date":"2022-10-13T10:20:23","subject":"Re: [libcamera-devel] [PATCH v4 1/3] meson: Shared Object version\n\thandling","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Oct 13, 2022 at 10:59:55AM +0100, Kieran Bingham wrote:\n> The libcamera project is not yet ready to declare ABI nor API stability,\n> but it will benefit the community to be able to provide more regular\n> release cycles to determine 'versioned' points of history.\n> \n> Ideally, these releases will be made at any ABI breakage, but can be\n> made at arbitary time based points along the way.\n> \n> To support releases which may not be ABI stable, declare the soversion\n> of both the libcamera and libcamera-base library to be dependant upon\n> both the major minor and patch component of the project version.\n> \n> As part of this, introduce a new 'Versions' summary section to highlight\n> the different version components that may become apparent within any\n> given build.\n\nLet's also document why EXCLUDE_SYMLINKS is added:\n\nBumping versions may leave dangling libcamera.so.* symlinks in build\ndirectories. This will confuse Doxygen which will print during its\ndirectory scanning phase a warning that the symlink can't be read. As we\ndon't need Doxygen to follow symlinks, disable it with EXCLUDE_SYMLINKS.\n\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> \n> v4:\n>  - Use EXCLUDE_SYMLINKS\n>  - Reduce redundant information from Versions summary\n>  - -nvm appended when the sources do not match the project version.\n>  - Fixed the update of the libcamera source version from the project\n>    version in event of mismatch\n> \n> v3:\n>  - fix typo\n>  - Use libcamera_version directly for SONAME.\n>  - Fix ordering of EXCLUDE_PATTERNS\n>  - Use meson.project_version() in the event the git versions\n>    are incorrect.\n>  - No need to present libcamera_version anymore\n>    - Guaranteed to be the same as 'project_version'\n> \n>  Documentation/Doxyfile.in      |  2 ++\n>  meson.build                    | 32 ++++++++++++++++++++++++++++++++\n>  src/libcamera/base/meson.build |  1 +\n>  src/libcamera/meson.build      |  1 +\n>  4 files changed, 36 insertions(+)\n> \n> diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in\n> index 88dfcddaebf6..e4f0cd426d39 100644\n> --- a/Documentation/Doxyfile.in\n> +++ b/Documentation/Doxyfile.in\n> @@ -66,6 +66,8 @@ EXCLUDE_SYMBOLS        = libcamera::BoundMethodArgs \\\n>                           *::details \\\n>                           std::*\n>  \n> +EXCLUDE_SYMLINKS       = YES\n> +\n>  HTML_OUTPUT            = api-html\n>  \n>  GENERATE_LATEX         = NO\n> diff --git a/meson.build b/meson.build\n> index 2c6173b4f97e..9b0966cb04c9 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -26,6 +26,38 @@ endif\n>  \n>  libcamera_version = libcamera_git_version.split('+')[0]\n>  \n> +# A shallow clone, or a clone without a reachable tag equivalent to the\n> +# meson.project_version() could leave the project in a mis-described state.\n> +# Produce a warning in this event, and fix to a best effort.\n> +if libcamera_version != meson.project_version()\n> +    warning('The sources disagree about the version: '\n> +            + libcamera_version + ' != ' + meson.project_version())\n> +\n> +    summary({'libcamera git version' : libcamera_git_version,\n> +             'Source version match' : false,\n> +            },\n> +            bool_yn : true, section : 'Versions')\n> +\n> +    libcamera_git_version = libcamera_git_version.replace(libcamera_version,\n> +                                                          meson.project_version())\n> +    libcamera_version = meson.project_version()\n> +\n> +    # Append a marker to show we have modified this version string\n> +    libcamera_git_version += '-nvm'\n> +endif\n> +\n> +# Until we make ABI compatible releases, the full libcamera version is used as\n> +# the soname. No ABI/API compatibility is guaranteed between releases. (x.x.x)\n\ns/. (x.x.x)/(x.x.x)./ ?\n\nYou could also write x.y.z.\n\nSame below.\n\n> +#\n> +# When automatic ABI based detection is used to increment the version, this\n\ns/is used/will be used/\n\nOther than this, this looks good to me.\n\n> +# will bump the minor number. (x.x)\n> +#\n> +# When we declare a stable ABI/API we will provide a 1.0 release and the\n> +# soversion at that point will be the 'major' release value. (x)\n> +libcamera_soversion = libcamera_version\n> +\n> +summary({ 'Sources': libcamera_git_version, }, section : 'Versions')\n> +\n>  # This script generates the .tarball-version file on a 'meson dist' command.\n>  meson.add_dist_script('utils/run-dist.sh')\n>  \n> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> index 7a75914ab2a8..7a7fd7e4ca87 100644\n> --- a/src/libcamera/base/meson.build\n> +++ b/src/libcamera/base/meson.build\n> @@ -51,6 +51,7 @@ libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n>  libcamera_base_lib = shared_library('libcamera-base',\n>                                      [libcamera_base_sources, libcamera_base_headers],\n>                                      version : libcamera_version,\n> +                                    soversion : libcamera_soversion,\n>                                      name_prefix : '',\n>                                      install : true,\n>                                      cpp_args : libcamera_base_args,\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 7fcbb2ddc9e7..5f39d2e2c60a 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -161,6 +161,7 @@ libcamera_deps = [\n>  libcamera = shared_library('libcamera',\n>                             libcamera_sources,\n>                             version : libcamera_version,\n> +                           soversion : libcamera_soversion,\n>                             name_prefix : '',\n>                             install : true,\n>                             include_directories : includes,","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 DA8F3BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Oct 2022 10:20:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3775662DAA;\n\tThu, 13 Oct 2022 12:20:31 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2398D62D6B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Oct 2022 12:20:30 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6196B492;\n\tThu, 13 Oct 2022 12:20:29 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665656431;\n\tbh=WhPxqM0lU8OG+sXNgAlCn5Pdd/xKEMbkAUnwZiPHxOE=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=JvvdFDts0MAESb+OhYD6wTnTk1AJu5pfK2akvNYL+rFhnUXHu5YYGrKjrDhYXextK\n\ti9dv/zYd7DDohxRWKQfEckTy0PEFN1juuE9KUbD6tmoiZF9IsYj6yvlg+fsPVdYvnx\n\t1nsun7uAAqjma64FeXBta+KCImcP+1P/qtn9tbIZ6UMpBONKokzNKGQLylPt0fcd5D\n\tsN6u2cYvaVH2Fp0kvL3n+DDrCQ0C2pylgN4/9lSzqEsFfIIo/b5w85JVCT4MVcHS/6\n\tLJAF8CkZM7lUKOU2njiOMhIS2/Fm36Zxn1vlNkV1qFtnZxvbt3DPU6PHejvfTgzcOe\n\tBmk2vzxmNzUzg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665656429;\n\tbh=WhPxqM0lU8OG+sXNgAlCn5Pdd/xKEMbkAUnwZiPHxOE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Mf3TXqRVvYLU1m4HBecBXLo1N8t3ElESEnDSDiWfK96YEgQerSQegaAycu9j1PR94\n\tBR8bNseDCCAPtealKGYNXohYZuINKeYv9dkHoyhjW5EsXi0yaEPDtzq/lpfbj98AMc\n\titpsQYGVh//peOCSIwz0IiwBDAvfk2+vaaMaW4VA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Mf3TXqRV\"; dkim-atps=neutral","Date":"Thu, 13 Oct 2022 13:20:23 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<Y0fmZ2aHC689uCu6@pendragon.ideasonboard.com>","References":"<20221013095957.1642901-1-kieran.bingham@ideasonboard.com>\n\t<20221013095957.1642901-2-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221013095957.1642901-2-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 1/3] meson: Shared Object version\n\thandling","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]