DPDK usage discussions
 help / color / mirror / Atom feed
From: Stefan Puiu <stefan.puiu@gmail.com>
To: users@dpdk.org
Subject: question on packaging DPDK 21.11 in RPM (elftools not found)
Date: Wed, 27 Apr 2022 20:22:32 +0300
Message-ID: <CACKs7VD97Cc1UowJYbVrYN=erdaS6ZizRwnzVO03L8hgQjfGLQ@mail.gmail.com> (raw)

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.

                 reply	other threads:[~2022-04-27 17:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACKs7VD97Cc1UowJYbVrYN=erdaS6ZizRwnzVO03L8hgQjfGLQ@mail.gmail.com' \
    --to=stefan.puiu@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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