DPDK usage discussions
 help / color / mirror / Atom feed
* question on packaging DPDK 21.11 in RPM (elftools not found)
@ 2022-04-27 17:22 Stefan Puiu
  0 siblings, 0 replies; only message in thread
From: Stefan Puiu @ 2022-04-27 17:22 UTC (permalink / raw)
  To: users

Hi,

We're using a CentOS 7 based distro that is obviously RPM-based, and
we package the DPDK with it. Now, we currently have DPDK 20.11 and are
looking to upgrade to 21.11, and I'm hitting a build error about
elftools not being found:

Program python3 found: YES (/usr/bin/python3)

../buildtools/meson.build:49:8: ERROR: Problem encountered: missing
python module: elftools

The fix seems to be to install pyelftools from pip:

pip3 install pyelftools

But that only works for building directly with meson / ninja. That
doesn't work when building through rpmbuild. I've struggled to
understand this, until I found this RedHat bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1937494. It seems Fedora
changed the python3 search path so that /usr/local/lib/python is not
taken into account if RPM_BUILD_ROOT is defined (see
https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe); so
basically, when building with rpmbuild, pip-installed packages are
ignored.

I think I can understand the rationale of the Fedora change when you
want to ensure that dependencies are properly set: packages installed
using pip are not recorded as RPM dependencies, and the package might
break at runtime. However, as far as I can tell, pyelftools seems to
be a build-time dependency, the pmdinfogen script needs pyelftools to
be able to *run*, and the said script is called when building any
driver, as far as I can tell. There's no pyelftools RPM for CentOS 7
that I could find, so I don't see another option than installing it
from pip. Also, the python change in Fedora doesn't seem to allow for
any workaround. The only thing that I can think of is ugly as hell:
symlink everything under /usr/local/python in /usr/lib/python for the
DPDK build. I'm not even sure we need pyelftools at runtime; in our
build of DPDK-20.11, dpdk-pmdinfo.py doesn't even run (because of
missing pyelftools :) ).

Are there any other people struggling with this? Is there any more
elegant approach that I haven't thought of?

Thanks,
Stefan.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-27 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 17:22 question on packaging DPDK 21.11 in RPM (elftools not found) Stefan Puiu

DPDK usage discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git