Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[keyple-dev] Keyple C++ dependencies
  • From: Charles HUET <charles.huet@xxxxxxxxxxxxxxxx>
  • Date: Thu, 1 Dec 2022 08:11:12 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ixxitechside.com; dmarc=pass action=none header.from=ixxitechside.com; dkim=pass header.d=ixxitechside.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tHkOl05kEE1WSknYkdlISDmbjRl4KEFuaQ0rlZnqgfQ=; b=BjfNcv2nI3m+Ez1MYc3wvE1SkCPsfxn5qrc/DhoI+hcMVkchyU4NQa/vZYGpXqFFmOTwmoJeVKEwjWJZLJXE3WSRRmV5fLZs/YFjCLeJahdN2mg/vlJmBNTT0Lyso6dJVB9Ykp6lgXVhk++k+v72pUObXUFTM9jYDyV/JO3nxtpM3Z/oeIu9LbxE/gAbzXuAeCngNrybjYtDuR5FooSrsqeAzbfJwroqBZ14Em8Oe2sZXWx3JT8lzx6uioLTwAkHldZbHR0NqdTXPvDukmWKkGv3GkC/Y2XQPmRTOzbrFbMYztGd2tjVEJwJyn29ul4TkT7x3/s0HTLP/6bVoGwkJQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aJ1/UZG7WyD0AP9IjNGaxQ5As38sJFFDgvIAr9cWrS8zyUG9PJKUwZyl7zfxiRW7iqbZQ5X9D1rpREAhe3YQEZgs5vmxOQuFk5e8tk2S4T2IKobSL5d+cRCtw4/PLM9q+zGz+yV51feW1jz5KXNGWKtWRtjD5sAnKzTa7ZreRQtOtKAb2zYsKxSESW18JZOcOrTrpE7ssTa5UGziItwaxT+IMtnPmpQ0Aldc7lOAkpT4EmvuEWOnjMdbJ453z9Gfwhms+OlVAcKxpLsBUpK+LOQqYYdJeilJW+/bpRx3uiaMiM8Hy4sgPF8+fTLWCwh2H3hM5lBIvnofQjmZyClWKA==
  • Delivered-to: keyple-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/keyple-dev/>
  • List-help: <mailto:keyple-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/keyple-dev>, <mailto:keyple-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/keyple-dev>, <mailto:keyple-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels:
  • Thread-index: AQHZBMmrI6AWWF8CPECl74WFyYF0PQ==
  • Thread-topic: Keyple C++ dependencies

Hi,

As some of you may know, I have been contributing small improvements to the keyple C++ codebase, most notably on the build system side of things.

I want to talk about the general direction and goal of the CMake files, to ensure I can contribute in the most efficient way to the Keyple C++ project, and make a proposition about where it should head, in my opinion.



Since the current best way to retrieve all of keyple C++ is to use the cpp-meta repository, which is currently unable to differentiate versions for the different components, it is difficult to upgrade a single part of keyple.

Ideally, cloning the demos repository should be enough to get a simple build started, with an automatic and transparent dependency management (i.e. the demos would declare their dependencies and version, and those would be fetched transparently to the user).

Since C++ inherently  differs from Java, specifying different versions for a single dependency (e.g. Keyple Utils library) can cause issues depending on the linkage type and binary compatibility.

For instance if keyplecardgenericcpplib​ and UseCase4_ScheduledSelection were to link dynamically ​to binary compatible but differently versions of keypleutilcpplib​, only one version would be used in the final executable due to symbol name collision. This could potentially cause issues if keyplecardgenericcpplib​​ was depending on a different behavior from keypleutilcpplib​ than the one UseCase4_ScheduledSelection is expecting (e.g. a function was modified to return a different value in a certain case).

This also raises the issue of binary compatibility, but I will assume semantic versioning is well used, and the rules to keep C++ code binary compatible weel understood 🙂

To ensure correct behavior, either static linking should be preferred, or a stricter dependency management put into place, with a reliance on transitive dependencies.

Both have benefits, but changing the linking type is something that can be easily modified by the end user, while modifying the dependency management would have beneficial results on the potential contributors to Keyple C++.

To conclude, I propose modifying the Keyple C++ buildsystem to:
  • use transitive dependencies
  • explicitly link against dependencies (i.e. when including a file from another library, link against it)
  • fetch keyple dependencies instead of expecting them to be present
This can be done in multiple phases :
  1. modernize the CMake to exclusively use targets
  2. ensure there are independent builds of each component, to ensure each component declares its dependencies correctly
  3. check that there are no redundant links, once every target correctly declares its dependencies
  4. fetch the dependencies of each target in its CMakeLists

I have started on phase 1, but my PRs have been waiting for quite some time now, so I will list them here:

Back to the top