From patchwork Mon Oct 10 17:32:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 17574 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A53BFC3285 for ; Mon, 10 Oct 2022 17:33:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1A4B562D78; Mon, 10 Oct 2022 19:33:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665423205; bh=pitq57k3xQLLB3p0hzEY5XESU1yZjwMqr/stW6Su0iI=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=zYKVc62nNOdULaVOZOY/O7lilTDyF9Rn65w/xZFX8PzLqMVMiTSsbV0qU1dYL7QL1 pjQAm9dHCNnfF9NZARQggF57REQVTP5nDGyjaLXNwCvNWfaUbiJcQbyAKy84NThGot vxb92ioM0ohQhOplNG2HuRybzvX+/HgIlQZzZF7YQuSp2zkB3nwfAt7uTTgRQQLqTz 5joc/KKJvpYeAy/4u1PwBhBoEnJEO1QJvFQaczYxn6aM4OA+xXm+xV2FjPacJ6w0Eh U3GRuUUo9GJLCTTpHtBNVpmB1g4aTDBmdY8+MXq4BoLZlG0vMnxdRlc29CupsQH86u j5rThsfhlr9/g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C201F62D6B for ; Mon, 10 Oct 2022 19:33:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Dk/3nu9H"; dkim-atps=neutral Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C78EBB0; Mon, 10 Oct 2022 19:33:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665423203; bh=pitq57k3xQLLB3p0hzEY5XESU1yZjwMqr/stW6Su0iI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dk/3nu9H1V3Ebrg5xvPUozEtqSczbNtyEElkyRJAeVmWS1AxYZyuR/4QW+aq658yj R6p2859vEXkSUL86lRQsDa+J1dVOURfHFzkXULu4P1vL5lrvvQ8QuOu/qbkuaT2btj 3rauhbYK1FQfyb+/8gzgFc6TwzHk3K7TxdMyPZIs= To: libcamera devel Date: Mon, 10 Oct 2022 18:32:11 +0100 Message-Id: <20221010173214.3547133-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221010173214.3547133-1-kieran.bingham@ideasonboard.com> References: <20221010173214.3547133-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/5] meson: Shared Object version handling X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The libcamera project is not yet ready to declare ABI nor API stability, but it will benefit the community to be able to provide more regular release cycles to determine 'versioned' points of history. Ideally, these releases will be made at any ABI breakage, but can be made at arbitary time based points along the way. To support releases which may not be ABI stable, declare the soversion of both the libcamera and libcamera-base library to be dependant upon both the major and minor component of the project version. As part of this, introduce a new 'Versions' summary section to highlight the different version components that may become apparent within any given build. Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- v3: - fix typo - Use libcamera_version directly for SONAME. - Fix ordering of EXCLUDE_PATTERNS - Use meson.project_version() in the event the git versions are incorrect. - No need to present libcamera_version anymore - Guaranteed to be the same as 'project_version' Signed-off-by: Kieran Bingham --- Documentation/Doxyfile.in | 4 +++- meson.build | 23 +++++++++++++++++++++++ src/libcamera/base/meson.build | 1 + src/libcamera/meson.build | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in index 88dfcddaebf6..e87bb2b42c5e 100644 --- a/Documentation/Doxyfile.in +++ b/Documentation/Doxyfile.in @@ -51,7 +51,9 @@ EXCLUDE_PATTERNS = @TOP_BUILDDIR@/include/libcamera/ipa/*_serializer.h \ @TOP_BUILDDIR@/include/libcamera/ipa/ipu3_*.h \ @TOP_BUILDDIR@/include/libcamera/ipa/raspberrypi_*.h \ @TOP_BUILDDIR@/include/libcamera/ipa/rkisp1_*.h \ - @TOP_BUILDDIR@/include/libcamera/ipa/vimc_*.h + @TOP_BUILDDIR@/include/libcamera/ipa/vimc_*.h \ + @TOP_BUILDDIR@/src/libcamera/libcamera.so* \ + @TOP_BUILDDIR@/src/libcamera/base/libcamera-base.so* EXCLUDE_SYMBOLS = libcamera::BoundMethodArgs \ libcamera::BoundMethodBase \ diff --git a/meson.build b/meson.build index 2c6173b4f97e..3e2bcc0de2c3 100644 --- a/meson.build +++ b/meson.build @@ -26,6 +26,29 @@ endif libcamera_version = libcamera_git_version.split('+')[0] +# A shallow clone, or a clone without a reachable tag equivalent to the +# meson.project_version() could leave the project in a mis-described state. +# Produce a warning in this event, and fix to a best effort. +if libcamera_version != meson.project_version() + warning('The sources disagree about the version: ' + + libcamera_version + ' != ' + meson.project_version()) + + libcamera_version = meson.project_version() + libcamera_git_version = libcamera_version + '+' + libcamera_git_version.split('+')[1] + summary({'Source version override': true}, section : 'Versions') +endif + +# Until we make ABI compatible releases, the full libcamera version is used as +# the soname. +libcamera_soversion = libcamera_version + +summary({ + 'project': meson.project_version(), + 'sources': libcamera_git_version, + 'soname': libcamera_soversion, + }, + section : 'Versions') + # This script generates the .tarball-version file on a 'meson dist' command. meson.add_dist_script('utils/run-dist.sh') diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build index 7a75914ab2a8..7a7fd7e4ca87 100644 --- a/src/libcamera/base/meson.build +++ b/src/libcamera/base/meson.build @@ -51,6 +51,7 @@ libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ] libcamera_base_lib = shared_library('libcamera-base', [libcamera_base_sources, libcamera_base_headers], version : libcamera_version, + soversion : libcamera_soversion, name_prefix : '', install : true, cpp_args : libcamera_base_args, diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 7fcbb2ddc9e7..5f39d2e2c60a 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -161,6 +161,7 @@ libcamera_deps = [ libcamera = shared_library('libcamera', libcamera_sources, version : libcamera_version, + soversion : libcamera_soversion, name_prefix : '', install : true, include_directories : includes,