Bug 13086 - Indirect depends on getopt will cause do_patch failures.
Summary: Indirect depends on getopt will cause do_patch failures.
Status: RESOLVED OBSOLETE
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 2.6
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Paul Eggleton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-12-17 02:25 UTC by Lin Zhang
Modified: 2018-12-20 15:43 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
A fix solution (860 bytes, application/octet-stream)
2018-12-17 02:25 UTC, Lin Zhang
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lin Zhang 2018-12-17 02:25:27 UTC
Created attachment 4412 [details]
A fix solution

In poky/meta/classes/patch.bbclass, I found patch_do_patch depends on "${PATCHTOOL}-native:do_populate_sysroot". if ${PATCHTOOL} is quilt, we will find that quilt-native 
 has RDEPENDS on getopt in turn, while getopt is provided by util-linux. During the building process, if util-linux hasn't been DO_POPULATE_SYSROOTed yet, other packages depending on quilt will fail! eg:
===========
ERROR: pciutils-3.5.1-r0 do_patch: Command Error: 'quilt --quiltrc /mnt/JenkinsBuild/workspace/CGEL_V6/cgel_v6_tl_mergeci/cgel6x_yocto/build_output/build_aarch64-busybox-console/tmp/sysroots/x86_64-linux/etc/quiltrc push' exited with 0  Output:

/mnt/JenkinsBuild/workspace/CGEL_V6/cgel_v6_tl_mergeci/cgel6x_yocto/build_output/build_aarch64-busybox-console/tmp/sysroots/x86_64-linux/usr/share/quilt/push: line 299: /mnt/JenkinsBuild/workspace/CGEL_V6/cgel_v6_tl_mergeci/cgel6x_yocto/build_output/build_aarch64-busybox-console/tmp/sysroots/x86_64-linux/bin/getopt: No such file or directory

Usage: quilt push [-afqv] [--merge[=merge|diff3]] [--leave-rejects] [--color[=always|auto|never]] [--refresh] [num|patch]

ERROR: pciutils-3.5.1-r0 do_patch: Function failed: patch_do_patch

ERROR: Logfile of failure stored in: /mnt/JenkinsBuild/workspace/CGEL_V6/cgel_v6_tl_mergeci/cgel6x_yocto/build_output/build_aarch64-busybox-console/tmp/work/aarch64-poky-linux/pciutils/3.5.1-r0/temp/log.do_patch.4368

NOTE: recipe pciutils-3.5.1-r0: task do_patch: Failed

ERROR: Task (/mnt/JenkinsBuild/workspace/CGEL_V6/cgel_v6_tl_mergeci/cgel6x_yocto/sources/poky/meta/recipes-bsp/pciutils/pciutils_3.5.1.bb:do_patch) failed with exit code '1'

==========

In further debugging, I found that quilt has an private implementation on getopt, to fix this bug, just pass "--without-getopt" to EXTRA_OECONF of quilt-native.inc.
Comment 1 Richard Purdie 2018-12-20 15:43:25 UTC
pciutils 3.5.1 looks to be a version that is from before pyro. In pyro we added recipe specific sysroots and getopt is listed in HOSTTOOLS.

This bug therefore looks to be morty or earlier and is outside of our support window *and* has been fixed in releases beyond morty.

If this is a problem in rocko onwards, please reopen.