From patchwork Fri Sep 1 14:23:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 131096 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB44A42278; Fri, 1 Sep 2023 16:23:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A685D4029B; Fri, 1 Sep 2023 16:23:43 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 2F1FE40285 for ; Fri, 1 Sep 2023 16:23:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693578222; x=1725114222; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QgjfzsTMOcSiOckYs0liWgiC8HNJ7shz+FZG37/RncY=; b=KPHAyJz0rlaWao8x7eYYkEtsYcJKuXsbAHf7azU/20WXJFKOOPFbULFK wcSsnzv46krHjy17kwLayV0jBsOPrqpPEbTT5upXC3mdx+EzImtBErqNR RdyjbK0xG77MgOeDp9dtaeQ8qSi8jlW7grmZzOACabK5s/xwW098XJP1F KCFS6hnDAkr/jnyaGPaQm39RG2ptSYSXu+1jvm471hBqmloqDOW78v78m 43uQVXmaAHg2M0kw77yYV3hjzrqOp3UqiTGHFoLfRHakI4F1W7e/9Sbni oTXFadTHK9xubn6MrLPoKFWxQCtfcw6zTGBouctaap1Vodu6DkkTgvnsq g==; X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="442624643" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="442624643" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:23:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="883199261" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="883199261" Received: from silpixa00401385.ir.intel.com ([10.237.214.152]) by fmsmga001.fm.intel.com with ESMTP; 01 Sep 2023 07:23:42 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH 1/2] build: fail if explicitly requested lib is unbuildable Date: Fri, 1 Sep 2023 15:23:31 +0100 Message-Id: <20230901142332.588856-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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 When the user passes a list of desired libraries to build via the "enable_libs" option, the expectation is that those libraries should be part of the build. However, if those libs have either external or internal dependencies, they still may be silently disabled, for example: running "meson setup -Denable_libs=security build" will successfully run, but the security lib will not be configured as "cryptodev" is missing. We can fix this by setting a flag to indicate when the libraries are specified via an enable_libs flag. If so, then we error out when a library is unbuildable, giving a suitable error message. For the above example case, the "meson setup" run fails with: Message: Disabling security [lib/security]: missing internal dependency "cryptodev" lib/meson.build:218:16: ERROR: Problem encountered: Cannot build explicitly requested lib "security". Please add missing dependency "cryptodev" to "enable_libs" option Signed-off-by: Bruce Richardson Acked-by: Morten Brørup Acked-by: David Marchand --- lib/meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/meson.build b/lib/meson.build index 099b0ed18a..cf4aa63630 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -131,7 +131,9 @@ endforeach 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() +require_libs = true if enable_libs.length() == 0 + require_libs = false enable_libs += optional_libs endif enable_libs += always_enable @@ -189,6 +191,10 @@ foreach l:libraries if build subdir(l) + if not build and require_libs + error('Cannot build explicitly requested lib "@0@".\n'.format(name) + +'\tReason: ' + reason) + endif endif if name != l warning('Library name, "@0@", and directory name, "@1@", do not match'.format(name, l)) @@ -208,6 +214,10 @@ foreach l:libraries endif message('Disabling @1@ [@2@]: missing internal dependency "@0@"' .format(d, name, 'lib/' + l)) + if require_libs + error('Cannot build explicitly requested lib "@0@".\n'.format(name) + + '\tPlease add missing dependency "@0@" to "enable_libs" option'.format(d)) + endif else shared_deps += [get_variable('shared_rte_' + d)] static_deps += [get_variable('static_rte_' + d)] From patchwork Fri Sep 1 14:23:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 131097 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4DE042278; Fri, 1 Sep 2023 16:23:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD3E04029D; Fri, 1 Sep 2023 16:23:54 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 4E7D340285 for ; Fri, 1 Sep 2023 16:23:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693578233; x=1725114233; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AA0hbd8vdftDlLNsZIa4/Qo6yZ4ig03/7FvAjm48A1s=; b=CJ5AIm7wYvPCmzKmtU/Qix/vlOAndUBtXwCQpYHm4kYfaNN1l95/9VAU jlC7j0Mt7Prbu3NGeuZqMbNGogYrpNN1SzfJfSE13lLo7iHkXBmTpJSgA lCJg16DXc3rYjCX1I1wUwRXsU3eOJFC5kB0GRsyqJ16fv7Y1qLlj2xhf5 +HuwH3oRKGiWQuyACOORkDH3fgSRD9ox3TFro4WGC0Oowd3UZktws8q6u 8qvbEpcNtY9N4d5srbNf3Vd5DXrtVLdr5st5F5pxmCXZoxMykfdmLw3Bo qysp9nPcktbv4fHk9q7FujYi/EpAUWikwcW3kS2hhIeJdDIGuWa9/+T2W w==; X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="442624666" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="442624666" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:23:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="883199300" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="883199300" Received: from silpixa00401385.ir.intel.com ([10.237.214.152]) by fmsmga001.fm.intel.com with ESMTP; 01 Sep 2023 07:23:47 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Anatoly Burakov Subject: [PATCH 2/2] build: fail if explicitly requested driver is unbuildable Date: Fri, 1 Sep 2023 15:23:32 +0100 Message-Id: <20230901142332.588856-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901142332.588856-1-bruce.richardson@intel.com> References: <20230901142332.588856-1-bruce.richardson@intel.com> MIME-Version: 1.0 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 When the user passes a list of desired drivers to build via the "enable_drivers" option, the expectation is that those drivers should be part of the build. However, if those drivers have either external or internal dependencies, they still may be silently disabled, for example: running "meson setup -Denable_drivers=net/iavf build" will successfully run, but the iavf net driver will not be configured as "common/iavf" is missing. We can fix this by setting a flag to indicate when the drivers are specified via an enable_drivers flag. However, unlike when erroring out on missing libs, we don't error out if a driver in unbuildable, unless the driver name explicitly appears in the "enable_drivers" list. This is implemented this way to ensure that wildcarding still works. For example: we still want to allow "meson setup -Denable_drivers=net/*" to work, configuring only the buildable network drivers. While it's true that this additional restriction may cause some builds to pass when they should fail, e.g. if the wildcard refers only to a single driver, implementing things this way avoids massive amounts of complexity, and is still an improvement on the status-quo. Suggested-by: Anatoly Burakov Signed-off-by: Bruce Richardson Acked-by: Morten Brørup --- drivers/meson.build | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/meson.build b/drivers/meson.build index 417b64b8fc..8c775bbe62 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -41,7 +41,9 @@ disable_drivers = run_command(list_dir_globs, disable_drivers, check: true).stdo # add cmdline enabled drivers and meson enabled drivers together enable_drivers = ',' + get_option('enable_drivers') enable_drivers = run_command(list_dir_globs, enable_drivers, check: true).stdout().split() +require_drivers = true if enable_drivers.length() == 0 + require_drivers = false enable_drivers = run_command(list_dir_globs, '*/*', check: true).stdout().split() endif @@ -155,6 +157,12 @@ foreach subpath:subdirs build = false reason = 'requires IOVA in mbuf (set enable_iova_as_pa option)' endif + # error out if we can't build a driver and that driver was explicitly requested, + # i.e. not via wildcard. + if not build and require_drivers and get_option('enable_drivers').contains(drv_path) + error('Cannot build explicitly requested driver "@0@".\n'.format(drv_path) + +'\tReason: ' + reason) + endif # get dependency objs from strings shared_deps = ext_deps @@ -171,6 +179,12 @@ foreach subpath:subdirs endif message('Disabling @1@ [@2@]: missing internal dependency "@0@"' .format(d, name, 'drivers/' + drv_path)) + # error out if we can't build a driver and that driver was explicitly + # requested, i.e. not via wildcard. + if require_drivers and get_option('enable_drivers').contains(drv_path) + error('Cannot build explicitly requested driver "@0@".\n'.format(drv_path) + +'\tPlease enable missing dependency "@0@"'.format(d)) + endif else shared_deps += [get_variable('shared_rte_' + d)] static_deps += [get_variable('static_rte_' + d)]