DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/5] Increase minimum meson version
@ 2024-09-20 12:57 Bruce Richardson
  2024-09-20 12:57 ` [PATCH 1/5] build: increase minimum meson version to 0.57 Bruce Richardson
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bruce Richardson @ 2024-09-20 12:57 UTC (permalink / raw)
  To: dev; +Cc: mb, thomas, david.marchand, Bruce Richardson

This patchset proposed increasing the minimum meson version to 0.57
and makes changes to update our build files appropriately for that
change: replacing deprecated functions, removing unnecessary version
checks and taking advantage of some new capabilities.

Why 0.57? No one particular reason; it's mainly a conservative version
bump that doesn't have many impacts, but still gives us the minimum
updates we need to replace the deprecated get_cross_properties fn
and have a few extra features guaranteed available.

Bruce Richardson (5):
  build: increase minimum meson version to 0.57
  build: remove version check on compiler links function
  build: remove unnecessary version checks
  build: use version file support from meson
  build: replace deprecated meson function

 .ci/linux-setup.sh                        | 2 +-
 config/arm/meson.build                    | 4 ++--
 config/meson.build                        | 8 ++++----
 config/riscv/meson.build                  | 4 ++--
 doc/api/meson.build                       | 2 +-
 doc/guides/linux_gsg/sys_reqs.rst         | 2 +-
 doc/guides/prog_guide/build-sdk-meson.rst | 2 +-
 drivers/common/qat/meson.build            | 2 +-
 drivers/crypto/ipsec_mb/meson.build       | 2 +-
 drivers/event/cnxk/meson.build            | 2 +-
 drivers/meson.build                       | 7 ++-----
 drivers/net/cnxk/meson.build              | 2 +-
 lib/meson.build                           | 6 ------
 meson.build                               | 7 ++-----
 14 files changed, 20 insertions(+), 32 deletions(-)

--
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] build: increase minimum meson version to 0.57
  2024-09-20 12:57 [PATCH 0/5] Increase minimum meson version Bruce Richardson
@ 2024-09-20 12:57 ` Bruce Richardson
  2024-09-20 12:57 ` [PATCH 2/5] build: remove version check on compiler links function Bruce Richardson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2024-09-20 12:57 UTC (permalink / raw)
  To: dev; +Cc: mb, thomas, david.marchand, Bruce Richardson

In order to work around some deprecated functions in meson, we need to
increase meson version. Increasing to 0.57 to also gain support for
other useful features for us in DPDK. Changes of interest to DPDK
include:

* Use get_external_property instead of get_cross_property
* Ability to use a VERSION file rather than hacking it with scripting
* Ability to set built-in options in cross-build files
* Ability to set pkg_config_libdir in cross-build files

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 .ci/linux-setup.sh                        | 2 +-
 doc/guides/linux_gsg/sys_reqs.rst         | 2 +-
 doc/guides/prog_guide/build-sdk-meson.rst | 2 +-
 meson.build                               | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.ci/linux-setup.sh b/.ci/linux-setup.sh
index 975bf32144..8512a92b21 100755
--- a/.ci/linux-setup.sh
+++ b/.ci/linux-setup.sh
@@ -4,7 +4,7 @@
 [ "$(id -u)" != '0' ] || alias sudo=
 
 # need to install as 'root' since some of the unit tests won't run without it
-sudo python3 -m pip install --upgrade 'meson==0.53.2'
+sudo python3 -m pip install --upgrade 'meson==0.57.0'
 
 # setup hugepages. error ignored because having hugepage is not mandatory.
 cat /proc/meminfo
diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index 9c5282573e..13d632cec7 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -44,7 +44,7 @@ Compilation of the DPDK
 
 *   Python 3.6 or later.
 
-*   Meson (version 0.53.2+) and ninja
+*   Meson (version 0.57+) 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/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 93aa1f80e3..fdb5d484fa 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -35,7 +35,7 @@ The ``meson`` tool is used to configure a DPDK build. On most Linux
 distributions this can be got using the local package management system,
 e.g. ``dnf install meson`` or ``apt-get install meson``. If meson is not
 available as a suitable package, it can also be installed using the Python
-3 ``pip`` tool, e.g. ``pip3 install meson``. Version 0.53.2 or later of meson is
+3 ``pip`` tool, e.g. ``pip3 install meson``. Version 0.57 or later of meson is
 required - if the version packaged is too old, the latest version is
 generally available from "pip".
 
diff --git a/meson.build b/meson.build
index 8b248d4505..69888834b4 100644
--- a/meson.build
+++ b/meson.build
@@ -13,7 +13,7 @@ project('DPDK', 'c',
             'default_library=static',
             'warning_level=2',
         ],
-        meson_version: '>= 0.53.2'
+        meson_version: '>= 0.57'
 )
 
 # check for developer mode
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/5] build: remove version check on compiler links function
  2024-09-20 12:57 [PATCH 0/5] Increase minimum meson version Bruce Richardson
  2024-09-20 12:57 ` [PATCH 1/5] build: increase minimum meson version to 0.57 Bruce Richardson
@ 2024-09-20 12:57 ` Bruce Richardson
  2024-09-20 12:57 ` [PATCH 3/5] build: remove unnecessary version checks Bruce Richardson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2024-09-20 12:57 UTC (permalink / raw)
  To: dev; +Cc: mb, thomas, david.marchand, Bruce Richardson, stable

The "compiler.links()" function meson documentation [1] is a little
unclear, in a casual reading implies that the function was new in 0.60
meson release. In fact, it is only enhanced as described in that
release, but is present earlier.
As such, we can remove the version checks preceeding the calls to links
function in our code.

[1] https://mesonbuild.com/Reference-manual_returned_compiler.html#compilerlinks

Fixes: fd809737cf8c ("common/qat: fix build with incompatible IPsec library")
Fixes: fb94d8243894 ("crypto/ipsec_mb: add dependency check for cross build")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/common/qat/meson.build      | 2 +-
 drivers/crypto/ipsec_mb/meson.build | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build
index 3893b127dd..5a8de16fe0 100644
--- a/drivers/common/qat/meson.build
+++ b/drivers/common/qat/meson.build
@@ -43,7 +43,7 @@ else
     IMB_required_ver = '1.4.0'
     IMB_header = '#include<intel-ipsec-mb.h>'
     libipsecmb = cc.find_library('IPSec_MB', required: false)
-    if libipsecmb.found() and meson.version().version_compare('>=0.60') and cc.links(
+    if libipsecmb.found() and cc.links(
             'int main(void) {return 0;}', dependencies: libipsecmb)
         # version comes with quotes, so we split based on " and take the middle
         imb_ver = cc.get_define('IMB_VERSION_STR',
diff --git a/drivers/crypto/ipsec_mb/meson.build b/drivers/crypto/ipsec_mb/meson.build
index 87bf965554..81631d3050 100644
--- a/drivers/crypto/ipsec_mb/meson.build
+++ b/drivers/crypto/ipsec_mb/meson.build
@@ -17,7 +17,7 @@ if not lib.found()
     build = false
     reason = 'missing dependency, "libIPSec_MB"'
 # if the lib is found, check it's the right format
-elif meson.version().version_compare('>=0.60') and not cc.links(
+elif not cc.links(
         'int main(void) {return 0;}', dependencies: lib)
     build = false
     reason = 'incompatible dependency, "libIPSec_MB"'
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/5] build: remove unnecessary version checks
  2024-09-20 12:57 [PATCH 0/5] Increase minimum meson version Bruce Richardson
  2024-09-20 12:57 ` [PATCH 1/5] build: increase minimum meson version to 0.57 Bruce Richardson
  2024-09-20 12:57 ` [PATCH 2/5] build: remove version check on compiler links function Bruce Richardson
@ 2024-09-20 12:57 ` Bruce Richardson
  2024-09-20 12:57 ` [PATCH 4/5] build: use version file support from meson Bruce Richardson
  2024-09-20 12:57 ` [PATCH 5/5] build: replace deprecated meson function Bruce Richardson
  4 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2024-09-20 12:57 UTC (permalink / raw)
  To: dev; +Cc: mb, thomas, david.marchand, Bruce Richardson

Since minimum meson version is now 0.57 we can remove all version checks
for versions lower than that.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build  | 2 +-
 doc/api/meson.build | 2 +-
 drivers/meson.build | 3 ---
 lib/meson.build     | 6 ------
 4 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 8c8b019c25..913825b1ca 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -97,7 +97,7 @@ eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 if not is_windows
     meson.add_install_script('../buildtools/symlink-drivers-solibs.sh',
             get_option('libdir'), pmd_subdir_opt)
-elif meson.version().version_compare('>=0.55.0')
+else
     # 0.55.0 is required to use external program with add_install_script
     meson.add_install_script(py3,
             files('../buildtools/symlink-drivers-solibs.py'),
diff --git a/doc/api/meson.build b/doc/api/meson.build
index 5b50692df9..404c145672 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -97,6 +97,6 @@ doc_target_names += 'Doxygen_API(Manpage)'
 # refresh the manpage database on install
 # if DPDK manpages are installed to a staging directory, not in MANPATH, this has no effect
 mandb = find_program('mandb', required: false)
-if mandb.found() and get_option('enable_docs') and meson.version().version_compare('>=0.55.0')
+if mandb.found() and get_option('enable_docs')
     meson.add_install_script(mandb)
 endif
diff --git a/drivers/meson.build b/drivers/meson.build
index 66931d4241..1cb98e9354 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -280,9 +280,6 @@ foreach subpath:subdirs
                 lk_deps += [def_file]
 
                 lk_args = ['-Wl,/def:' + def_file.full_path()]
-                if meson.version().version_compare('<0.54.0')
-                    lk_args += ['-Wl,/implib:drivers\\lib' + lib_name + '.dll.a']
-                endif
             else
                 mingw_map = custom_target(lib_name + '_mingw',
                         command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
diff --git a/lib/meson.build b/lib/meson.build
index 162287753f..ce92cb5537 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -276,14 +276,8 @@ foreach l:libraries
 
         if is_ms_compiler
             lk_args = ['/def:' + def_file.full_path()]
-            if meson.version().version_compare('<0.54.0')
-                lk_args += ['/implib:lib\\librte_' + l + '.dll.a']
-            endif
         else
             lk_args = ['-Wl,/def:' + def_file.full_path()]
-            if meson.version().version_compare('<0.54.0')
-                lk_args += ['-Wl,/implib:lib\\librte_' + l + '.dll.a']
-            endif
         endif
     else
         if is_windows
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/5] build: use version file support from meson
  2024-09-20 12:57 [PATCH 0/5] Increase minimum meson version Bruce Richardson
                   ` (2 preceding siblings ...)
  2024-09-20 12:57 ` [PATCH 3/5] build: remove unnecessary version checks Bruce Richardson
@ 2024-09-20 12:57 ` Bruce Richardson
  2024-09-20 12:57 ` [PATCH 5/5] build: replace deprecated meson function Bruce Richardson
  4 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2024-09-20 12:57 UTC (permalink / raw)
  To: dev; +Cc: mb, thomas, david.marchand, Bruce Richardson

Rather than having to use run_command to shell out and read the VERSION
file for the DPDK version, we can use the support added directly to
meson in version 0.57.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 meson.build | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 69888834b4..fe9040369a 100644
--- a/meson.build
+++ b/meson.build
@@ -2,10 +2,7 @@
 # Copyright(c) 2017-2019 Intel Corporation
 
 project('DPDK', 'c',
-        # Get version number from file.
-        # Fallback to "more" for Windows compatibility.
-        version: run_command(find_program('cat', 'more'),
-            files('VERSION'), check: true).stdout().strip(),
+        version: files('VERSION'),
         license: 'BSD',
         default_options: [
             'buildtype=release',
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 5/5] build: replace deprecated meson function
  2024-09-20 12:57 [PATCH 0/5] Increase minimum meson version Bruce Richardson
                   ` (3 preceding siblings ...)
  2024-09-20 12:57 ` [PATCH 4/5] build: use version file support from meson Bruce Richardson
@ 2024-09-20 12:57 ` Bruce Richardson
  4 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2024-09-20 12:57 UTC (permalink / raw)
  To: dev; +Cc: mb, thomas, david.marchand, Bruce Richardson

The meson function "get_cross_property" is deprecated in meson 0.58 and
should be replaced by "get_external_property".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/meson.build         | 4 ++--
 config/meson.build             | 6 +++---
 config/riscv/meson.build       | 4 ++--
 drivers/event/cnxk/meson.build | 2 +-
 drivers/meson.build            | 4 ++--
 drivers/net/cnxk/meson.build   | 2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 012935d5d7..6ef91d3a1a 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -717,7 +717,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
@@ -772,7 +772,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 913825b1ca..869f7605e8 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -227,7 +227,7 @@ endif
 # check for libraries used in multiple places in DPDK
 has_libnuma = false
 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
@@ -377,12 +377,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/drivers/event/cnxk/meson.build b/drivers/event/cnxk/meson.build
index e0e350570d..2c1060ad87 100644
--- a/drivers/event/cnxk/meson.build
+++ b/drivers/event/cnxk/meson.build
@@ -9,7 +9,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
 endif
 
 if meson.is_cross_build()
-        soc_type = meson.get_cross_property('platform', '')
+        soc_type = meson.get_external_property('platform', '')
 else
         soc_type = platform
 endif
diff --git a/drivers/meson.build b/drivers/meson.build
index 1cb98e9354..2733306698 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -32,8 +32,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/drivers/net/cnxk/meson.build b/drivers/net/cnxk/meson.build
index 7bce80098a..4506ce9306 100644
--- a/drivers/net/cnxk/meson.build
+++ b/drivers/net/cnxk/meson.build
@@ -9,7 +9,7 @@ if not dpdk_conf.get('RTE_ARCH_64')
 endif
 
 if meson.is_cross_build()
-        soc_type = meson.get_cross_property('platform', '')
+        soc_type = meson.get_external_property('platform', '')
 else
         soc_type = platform
 endif
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-20 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-20 12:57 [PATCH 0/5] Increase minimum meson version Bruce Richardson
2024-09-20 12:57 ` [PATCH 1/5] build: increase minimum meson version to 0.57 Bruce Richardson
2024-09-20 12:57 ` [PATCH 2/5] build: remove version check on compiler links function Bruce Richardson
2024-09-20 12:57 ` [PATCH 3/5] build: remove unnecessary version checks Bruce Richardson
2024-09-20 12:57 ` [PATCH 4/5] build: use version file support from meson Bruce Richardson
2024-09-20 12:57 ` [PATCH 5/5] build: replace deprecated meson function Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).