From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E494A45AB0; Fri, 4 Oct 2024 22:59:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D22E14329A; Fri, 4 Oct 2024 22:59:54 +0200 (CEST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id C9E3A402EB for ; Fri, 4 Oct 2024 22:59:52 +0200 (CEST) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-71b0d9535c0so1868053b3a.2 for ; Fri, 04 Oct 2024 13:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728075592; x=1728680392; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=0/DxzdiunUfUHDn2E/2gIedeRWzjQzomm+581a2FsEE=; b=avEavf0p+kDosUR8SxeBirvN7Iwr7jFGyslqiEQ7S00aaNhWHqWkCZG/i2Gv5M3Kdb yzJG21WNXHqlUlPA4XiW6mpKeHqux+wM1kkqCjLGybHuq5P4onETaAOFKYfvE+51FJIT IymSWJ6dUJY0iMDJRnlT9yw0EwzxWCCigOAFElRJmAQEBiF5S7NDsLMk4eKHIuy4HxaH 3bleJnIjgeJ1/LYU/Mrz9bYmfdyj8inUDhuJf0LKJHUHTktlQFQ1wzQyZdLNKjg0+Cj/ aCbqiRRDs5i8mYWscIqdeQyIRi8T7U4DU1viTuILsov/U6Agb5T7L2pgfLUR8usBmtLd pDGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728075592; x=1728680392; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0/DxzdiunUfUHDn2E/2gIedeRWzjQzomm+581a2FsEE=; b=bImaBcwIgDm6q/G0XnRofPPyKT93x+0BDJYqsXeRxV1smsCfLwV5O4gHPhiqbpqq+V OriflhbrnlO8UJxUprPtKQtkXPsKMtEFc+JURUQFIYHB15q5BtfGNwKJ5piwI6ZW/BWj E05e++R3/3x5rhtdtQXvA2Ouj/j3xiLC9WD6aSN8CC6uE9xNQGmP4iIz9Vx/ttN7EfgJ NApZCfmIauoPKPo3AerO2mCI/P/mO0o4UUXMM16YVXXyqXGoGELOrpEihBq80aJZ3Qw4 YMkOsSxKScMze7r2SrWlhyym9ljKs5MPooEBE0o45Vuu5kkghZvFTQxghsm6u+zdsWSP qUag== X-Forwarded-Encrypted: i=1; AJvYcCXFA/7ZOy9Jj47+AKKXtMoSO3olgZLjO0JTs3VOHRecTyKzDkgK8BLi3iqrLNFCmPmx2eY=@dpdk.org X-Gm-Message-State: AOJu0Yy8ZLPiENgNfNYr3DztO8IcyKkUoynH3iWLx02wuDecmHlM2j2l LTKuZ3BX8rSgDK229Sc932juTv/kbL+Zu4g5aTMJRHDTcdOTH4iDTwUhBAC89dkPm0Me4ZJHTWa JMBtOBA== X-Google-Smtp-Source: AGHT+IEcCikbk92+bs1x6yQ9DCSZPY+wIAEaodjnqP4+CwKy0moGHCoRPxtHLKCE7xlRVLKfZ+eQIQ== X-Received: by 2002:a05:6a00:1793:b0:717:8eb7:6c57 with SMTP id d2e1a72fcca58-71de244544emr7408483b3a.19.1728075591874; Fri, 04 Oct 2024 13:59:51 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0d4663csm300181b3a.106.2024.10.04.13.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 13:59:51 -0700 (PDT) Date: Fri, 4 Oct 2024 13:59:48 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: Morten =?UTF-8?B?QnLDuHJ1cA==?= , Subject: Re: [PATCH v3 3/3] build: RFC - add support for optional dependencies Message-ID: <20241004135948.590b6744@hermes.local> In-Reply-To: References: <20231103162830.593702-1-bruce.richardson@intel.com> <20231220142152.492556-1-bruce.richardson@intel.com> <20231220142152.492556-4-bruce.richardson@intel.com> <98CBD80474FA8B44BF855DF32C47DC35E9F0E8@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, 20 Dec 2023 15:43:36 +0000 Bruce Richardson wrote: > On Wed, Dec 20, 2023 at 04:08:08PM +0100, Morten Br=C3=B8rup wrote: > > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > Sent: Wednesday, 20 December 2023 15.22 > > >=20 > > > In order to remove more libraries from the mandatory list, we need to > > > have support for optionally having a dependency from a driver or > > > library > > > to another driver or lib. This patch adds this support by adding a new > > > optional_deps variable, the contents of which are added to the deps > > > list > > > if those optional dependencies are present in the build. > > >=20 > > > Signed-off-by: Bruce Richardson > > > --- > > > drivers/meson.build | 7 +++++++ > > > lib/meson.build | 7 +++++++ > > > 2 files changed, 14 insertions(+) > > >=20 > > > diff --git a/drivers/meson.build b/drivers/meson.build > > > index 5ba534049a..af2d8da5a8 100644 > > > --- a/drivers/meson.build > > > +++ b/drivers/meson.build > > > @@ -127,6 +127,7 @@ foreach subpath:subdirs > > > includes =3D [include_directories(drv_path)] > > > # set up internal deps. Drivers can append/override as > > > necessary > > > deps =3D std_deps > > > + optional_deps =3D [] =20 > >=20 > > (I'm a meson noob, so please bear with my stupid questions.) > >=20 > > Is a separate "optional_deps" necessary? If a driver has any of these d= ependencies, why can it not just add them to the "deps" in the driver's mes= on.build file? > >=20 > > Ohhh... It's the other way around: The driver only depends on the other= (optional) lib if that other lib is enabled! Correct? > > =20 > Yes, it's a shortcut to save an app having to manually check for its > optional dependency itself in the meson.build file. >=20 > However, this is only really useful if it's an optional dependency where = we > just have #ifdefs in the C code for it. For the initial example I was > thinking of to try and use it - meter lib in ethdev - something that simp= le > is not enough. So long as there are extra C files or headers that need to > be built when a dependency is present, we need to change the meson.build > file to explicitly check anyway. Hence it's only an RFC until such time as > we find a use-case or two that uses it. Reasonable solution, but it hasn't been an issue for anything so far over a= year. Marking it as "Awaiting upstream" since if a feature needs this, then use t= his.