build: avoid deprecated function for Meson properties

Message ID 20230104113635.206506-1-thomas@monjalon.net (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series build: avoid deprecated function for Meson properties |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing fail Testing issues
ci/iol-abi-testing success Testing PASS

Commit Message

Thomas Monjalon Jan. 4, 2023, 11:36 a.m. UTC
  The function get_cross_property() has been deprecated in Meson 0.58,
and is replaced by the function get_external_property() introduced
in Meson 0.54.

This replacement requires to raise the minimal accepted Meson version
from 0.53.2 to 0.54.0.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 config/arm/meson.build            | 4 ++--
 config/meson.build                | 6 +++---
 config/riscv/meson.build          | 4 ++--
 doc/guides/linux_gsg/sys_reqs.rst | 2 +-
 drivers/meson.build               | 4 ++--
 kernel/linux/meson.build          | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)
  

Comments

Stanislaw Kardach Jan. 4, 2023, 11:59 a.m. UTC | #1
On Wed, Jan 4, 2023 at 12:36 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The function get_cross_property() has been deprecated in Meson 0.58,
> and is replaced by the function get_external_property() introduced
> in Meson 0.54.
>
> This replacement requires to raise the minimal accepted Meson version
> from 0.53.2 to 0.54.0.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  config/arm/meson.build            | 4 ++--
>  config/meson.build                | 6 +++---
>  config/riscv/meson.build          | 4 ++--
>  doc/guides/linux_gsg/sys_reqs.rst | 2 +-
>  drivers/meson.build               | 4 ++--
>  kernel/linux/meson.build          | 4 ++--
>  6 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 6442ec9596..5a9411af75 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -503,7 +503,7 @@ if dpdk_conf.get('RTE_ARCH_32')
>      dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
>      if meson.is_cross_build()
>          update_flags = true
> -        soc = meson.get_cross_property('platform', '')
> +        soc = meson.get_external_property('platform', '')
>          if soc == ''
>              error('Arm SoC must be specified in the cross file.')
>          endif
> @@ -558,7 +558,7 @@ else
>          endif
>      else
>          # cross build
> -        soc = meson.get_cross_property('platform', '')
> +        soc = meson.get_external_property('platform', '')
>          if soc == ''
>              error('Arm SoC must be specified in the cross file.')
>          endif
> diff --git a/config/meson.build b/config/meson.build
> index 6d9ffd4f4b..80564eec52 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -176,7 +176,7 @@ endif
>  # check for libraries used in multiple places in DPDK
>  has_libnuma = 0
>  find_libnuma = true
> -if meson.is_cross_build() and not meson.get_cross_property('numa', true)
> +if meson.is_cross_build() and not meson.get_external_property('numa', true)
>      # don't look for libnuma if explicitly disabled in cross build
>      find_libnuma = false
>  endif
> @@ -324,12 +324,12 @@ dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
>  # apply cross-specific options
>  if meson.is_cross_build()
>      # configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
> -    cross_max_lcores = meson.get_cross_property('max_lcores', 0)
> +    cross_max_lcores = meson.get_external_property('max_lcores', 0)
>      if cross_max_lcores != 0
>          message('Setting RTE_MAX_LCORE from cross file')
>          dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
>      endif
> -    cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
> +    cross_max_numa_nodes = meson.get_external_property('max_numa_nodes', 0)
>      if cross_max_numa_nodes != 0
>          message('Setting RTE_MAX_NUMA_NODES from cross file')
>          dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
> diff --git a/config/riscv/meson.build b/config/riscv/meson.build
> index 07d7d9da23..7562c6cb99 100644
> --- a/config/riscv/meson.build
> +++ b/config/riscv/meson.build
> @@ -84,8 +84,8 @@ if not meson.is_cross_build()
>      endif
>  else
>      # cross build
> -    vendor_id = meson.get_cross_property('vendor_id')
> -    arch_id = meson.get_cross_property('arch_id')
> +    vendor_id = meson.get_external_property('vendor_id')
> +    arch_id = meson.get_external_property('arch_id')
>  endif
>
>  if not vendors.has_key(vendor_id)
> diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
> index a7e8261e22..e4f9b41251 100644
> --- a/doc/guides/linux_gsg/sys_reqs.rst
> +++ b/doc/guides/linux_gsg/sys_reqs.rst
> @@ -43,7 +43,7 @@ Compilation of the DPDK
>
>  *   Python 3.6 or later.
>
> -*   Meson (version 0.53.2+) and ninja
> +*   Meson (version 0.54+) and ninja
>
>      * ``meson`` & ``ninja-build`` packages in most Linux distributions
>      * If the packaged version is below the minimum version, the latest versions
> diff --git a/drivers/meson.build b/drivers/meson.build
> index c6d619200f..c17c92cca8 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -25,8 +25,8 @@ subdirs = [
>  ]
>
>  if meson.is_cross_build()
> -    disable_drivers += ',' + meson.get_cross_property('disable_drivers', '')
> -    enable_drivers += ',' + meson.get_cross_property('enable_drivers', '')
> +    disable_drivers += ',' + meson.get_external_property('disable_drivers', '')
> +    enable_drivers += ',' + meson.get_external_property('enable_drivers', '')
>  endif
>
>  # add cmdline disabled drivers and meson disabled drivers together
> diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
> index 16a0948994..66cbcd1dbf 100644
> --- a/kernel/linux/meson.build
> +++ b/kernel/linux/meson.build
> @@ -67,7 +67,7 @@ elif cross_compiler.endswith('clang')
>      found_target = false
>      # search for '-target' and use the arg that follows
>      # (i.e. the value of '-target') as cross_prefix
> -    foreach cross_c_arg : meson.get_cross_property('c_args')
> +    foreach cross_c_arg : meson.get_external_property('c_args')
>          if found_target and cross_prefix == ''
>              cross_prefix = cross_c_arg
>          endif
> @@ -79,7 +79,7 @@ elif cross_compiler.endswith('clang')
>          error('Did not find -target and its value in c_args in input cross-file.')
>      endif
>      linker = 'lld'
> -    foreach cross_c_link_arg : meson.get_cross_property('c_link_args')
> +    foreach cross_c_link_arg : meson.get_external_property('c_link_args')
>          if cross_c_link_arg.startswith('-fuse-ld')
>              linker = cross_c_link_arg.split('=')[1]
>          endif
> --
> 2.39.0
>
Reviewed-by: Stanislaw Kardach <kda@semihalf.com>
  
Ruifeng Wang Jan. 5, 2023, 4:25 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, January 4, 2023 7:37 PM
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; Bruce Richardson <bruce.richardson@intel.com>;
> Stanislaw Kardach <kda@semihalf.com>
> Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> Subject: [PATCH] build: avoid deprecated function for Meson properties
> 
> The function get_cross_property() has been deprecated in Meson 0.58, and is replaced by
> the function get_external_property() introduced in Meson 0.54.
> 
> This replacement requires to raise the minimal accepted Meson version from 0.53.2 to
> 0.54.0.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  config/arm/meson.build            | 4 ++--
>  config/meson.build                | 6 +++---
>  config/riscv/meson.build          | 4 ++--
>  doc/guides/linux_gsg/sys_reqs.rst | 2 +-
>  drivers/meson.build               | 4 ++--
>  kernel/linux/meson.build          | 4 ++--
>  6 files changed, 12 insertions(+), 12 deletions(-)
> 
<snip>

> diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
> index a7e8261e22..e4f9b41251 100644
> --- a/doc/guides/linux_gsg/sys_reqs.rst
> +++ b/doc/guides/linux_gsg/sys_reqs.rst
> @@ -43,7 +43,7 @@ Compilation of the DPDK
> 
>  *   Python 3.6 or later.
> 
> -*   Meson (version 0.53.2+) and ninja
> +*   Meson (version 0.54+) and ninja
> 
meson.build:15 needs update to reflect the version pump.
And .ci/linux-setup.sh:7 also defines meson version. But I'm not sure whether this file is still in use.

With the changes:
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
  
Thomas Monjalon Jan. 5, 2023, 9:14 a.m. UTC | #3
05/01/2023 05:25, Ruifeng Wang:
> From: Thomas Monjalon <thomas@monjalon.net>
> > -*   Meson (version 0.53.2+) and ninja
> > +*   Meson (version 0.54+) and ninja
> > 
> meson.build:15 needs update to reflect the version pump.
> And .ci/linux-setup.sh:7 also defines meson version. But I'm not sure whether this file is still in use.
> 
> With the changes:
> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>

Thanks Ruifeng for the good review.
It will be fixed in v2.

The question remaining is about distributions support.
Do we care or rely on pip?
Why did we recently agree to use 0.53.2?

Do we want to wait a little for using 0.54?
  
Bruce Richardson Jan. 6, 2023, 12:30 p.m. UTC | #4
On Thu, Jan 05, 2023 at 10:14:04AM +0100, Thomas Monjalon wrote:
> 05/01/2023 05:25, Ruifeng Wang:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > -*   Meson (version 0.53.2+) and ninja
> > > +*   Meson (version 0.54+) and ninja
> > > 
> > meson.build:15 needs update to reflect the version pump.
> > And .ci/linux-setup.sh:7 also defines meson version. But I'm not sure whether this file is still in use.
> > 
> > With the changes:
> > Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
> 
> Thanks Ruifeng for the good review.
> It will be fixed in v2.
> 
> The question remaining is about distributions support.
> Do we care or rely on pip?
> Why did we recently agree to use 0.53.2?
> 
> Do we want to wait a little for using 0.54?
> 
Personally I am fine either way. Since using pip is so easy I don't
think we need to be that concerned about distro support.
  
Tyler Retzlaff Jan. 6, 2023, 8:33 p.m. UTC | #5
On Fri, Jan 06, 2023 at 12:30:38PM +0000, Bruce Richardson wrote:
> On Thu, Jan 05, 2023 at 10:14:04AM +0100, Thomas Monjalon wrote:
> > 05/01/2023 05:25, Ruifeng Wang:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > -*   Meson (version 0.53.2+) and ninja
> > > > +*   Meson (version 0.54+) and ninja
> > > > 
> > > meson.build:15 needs update to reflect the version pump.
> > > And .ci/linux-setup.sh:7 also defines meson version. But I'm not sure whether this file is still in use.
> > > 
> > > With the changes:
> > > Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > 
> > Thanks Ruifeng for the good review.
> > It will be fixed in v2.
> > 
> > The question remaining is about distributions support.
> > Do we care or rely on pip?
> > Why did we recently agree to use 0.53.2?
> > 
> > Do we want to wait a little for using 0.54?
> > 
> Personally I am fine either way. Since using pip is so easy I don't
> think we need to be that concerned about distro support.

i'm not sure if it is relevant but for windows platform we would
generally avoid depending on pip.
  

Patch

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6442ec9596..5a9411af75 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -503,7 +503,7 @@  if dpdk_conf.get('RTE_ARCH_32')
     dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
     if meson.is_cross_build()
         update_flags = true
-        soc = meson.get_cross_property('platform', '')
+        soc = meson.get_external_property('platform', '')
         if soc == ''
             error('Arm SoC must be specified in the cross file.')
         endif
@@ -558,7 +558,7 @@  else
         endif
     else
         # cross build
-        soc = meson.get_cross_property('platform', '')
+        soc = meson.get_external_property('platform', '')
         if soc == ''
             error('Arm SoC must be specified in the cross file.')
         endif
diff --git a/config/meson.build b/config/meson.build
index 6d9ffd4f4b..80564eec52 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -176,7 +176,7 @@  endif
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
 find_libnuma = true
-if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+if meson.is_cross_build() and not meson.get_external_property('numa', true)
     # don't look for libnuma if explicitly disabled in cross build
     find_libnuma = false
 endif
@@ -324,12 +324,12 @@  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 # apply cross-specific options
 if meson.is_cross_build()
     # configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
-    cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+    cross_max_lcores = meson.get_external_property('max_lcores', 0)
     if cross_max_lcores != 0
         message('Setting RTE_MAX_LCORE from cross file')
         dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
     endif
-    cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+    cross_max_numa_nodes = meson.get_external_property('max_numa_nodes', 0)
     if cross_max_numa_nodes != 0
         message('Setting RTE_MAX_NUMA_NODES from cross file')
         dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
diff --git a/config/riscv/meson.build b/config/riscv/meson.build
index 07d7d9da23..7562c6cb99 100644
--- a/config/riscv/meson.build
+++ b/config/riscv/meson.build
@@ -84,8 +84,8 @@  if not meson.is_cross_build()
     endif
 else
     # cross build
-    vendor_id = meson.get_cross_property('vendor_id')
-    arch_id = meson.get_cross_property('arch_id')
+    vendor_id = meson.get_external_property('vendor_id')
+    arch_id = meson.get_external_property('arch_id')
 endif
 
 if not vendors.has_key(vendor_id)
diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index a7e8261e22..e4f9b41251 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -43,7 +43,7 @@  Compilation of the DPDK
 
 *   Python 3.6 or later.
 
-*   Meson (version 0.53.2+) and ninja
+*   Meson (version 0.54+) and ninja
 
     * ``meson`` & ``ninja-build`` packages in most Linux distributions
     * If the packaged version is below the minimum version, the latest versions
diff --git a/drivers/meson.build b/drivers/meson.build
index c6d619200f..c17c92cca8 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -25,8 +25,8 @@  subdirs = [
 ]
 
 if meson.is_cross_build()
-    disable_drivers += ',' + meson.get_cross_property('disable_drivers', '')
-    enable_drivers += ',' + meson.get_cross_property('enable_drivers', '')
+    disable_drivers += ',' + meson.get_external_property('disable_drivers', '')
+    enable_drivers += ',' + meson.get_external_property('enable_drivers', '')
 endif
 
 # add cmdline disabled drivers and meson disabled drivers together
diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
index 16a0948994..66cbcd1dbf 100644
--- a/kernel/linux/meson.build
+++ b/kernel/linux/meson.build
@@ -67,7 +67,7 @@  elif cross_compiler.endswith('clang')
     found_target = false
     # search for '-target' and use the arg that follows
     # (i.e. the value of '-target') as cross_prefix
-    foreach cross_c_arg : meson.get_cross_property('c_args')
+    foreach cross_c_arg : meson.get_external_property('c_args')
         if found_target and cross_prefix == ''
             cross_prefix = cross_c_arg
         endif
@@ -79,7 +79,7 @@  elif cross_compiler.endswith('clang')
         error('Did not find -target and its value in c_args in input cross-file.')
     endif
     linker = 'lld'
-    foreach cross_c_link_arg : meson.get_cross_property('c_link_args')
+    foreach cross_c_link_arg : meson.get_external_property('c_link_args')
         if cross_c_link_arg.startswith('-fuse-ld')
             linker = cross_c_link_arg.split('=')[1]
         endif