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 7A08742D22; Thu, 22 Jun 2023 10:49:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4813640EE1; Thu, 22 Jun 2023 10:49:25 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 91851406B8 for ; Thu, 22 Jun 2023 10:49:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687423763; x=1718959763; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=7+EOamteyXdfYldfoBBt8SUbvXEO7Wq1V4gpx+Nl2j4=; b=YndWAI2vknnry2VhOibVbvdRj3Y5DcDI2R+MOXTmMj6H8ru1NpkDFRVA O6tmvDnR8J9ktUyLsqVvhcnN26M2M01ceJmONWaSZ5meqgcWYmFEupQ4Y hcYhzqFfARq2VP2BgRojPvO95LkdJoppcrSpDJC7N2R6TmWKjPADEHAG4 6x300oxrdf0ob5ss1Hhf7rgIqtcQxqcDI9gCymtksAv6puBo6uLkMt0kM xP9fDD+Nt46J4GHZ/s+BrExl72kLmp7sPC/Xs+6RmwwrtUQRD6N6exypl PRdKbxiidMJfbp3F+UIbk9uScY/3z09QnpPo0Phz10qYIgsaYfGhpaEDW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10748"; a="426382217" X-IronPort-AV: E=Sophos;i="6.00,263,1681196400"; d="scan'208";a="426382217" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2023 01:49:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10748"; a="714812219" X-IronPort-AV: E=Sophos;i="6.00,263,1681196400"; d="scan'208";a="714812219" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP; 22 Jun 2023 01:49:21 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 22 Jun 2023 01:49:21 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 22 Jun 2023 01:49:20 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 01:49:20 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Thu, 22 Jun 2023 01:49:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S9znV24FHS64Mxns7OjxXf/DicTgSZxD83hxSkZg7xya38XhJDNkKIeIHoPD35AsWXYse2V2Mw2qeW8TxyGExylrT4nIkuVkhv7aknySBPtlx3JjudcNKHAAT6UyOJowd80GatEbEcf12u96xI/E8t++qH20lSQX4MoIjnx52YmX4RAThwF6Yc3QnunkortBdwmUM2OwC7IrsVrRyO1gpzsBAHgKjU5mJ595t2W7FOZGrG/4GM6S33KNmsc1USI36MXtZyw6iCcOYFyW3D4FA+RIQc5UunIOQ402P3Dpu1deCBFhXtpQbL7DWSAvmf3/aVL2xJJg45VB7A45cVWRTg== 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=USJvYdw8aiyOWqpun5yL98Dm3Qf6lVXh7eCMmFj9SI4=; b=RIj6qMyIEKiSnpI1EGOma6LUwFx3A/WBhmm3+iPMkwU6rDXZRrytQNcojdo1l/Z6kAS9AXHTwqApoSvQkwChRixP4PH7zSpBYixTRnuL4nCggZ3e9JLbCOwPXYNEVMpAm86SYVq7lXI6MOZuNfWzDJAMjIf8FbT+n3nXt3aSvQODY8Ayj+ALw8/L4X2u+YgHhShCSYaXg4Yut8qNDfW9pQxyCezYmiuzmzEwcyO12eozFsaNgBITM4eyKCUZElLlj35wJbQ3K7Z+cRNGARGszqL6z5quGdd5qUF8M91gbEWwDCm4vAKWMTrJuE6edw1t9Pxpv7b4b3RIGUTG3bEXlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by IA0PR11MB8377.namprd11.prod.outlook.com (2603:10b6:208:487::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Thu, 22 Jun 2023 08:49:12 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::b8f3:958:d2c5:2232]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::b8f3:958:d2c5:2232%3]) with mapi id 15.20.6521.024; Thu, 22 Jun 2023 08:49:11 +0000 Date: Thu, 22 Jun 2023 09:49:00 +0100 From: Bruce Richardson To: David Marchand CC: , , , , , , Subject: Re: [PATCH v4 4/4] build: select optional libraries Message-ID: References: <20211117112847.7362-6-david.marchand@redhat.com> <20230621170058.2740340-1-david.marchand@redhat.com> <20230621170058.2740340-5-david.marchand@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230621170058.2740340-5-david.marchand@redhat.com> X-ClientProxiedBy: DUZPR01CA0064.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c2::17) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|IA0PR11MB8377:EE_ X-MS-Office365-Filtering-Correlation-Id: cc152085-7571-4948-9dc7-08db72fd89a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gvN4nAEz4r0ihv8Vm9jkq2FdHX5elt6W5L3gTd/hgckhk/STwAeT4zFEw/gW/Jty6GUi14hGN+gvWbhuzvB8e7MacVKDZ6bWi5At4FjOUfwy87cI/Jr7iljiciOuIBm2Ss9tYBDPmO60dZmvEQuInEsHZ1T9QsP5Qwlid0/bDU6VJgn/O+4UF+5YJ+wD5P6sBdbQSabMELRTjkUuiYm/oDhaFpDILTD+z2UGubr5B8cXVwzQN7bkY44Z9pqSZ/0XRWTBFfL8+HTZCwYVA6skkoySUkJ7pNnRTc2yBE7NMTvdeIQATD5m878zIPQyWlBA/uj8sKdKVAuQAR6YNFXHUcb7ev8SOZd1KQ0/On+yXl1cxeRu2A0aEQkAj1pZBb0u7xPIZxYd4repz1HoFXeYoXD1kOyIrn+fXddNalCJ5X12CXHbbkxg/3UAlNRmIpouiHzbPGXZqZZ4LNFn06h+W8T3cCUqZEVupnaS9u6WqTyrpwr4C9ktyyfmQNxCecB44GgdFPWyt4WApU4d4YXZ5hdee3wSkcEm/i5EOtNXosp1ozcUUCp0KsNuQb03PgQ7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(39860400002)(376002)(136003)(366004)(346002)(451199021)(6486002)(6666004)(478600001)(83380400001)(82960400001)(86362001)(2906002)(26005)(186003)(6506007)(6512007)(6916009)(4326008)(66556008)(66476007)(66946007)(8936002)(38100700002)(316002)(41300700001)(8676002)(5660300002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?wVSRfrR24k1xqALH+EknsDFEDV3gPRDFxx/nK8uRii92xwr+JM/+4Vulk9WV?= =?us-ascii?Q?RyzhKe5fox0cqJ/bHpZzf7+VACvFHQPbDv7LiUOrmd++l09asrSSWRJjTvFe?= =?us-ascii?Q?YZuqXIdU/B/j8C45kvYKeL+6kOttNxBHGlYz4iCM92/me89MFDD89SOfdkSO?= =?us-ascii?Q?kZJRlU0Bhqgk5/sOxzwh8afq9RC+8K2sdnIKwHwqeGRxd76MHtj+FHKu2mP+?= =?us-ascii?Q?D73NJbZIGKIr3QipFwnFZeZUvbpEFHBiAVIG9Wz1Q/0y+Zuex4WeqNdyeRQH?= =?us-ascii?Q?PendeZpuAJqulaoItIFLEP2gdC6PtzO9SZO5pAJWbdSqZSM65dlEtnxinMTh?= =?us-ascii?Q?FO726kPbPY6Wc1nh1lQzX9kiNrOFaskPBgi6z2GnWSRtRfjzfMl1egbJkVtV?= =?us-ascii?Q?tUItp0z16lo5m6K+O5Pe0OkvZRt7djqMTeBiNK2WjSw9FwAkDyj4fLvVmgcM?= =?us-ascii?Q?QRxNA8o0m2srLZMKpEMrTFwOC14obmSNcAG4I1R+yMnyarONYKQ/xIhjt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/sX4g0F+0geJZtlWg+tLLwjbIIwfqpVg?= =?us-ascii?Q?VIVA7aLQ274TcSX4RLLrcPpCTK7gMNbuBHLx9QYPYAHRMiFmf8E1BvGUHd2f?= =?us-ascii?Q?WDPGLZQgWBQ0/tu268WfCE73QwhBqCdkiWlOv6JJJlT+wh8X1i+dDpiuCOt5?= =?us-ascii?Q?/K/JI2BFwpHDDQ0LI49gBC9uWvZlayTkXK2blDPqbxKuwVs04eHwJ4ztscIX?= =?us-ascii?Q?qA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: cc152085-7571-4948-9dc7-08db72fd89a2 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 08:49:11.6240 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6eltjYXDanbOp2nFE+198MX1Y9zhW6RCHuEFVVJvOcbx5/iVFArGrig5ENzj+jMr+Mj34UjhzAYowDuI+JX7Vz6JWqiP1tpGAYZsv1f33Vo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB8377 X-OriginatorOrg: intel.com 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, Jun 21, 2023 at 07:00:58PM +0200, David Marchand wrote: > There is currently no way to know which libraries are optional. > Introduce a enable_libs option (close to what we have for drivers) so > that packagers or projects consuming DPDK can more easily select the > optional libraries that matter to them and disable other optional > libraries. > > Signed-off-by: David Marchand > --- LGTM - one minor suggestion inline below. Acked-by: Bruce Richardson > Changes since v3: > - split non related cleanup changes, > - fixed false positive complaints about disabling mandatory libs by > building the list of always enabled libs, appending this list to > enable_list and checking the disable side, > - updated enable/disable_libs descriptions, > > Changes since v2: > - moved the IOVA check for kni build in lib/kni/meson.build, > - reworked deprecated libraries handling by only considering them when > no enable_libs option is set. With this, no need for a default value > in meson_options.txt, yet configurations in the CI must be adjusted, > - moved mandatory libraries check after enable/disable_libs evaluation, > > --- > lib/meson.build | 33 +++++++++++++++++++++++---------- > meson_options.txt | 4 +++- > 2 files changed, 26 insertions(+), 11 deletions(-) > > diff --git a/lib/meson.build b/lib/meson.build > index a6e9e19b42..407769b270 100644 > --- a/lib/meson.build > +++ b/lib/meson.build > @@ -92,17 +92,20 @@ dpdk_libs_deprecated += [ > 'kni', > ] > > -disabled_libs = [] > -opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'), > - check: true).stdout().split() > -foreach l:opt_disabled_libs > +disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split() > + > +enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split() > +if enable_libs.length() == 0 > + enable_libs += optional_libs > +endif > + > +always_enable = [] > +foreach l:libraries > if not optional_libs.contains(l) > - warning('Cannot disable mandatory library "@0@"'.format(l)) > - continue > + always_enable += l > endif > - disabled_libs += l > endforeach Minor nit, I'd actually put this block further up the file just after the optional_libs list. It's more an array definition, and moving it up puts the next line (below) to add to enable_libs immediately after the other assignments to enable_libs. > - > +enable_libs += always_enable > > default_cflags = machine_args > default_cflags += ['-DALLOW_EXPERIMENTAL_API'] > @@ -139,12 +142,22 @@ foreach l:libraries > if dpdk_libs_deprecated.contains(l) and not get_option('enable_deprecated_libs') > build = false > reason = 'deprecated libraries disabled via build config' > - elif disabled_libs.contains(l) > + elif not enable_libs.contains(l) > build = false > - reason = 'explicitly disabled via build config' > + reason = 'not in enabled libraries build config' > if dpdk_libs_deprecated.contains(l) > reason += ' (deprecated lib)' > endif > + elif disable_libs.contains(l) > + if always_enable.contains(l) > + warning('Cannot disable mandatory library "@0@"'.format(l)) > + else > + build = false > + reason = 'explicitly disabled via build config' > + if dpdk_libs_deprecated.contains(l) > + reason += ' (deprecated lib)' > + endif > + endif > endif > > if build > diff --git a/meson_options.txt b/meson_options.txt > index f959015e46..9951563146 100644 > --- a/meson_options.txt > +++ b/meson_options.txt > @@ -11,7 +11,7 @@ option('disable_apps', type: 'string', value: '', description: > option('disable_drivers', type: 'string', value: '', description: > 'Comma-separated list of drivers to explicitly disable.') > option('disable_libs', type: 'string', value: '', description: > - 'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]') > + 'Comma-separated list of optional libraries to explicitly disable. [NOTE: mandatory libs cannot be disabled]') > option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-', description: > 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.') > option('enable_docs', type: 'boolean', value: false, description: > @@ -26,6 +26,8 @@ option('enable_driver_sdk', type: 'boolean', value: false, description: > 'Install headers to build drivers.') > option('enable_kmods', type: 'boolean', value: false, description: > 'build kernel modules') > +option('enable_libs', type: 'string', value: '', description: > + 'Comma-separated list of optional libraries to explicitly enable. [NOTE: mandatory libs are always enabled]') > option('examples', type: 'string', value: '', description: > 'Comma-separated list of examples to build by default') > option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', description: > -- > 2.40.1 >