From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30B89A04DD for ; Tue, 20 Oct 2020 19:44:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F119AA11; Tue, 20 Oct 2020 19:44:32 +0200 (CEST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by dpdk.org (Postfix) with ESMTP id B1DE9A9EE; Tue, 20 Oct 2020 19:44:21 +0200 (CEST) Received: by mail-lj1-f176.google.com with SMTP id m16so2947972ljo.6; Tue, 20 Oct 2020 10:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MHL0K8xr4P93IoxwBhp4V/9CJE0SharQe+8e5v2prR0=; b=JxMun2qfzkbIBmU1sFoT0FtbHgbz0jFlmWdjFga7SNbrMlwu5/AdvyS9Y7YL7fohMQ 2poPW78AfnrJK0p3ni+FfKer/yvFm/plXDiVM5qLaF1oaiGf11f83gmlPJhxg1CznoLM UQiWVqtbMz+3D0vS3HrjMXAS/T06Fm0BeME3Ab1G/RZRv6PhCCvpibx98j0tO+aYabE9 gwX8I8wz4jtA5b+DCFeuKRpSghJ59yGQyF+BF4a/0s1XkdZ/+7HCOcIvBitWOpN4jukM NoWHgUsKVbxZrXcccrIkIwIKeFnS+Ph3quGUBVcfo2Vn2pe3ROE3+JAWKD809iOqEuDQ EvHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MHL0K8xr4P93IoxwBhp4V/9CJE0SharQe+8e5v2prR0=; b=U93p7ziGTXlHquS5r4S1X5mE89wBBfYCTk5U3j2bmwtyYktZeD85VcYAC+3QsichWs gHfLaw7LhVdIlSuTocOhToNDPjr0RTCW+Dh+GSRla/yAMH30yjRTBvLjtVdEMFOxvIex NqrzS3s9R7LZqUT0wx/0cQlFZRH+UqAWMs8nAecGpiEjNqlbaO6DYPperHLnsLMbKTn+ KSsrWv2T8tPoL19G2ksRnWP6xjG8pTh1bZ926bYIntDatAA9M1wp1+ZOpjVSdeoOrTLq w4DgQKPyOCo4kAEkyjl1zXXMsif+7ZVNow1k399ZbakfQd0OY03SQzawgNywEzaUEZL+ avCA== X-Gm-Message-State: AOAM532/pd9GxwIGajU/WDLPUvQAa4fLSj+fDr4Lqx1xEuL770eHilUT xVdwmKi6UKroD+Ek0H9Ird19DXzUyp9eZg== X-Google-Smtp-Source: ABdhPJzvvQ+rIJgHBSfnBNeZUlU8UXem8nypJptbhTVMVznohWG6WXsBDYGX3FIS254GiTYPXSpAiw== X-Received: by 2002:a05:651c:1307:: with SMTP id u7mr1608967lja.39.1603215860740; Tue, 20 Oct 2020 10:44:20 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id z11sm498729ljk.7.2020.10.20.10.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 10:44:20 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: ci@dpdk.org, Stephen Hemminger , David Marchand , Thomas Monjalon , Maxime Coquelin , Dmitry Kozlyuk , Aaron Conole , Michael Santana , Bruce Richardson Date: Tue, 20 Oct 2020 20:44:02 +0300 Message-Id: <20201020174404.28653-3-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201020174404.28653-1-dmitry.kozliuk@gmail.com> References: <20201014183136.22239-1-dmitry.kozliuk@gmail.com> <20201020174404.28653-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-ci] [PATCH v8 2/3] build: use Python pmdinfogen X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org Sender: "ci" 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 python3-pyelftools to CI configuration. The package is available on all major distributions. FreeBSD has no system requirements section in its GSG. Currently neither Windows uses pmdinfogen, nor is COFF (PE) supported. Signed-off-by: Dmitry Kozlyuk --- .travis.yml | 2 +- buildtools/gen-pmdinfo-cfile.sh | 6 +++--- buildtools/meson.build | 15 +++++++++++++++ doc/guides/linux_gsg/sys_reqs.rst | 6 ++++++ drivers/meson.build | 2 +- meson.build | 1 - 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e12db23b..6744f6fc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,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 diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh index 43059cf36..109ee461e 100755 --- a/buildtools/gen-pmdinfo-cfile.sh +++ b/buildtools/gen-pmdinfo-cfile.sh @@ -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 diff --git a/buildtools/meson.build b/buildtools/meson.build index 04808dabc..dd4c0f640 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -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 diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst index 6ecdc04aa..89c9f2570 100644 --- a/doc/guides/linux_gsg/sys_reqs.rst +++ b/doc/guides/linux_gsg/sys_reqs.rst @@ -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; diff --git a/drivers/meson.build b/drivers/meson.build index a5a6fed06..94403f7ac 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -152,7 +152,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 diff --git a/meson.build b/meson.build index 61d9a4f5f..a6e8c09c2 100644 --- a/meson.build +++ b/meson.build @@ -45,7 +45,6 @@ subdir('buildtools') subdir('config') # build libs and drivers -subdir('buildtools/pmdinfogen') subdir('lib') subdir('drivers') -- 2.28.0