<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13086</bug_id>
          
          <creation_ts>2018-12-17 02:25:27 +0000</creation_ts>
          <short_desc>Indirect depends on getopt will cause do_patch failures.</short_desc>
          <delta_ts>2018-12-20 15:43:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Lin Zhang">zhang.lin16</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82513</commentid>
    <comment_count>0</comment_count>
      <attachid>4412</attachid>
    <who name="Lin Zhang">zhang.lin16</who>
    <bug_when>2018-12-17 02:25:27 +0000</bug_when>
    <thetext>Created attachment 4412
A fix solution

In poky/meta/classes/patch.bbclass, I found patch_do_patch depends on &quot;${PATCHTOOL}-native:do_populate_sysroot&quot;. 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&apos;t been DO_POPULATE_SYSROOTed yet, other packages depending on quilt will fail! eg:
===========
ERROR: pciutils-3.5.1-r0 do_patch: Command Error: &apos;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&apos; 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 &apos;1&apos;

==========

In further debugging, I found that quilt has an private implementation on getopt, to fix this bug, just pass &quot;--without-getopt&quot; to EXTRA_OECONF of quilt-native.inc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82547</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2018-12-20 15:43:25 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4412</attachid>
            <date>2018-12-17 02:25:27 +0000</date>
            <delta_ts>2018-12-17 02:25:27 +0000</delta_ts>
            <desc>A fix solution</desc>
            <filename>0001-fix-potential-patch-failure-caused-by-incorrect-depe.patch</filename>
            <type>application/octet-stream</type>
            <size>860</size>
            <attacher name="Lin Zhang">zhang.lin16</attacher>
            
              <data encoding="base64">RnJvbSAyOTNmMGZhNGYwY2UxYWQ1YzdmZmFjMGZjNzZlZTlkYWFhODYyM2IwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiB6aGFuZ2xpbiA8emhhbmcubGluMTZAenRlLmNvbS5jbj4KRGF0
ZTogTW9uLCAxNyBEZWMgMjAxOCAxMDoyMzoyOSArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIGZpeCBw
b3RlbnRpYWwgcGF0Y2ggZmFpbHVyZSBjYXVzZWQgYnkgaW5jb3JyZWN0IGRlcGVuZGVuY3kgb2YK
IHF1aWx0CgpTaWduZWQtb2ZmLWJ5OiB6aGFuZ2xpbiA8emhhbmcubGluMTZAenRlLmNvbS5jbj4K
LS0tCiBtZXRhL3JlY2lwZXMtZGV2dG9vbHMvcXVpbHQvcXVpbHQtbmF0aXZlLmluYyB8IDIgKy0K
IDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdp
dCBhL21ldGEvcmVjaXBlcy1kZXZ0b29scy9xdWlsdC9xdWlsdC1uYXRpdmUuaW5jIGIvbWV0YS9y
ZWNpcGVzLWRldnRvb2xzL3F1aWx0L3F1aWx0LW5hdGl2ZS5pbmMKaW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