Re: [poky] Error from package.bbclass?

Paul Barker <[email protected]>
Newsgroups org.yoctoproject.lists.yocto,org.yoctoproject.lists.poky
Message-ID <[email protected]>
On Wed, 2026-01-07 at 09:50 -0800, shawn.adams via
lists.yoctoproject.org wrote:
> I'm getting an error when building core-image-minimal for qemuarm64 using the scarthgap branch on a CentOS 9 VM.
> 
> From what I can tell, the error occurs when perform_packagecopy() attempts to copy the linux-libc-headers source files into tmp/work/cortexa57-poky-linux/linux-libc-headers/6.6/package. Line 355 in poky/meta/classes-global/package.bbclass runs two tar commands from Python's subprocess.check_output() which throw an exception. The text of the exception is
> 
> > 
> > Exception: subprocess.CalledProcessError: Command 'tar
> > --exclude=./sysroot-only -cf - -C
> > /builds/build/qemuarm64/tmp/work/cortexa57-poky-linux/linux-libc-headers/6.6/image
> > -p -S . | tar -xf - -C
> > /builds/build/qemuarm64/tmp/work/cortexa57-poky-linux/linux-libc-headers/6.6/package'
> > returned non-zero exit status 2.
> > 
> 
> The second tar command is what fails (the one extracting into the package directory). I have tar 1.34 installed on my VM and have verified that Bitbake uses the same version when it runs.
> 
> When I run the tar command manually from a terminal it works fine, so the problem seems to be unique to the Bitbake run-time environment. I have also changed perform_packagecopy() a couple different ways to see if I can get it to work:
> * I changed it to use Python's tarfile module to do what the tar command is doing. This avoids running the tar command in a shell via subprocess.check_output() and seems to work.
> * I added a shell function to package.bbclass which runs the same tar command and call it via bb.build.exec_func() instead of running the tar command in subprocess.check_output(). This produces the same error.
> I've attached the full Bitbake log file in case that helps.
> 
> Does anyone have ideas about what could be causing this problem? Could it be a problem with software versions installed on my VM?

([email protected] as that's a more relevant list)

This looks like an issue that we're seeing on our autobuilder with the
CentOS 9 worker [1].

It also seems similar to RHEL issue "tar --xattrs -xf failure" [2], but
that may not be an exact match as I'm unsure if we're using xattrs here
without refreshing my memory on the details.

[1]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16117
[2]: https://issues.redhat.com/browse/RHEL-136277

Thanks,

-- 
Paul Barker
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----

iIcEABYKAC8WIQSzjPXf5Y1BDWhU2iCrY1Tsnbr0bgUCaV6nxxEccGF1bEBwYmFy
a2VyLmRldgAKCRCrY1Tsnbr0btG2AQDGzWMxwm1OHM6Q+FW+RvjuhCtG7pI91aZI
EmpR2+I/zAEA1tA0lJ/0Do8HU1wTcJvu248+09xZ2grwqgaoFePqdws=
=dvHX
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.