<?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>13709</bug_id>
          
          <creation_ts>2019-12-16 14:40:36 +0000</creation_ts>
          <short_desc>Buildhistory race when building sdk and eSDK in parallel</short_desc>
          <delta_ts>2020-07-25 07:14:30 +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>core</component>
          <version>3.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>autobuilder NEWCOMER AB-INT</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.2 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Chee Yang">chee.yang.lee</assigned_to>
          <cc>akuster</cc>
    
    <cc>matthew.zeng</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tim.orling</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>85837</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-12-16 14:40:36 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/73/builds/1356

Looks like a buildhistory race when sdk and eSDK are running in parallel:

NOTE: recipe core-image-sato-1.0-r0: task do_sdk_depends: Succeeded
NOTE: Running task 8949 of 8949 (/home/pokybuild/yocto-worker/qemux86-64/build/meta/recipes-sato/images/core-image-sato.bb:do_populate_sdk_ext)
NOTE: recipe core-image-sato-1.0-r0: task do_populate_sdk_ext: Started
ERROR: core-image-sato-1.0-r0 do_populate_sdk: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:do_populate_sdk(d)
     0003:
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/meta/classes/populate_sdk_base.bbclass&apos;, lineno: 169, function: do_populate_sdk
     0165:
     0166:    populate_sdk(d)
     0167:
     0168:fakeroot python do_populate_sdk() {
 *** 0169:    populate_sdk_common(d)
     0170:}
     0171:SSTATETASKS += &quot;do_populate_sdk&quot;
     0172:SSTATE_SKIP_CREATION_task-populate-sdk = &apos;1&apos;
     0173:do_populate_sdk[cleandirs] = &quot;${SDKDEPLOYDIR}&quot;
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/meta/classes/populate_sdk_base.bbclass&apos;, lineno: 166, function: populate_sdk_common
     0162:                    manifest_type=Manifest.MANIFEST_TYPE_SDK_HOST)
     0163:    create_manifest(d, manifest_dir=d.getVar(&apos;SDK_DIR&apos;),
     0164:                    manifest_type=Manifest.MANIFEST_TYPE_SDK_TARGET)
     0165:
 *** 0166:    populate_sdk(d)
     0167:
     0168:fakeroot python do_populate_sdk() {
     0169:    populate_sdk_common(d)
     0170:}
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/meta/lib/oe/sdk.py&apos;, lineno: 413, function: populate_sdk
     0409:    env_bkp = os.environ.copy()
     0410:
     0411:    img_type = d.getVar(&apos;IMAGE_PKGTYPE&apos;)
     0412:    if img_type == &quot;rpm&quot;:
 *** 0413:        RpmSdk(d, manifest_dir).populate()
     0414:    elif img_type == &quot;ipk&quot;:
     0415:        OpkgSdk(d, manifest_dir).populate()
     0416:    elif img_type == &quot;deb&quot;:
     0417:        DpkgSdk(d, manifest_dir).populate()
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/meta/lib/oe/sdk.py&apos;, lineno: 42, function: populate
     0038:    def populate(self):
     0039:        self.mkdirhier(self.sdk_output)
     0040:
     0041:        # call backend dependent implementation
 *** 0042:        self._populate()
     0043:
     0044:        # Don&apos;t ship any libGL in the SDK
     0045:        self.remove(os.path.join(self.sdk_output, self.sdk_native_path,
     0046:                         self.d.getVar(&apos;libdir_nativesdk&apos;).strip(&apos;/&apos;),
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/meta/lib/oe/sdk.py&apos;, lineno: 182, function: _populate
     0178:        self.install_locales(self.host_pm)
     0179:
     0180:        self.host_pm.run_intercepts(populate_sdk=&apos;host&apos;)
     0181:
 *** 0182:        execute_pre_post_process(self.d, self.d.getVar(&quot;POPULATE_SDK_POST_HOST_COMMAND&quot;))
     0183:
     0184:        if not bb.utils.contains(&quot;SDKIMAGE_FEATURES&quot;, &quot;package-management&quot;, True, False, self.d):
     0185:            self.host_pm.remove_packaging_data()
     0186:
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/meta/lib/oe/utils.py&apos;, lineno: 260, function: execute_pre_post_process
     0256:    for cmd in cmds.strip().split(&apos;;&apos;):
     0257:        cmd = cmd.strip()
     0258:        if cmd != &apos;&apos;:
     0259:            bb.note(&quot;Executing %s ...&quot; % cmd)
 *** 0260:            bb.build.exec_func(cmd, d)
     0261:
     0262:# For each item in items, call the function &apos;target&apos; with item as the first
     0263:# argument, extraargs as the other arguments and handle any exceptions in the
     0264:# parent thread
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/bitbake/lib/bb/build.py&apos;, lineno: 250, function: exec_func
     0246:    with bb.utils.fileslocked(lockfiles):
     0247:        if ispython:
     0248:            exec_func_python(func, d, runfile, cwd=adir)
     0249:        else:
 *** 0250:            exec_func_shell(func, d, runfile, cwd=adir)
     0251:
     0252:    try:
     0253:        curcwd = os.getcwd()
     0254:    except:
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/bitbake/lib/bb/build.py&apos;, lineno: 451, function: exec_func_shell
     0447:    with open(fifopath, &apos;r+b&apos;, buffering=0) as fifo:
     0448:        try:
     0449:            bb.debug(2, &quot;Executing shell function %s&quot; % func)
     0450:            with open(os.devnull, &apos;r+&apos;) as stdin, logfile:
 *** 0451:                bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
     0452:        finally:
     0453:            os.unlink(fifopath)
     0454:
     0455:    bb.debug(2, &quot;Shell function %s finished&quot; % func)
File: &apos;/home/pokybuild/yocto-worker/qemux86-64/build/bitbake/lib/bb/process.py&apos;, lineno: 182, function: run
     0178:        if not stderr is None:
     0179:            stderr = stderr.decode(&quot;utf-8&quot;)
     0180:
     0181:    if pipe.returncode != 0:
 *** 0182:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0183:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of &apos;/home/pokybuild/yocto-worker/qemux86-64/build/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/temp/run.buildhistory_get_sdk_installed_host.9350&apos; failed with exit code 1:
rm: cannot remove ‘/home/pokybuild/yocto-worker/qemux86-64/build/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/bh_installed_pkgs.txt’: No such file or directory
WARNING: exit code 1 from a shell command.


ERROR: Logfile of failure stored in: /home/pokybuild/yocto-worker/qemux86-64/build/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/temp/log.do_populate_sdk.9350
NOTE: recipe core-image-sato-1.0-r0: task do_populate_sdk: Failed
ERROR: Task (/home/pokybuild/yocto-worker/qemux86-64/build/meta/recipes-sato/images/core-image-sato.bb:do_populate_sdk) failed with exit code &apos;1&apos;
NOTE: recipe core-image-sato-1.0-r0: task do_populate_sdk_ext: Succeeded</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86778</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-03-23 10:29:07 +0000</bug_when>
    <thetext>Happened again: https://autobuilder.yoctoproject.org/typhoon/#/builders/59/builds/1713</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87656</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-06-28 23:32:39 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/53/builds/2099</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87662</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-06-30 07:06:55 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/73/builds/2092/steps/8/logs/step2b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87814</commentid>
    <comment_count>4</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2020-07-21 07:34:18 +0000</bug_when>
    <thetext>for eSDK, buildhistory are by default disabled in SDK_INHERIT_BLACKLIST. 
it seems like in these build eSDK do INHERIT buildhistory, is this expected?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87823</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-07-22 14:42:53 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; for eSDK, buildhistory are by default disabled in SDK_INHERIT_BLACKLIST. 
&gt; it seems like in these build eSDK do INHERIT buildhistory, is this expected?

Those would be applied when the eSDK is running but not while eSDK itself is being built. The error happens when the eSDK is being built at the same time as an SDK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87833</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-07-25 07:14:30 +0000</bug_when>
    <thetext>Thanks for the fix!: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=4eef15704a58f65514d7e7b43d8abe3b3f78fcca</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>