]> git.droids-corp.org - dpdk.git/commitdiff
buildtools: use Python pmdinfogen
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Sun, 24 Jan 2021 20:51:56 +0000 (23:51 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 25 Jan 2021 22:23:41 +0000 (23:23 +0100)
Use the same interpreter to run pmdinfogen as for other build scripts.
Adjust wrapper script accordingly and also don't suppress stderr from ar
and pmdinfogen. Add configure-time check for elftools Python module for
Unix hosts.

Add pyelftools to CI configuration and build requirements for Linux and
FreeBSD. Windows targets are not currently using pmdinfogen.

Suppress ABI warnings about generated PMD information strings.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
.github/workflows/build.yml
.travis.yml
buildtools/gen-pmdinfo-cfile.sh
buildtools/meson.build
devtools/libabigail.abignore
doc/guides/freebsd_gsg/build_dpdk.rst
doc/guides/linux_gsg/sys_reqs.rst
drivers/meson.build
meson.build

index 0b72df0ebe0a5b186d47337fdbe55c7ef77e94f1..a5b579adda4cfeddbb809d3ba622ab72fb8021fd 100644 (file)
@@ -91,8 +91,8 @@ jobs:
       run: sudo apt update
     - name: Install packages
       run: sudo apt install -y ccache libnuma-dev python3-setuptools
-        python3-wheel python3-pip ninja-build libbsd-dev libpcap-dev
-        libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev
+        python3-wheel python3-pip python3-pyelftools ninja-build libbsd-dev
+        libpcap-dev libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev
     - name: Install libabigail build dependencies if no cache is available
       if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true'
       run: sudo apt install -y autoconf automake libtool pkg-config libxml2-dev
index 5aa7ad49f1f94b54af29c0b2e113bcbb67a4d0c5..4391af1d5f1afc3432b1f615d8a204545d2db388 100644 (file)
@@ -14,7 +14,7 @@ addons:
   apt:
     update: true
     packages: &required_packages
-      - [libnuma-dev, python3-setuptools, python3-wheel, python3-pip, ninja-build]
+      - [libnuma-dev, python3-setuptools, python3-wheel, python3-pip, python3-pyelftools, ninja-build]
       - [libbsd-dev, libpcap-dev, libibverbs-dev, libcrypto++-dev, libfdt-dev, libjansson-dev]
 
 _aarch64_packages: &aarch64_packages
index 43059cf3646ba4eadc3c8cb397183488320c640c..109ee461e8071fa260f4be3bcf8e97e72ed6b2cb 100755 (executable)
@@ -4,11 +4,11 @@
 
 arfile=$1
 output=$2
-pmdinfogen=$3
+shift 2
+pmdinfogen=$*
 
 # The generated file must not be empty if compiled in pedantic mode
 echo 'static __attribute__((unused)) const char *generator = "'$0'";' > $output
 for ofile in `ar t $arfile` ; do
-       ar p $arfile $ofile | $pmdinfogen - - >> $output 2> /dev/null
+       ar p $arfile $ofile | $pmdinfogen - - >> $output
 done
-exit 0
index 04808dabc192af981d0025f573775e10b5f27cd0..dd4c0f640893ea1ea1cf3737f0a585b3e026e981 100644 (file)
@@ -17,3 +17,18 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+pmdinfogen = py3 + files('pmdinfogen.py')
+
+# TODO: starting from Meson 0.51.0 use
+#      python3 = import('python').find_installation('python',
+#              modules : python3_required_modules)
+python3_required_modules = []
+if host_machine.system() != 'windows'
+       python3_required_modules = ['elftools']
+endif
+foreach module : python3_required_modules
+       script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)'
+       if run_command(py3, '-c', script.format(module)).returncode() != 0
+               error('missing python module: @0@'.format(module))
+       endif
+endforeach
index 1dc84fa74ba03c16a5024fc199d16c92fca9b733..0b5e3f338755314cc9f72769c01b29cf01b69c12 100644 (file)
@@ -8,6 +8,10 @@
 [suppress_variable]
         symbol_version = INTERNAL
 
+; Ignore generated PMD information strings
+[suppress_variable]
+        name_regexp = _pmd_info$
+
 ; Explicit ignore for driver-only ABI
 [suppress_type]
         name = eth_dev_ops
index e3005a7f3cb0f499230012a40a7e6270b0b3ed79..bed353473f78f51cfb0992e4e11b8a6902800d8f 100644 (file)
@@ -14,10 +14,11 @@ The following FreeBSD packages are required to build DPDK:
 * meson
 * ninja
 * pkgconf
+* py37-pyelftools
 
 These can be installed using (as root)::
 
-  pkg install meson pkgconf
+  pkg install meson pkgconf py37-pyelftools
 
 To compile the required kernel modules for memory management and working
 with physical NIC devices, the kernel sources for FreeBSD also
index be714adf22333ce3efd977d0cdd4fc4fd95e5bd0..a05b5bd816f7def440e8c4eac5d1a01bb22fbc41 100644 (file)
@@ -52,6 +52,12 @@ Compilation of the DPDK
     * If the packaged version is below the minimum version, the latest versions
       can be installed from Python's "pip" repository: ``pip3 install meson ninja``
 
+*   ``pyelftools`` (version 0.22+)
+
+    * For RHEL/Fedora systems it can be installed using ``dnf install python-pyelftools``
+
+    * For Ubuntu/Debian it can be installed using ``apt install python3-pyelftools``
+
 *   Library for handling NUMA (Non Uniform Memory Access).
 
     * ``numactl-devel`` in RHEL/Fedora;
index 77f65fa9090eb9d76317dd6ded7bad6813f28a7b..ff5cdb952bcff01d836d46252571a0a93063c5e2 100644 (file)
@@ -132,7 +132,7 @@ foreach subpath:subdirs
                                                command: [pmdinfo, tmp_lib.full_path(),
                                                        '@OUTPUT@', pmdinfogen],
                                                output: out_filename,
-                                               depends: [pmdinfogen, tmp_lib])
+                                               depends: [tmp_lib])
                        endif
 
                        # now build the static driver
index 45d974cd2c488aff6b001e12ea1844298c9e38f3..2b9c37eb42ace3ff30d47c307f5e6b5d190f940a 100644 (file)
@@ -45,7 +45,6 @@ subdir('buildtools')
 subdir('config')
 
 # build libs and drivers
-subdir('buildtools/pmdinfogen')
 subdir('lib')
 subdir('drivers')