<?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>15377</bug_id>
          
          <creation_ts>2024-01-31 13:14:37 +0000</creation_ts>
          <short_desc>${D}/sysroot-only has race between do_populate_sysroot and do_package</short_desc>
          <delta_ts>2024-10-10 12:08:09 +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>unspecified</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></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Callum Moffat">callum</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>98072</commentid>
    <comment_count>0</comment_count>
    <who name="Callum Moffat">callum</who>
    <bug_when>2024-01-31 13:14:37 +0000</bug_when>
    <thetext>If both do_package and do_populate_sysroot tasks need to be run for a recipe, they may both run at the same time, because there isn&apos;t any specific dependency between them, besides the fact they both depend on do_install. If the /sysroot-only feature is used, it can cause an issue, because do_package may delete the /sysroot-only directory before do_populate_sysroot can copy it to the sysroot directory.

If you use /sysroot-only, you could force the dependency with the following snippet in recipe

do_package[depends] += &quot;${PN}:do_populate_sysroot&quot;

But I think in oe-core, staging.bbclass and/or package.bbclass should be adjusted to avoid this race by default. Either the task order could be specified, or do_package could be changed to avoid mutating ${D}.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98087</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-02-01 15:01:00 +0000</bug_when>
    <thetext>We need to stop it chamging ${D}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98090</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-02-01 15:43:44 +0000</bug_when>
    <thetext>Not a common error and unlikely so medium priority.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99808</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-10-10 11:42:52 +0000</bug_when>
    <thetext>Callum: where you using an old release when you found this bug?  It appears to be resolved with poky f2016af0399250d2378818758c704c37a96e2ed6 which was in 4.1 onwards.

Basically the patch does this:

-        shutil.rmtree(sysroot_only)

-    cmd = &apos;tar -cf - -C %s -p -S . | tar -xf - -C %s&apos; % (dest, dvar)
+    cmd = &apos;tar --exclude=./sysroot-only -cf - -C %s -p -S . | tar -xf - -C %s&apos; % (dest, dvar)

Closing as I believe this is fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99812</commentid>
    <comment_count>4</comment_count>
    <who name="Callum Moffat">callum</who>
    <bug_when>2024-10-10 12:08:09 +0000</bug_when>
    <thetext>Oh you&apos;re right I am not at 4.1 yet. Yeah that snippet would fix it. Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>