<?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>15498</bug_id>
          
          <creation_ts>2024-05-28 04:36:40 +0000</creation_ts>
          <short_desc>random staging issues since UNPACKDIR introduction</short_desc>
          <delta_ts>2024-08-06 08:34:43 +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>oe-core other</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>major</bug_severity>
          <target_milestone>5.1 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kweihmann</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>tgamblin</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>99096</commentid>
    <comment_count>0</comment_count>
    <who name="">kweihmann</who>
    <bug_when>2024-05-28 04:36:40 +0000</bug_when>
    <thetext>Since the changes related to `UNPACKDIR` I see random hard/softlink issues with staging.

E.g.

File: &apos;exec_func_python() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:extend_recipe_sysroot(d)
     0003:
File: &apos;/opt/build/sources/poky/meta/classes-global/staging.bbclass&apos;, lineno: 539, function: extend_recipe_sysroot
     0535:                continue
     0536:
     0537:        msg_adding.append(c)
     0538:
 *** 0539:        os.symlink(c + &quot;.&quot; + taskhash, depdir + &quot;/&quot; + c)
     0540:
     0541:        manifest, d2 = oe.sstatesig.find_sstate_manifest(c, setscenedeps[dep][2], &quot;populate_sysroot&quot;, d, multilibs)
     0542:        if d2 is not d:
     0543:            # If we don&apos;t do this, the recipe sysroot will be placed in the wrong WORKDIR for multilibs
Exception: FileNotFoundError: [Errno 2] No such file or directory: &apos;python3-build-native.a02f3a216f80e615a959ea4fb1273cebb0e26a3228154905281ee93bb45da422&apos; -&gt; &apos;/opt/build/build/tmp/work/x86_64-linux/python3-shellexeclist-native/1.10.2/recipe-sysroot-native/installeddeps/python3-build-native&apos;

ERROR: Logfile of failure stored in: /opt/build/build/tmp/work/x86_64-linux/python3-shellexeclist-native/1.10.2/temp/log.do_prepare_recipe_sysroot.104702
NOTE: recipe python3-shellexeclist-native-1.10.2-r0: task do_prepare_recipe_sysroot: Failed
ERROR: python3-shellexeclist-native-1.10.2-r0 do_unpack: CalledProcessError(1, [&apos;rm&apos;, &apos;-rf&apos;, &apos;/opt/build/build/tmp/work/x86_64-linux/python3-shellexeclist-native/1.10.2&apos;])
NOTE: recipe python3-shellexeclist-native-1.10.2-r0: task do_unpack: Failed

The recipes in question are random, but all of them so far are -native recipes.

With a local patch that retries the symlinking with a little backoff time everything works out much more nicely.

The same has been seen with this code line https://git.yoctoproject.org/poky/tree/meta/classes-global/staging.bbclass#n165

In before (the UNPACKDIR change) the same code base was working flawlessly.

Seen locally and in Github cloud</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99108</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-05-31 16:26:31 +0000</bug_when>
    <thetext>Looking at this, the rm -rf in do_unpack is removing WORKDIR. Can you look at the python3-shellexeclist-native recipe and see what S is set to please?

I&apos;ve like to understand why it is removing WORKDIR. We should be erroring for S = WORKDIR now so that shouldn&apos;t happen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99109</commentid>
    <comment_count>2</comment_count>
    <who name="">kweihmann</who>
    <bug_when>2024-05-31 17:16:13 +0000</bug_when>
    <thetext>S = &quot;${UNPACKDIR}/git&quot;
that&apos;s what set in the recipe.

The thing I&apos;m worried about is that seem
to affect random recipes, even if they all share the same S pattern</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99113</commentid>
    <comment_count>3</comment_count>
    <who name="">kweihmann</who>
    <bug_when>2024-06-01 08:10:36 +0000</bug_when>
    <thetext>OK I think I figured it out.
For pre-styhead the layer in question contained a weak fallback definition of UNPACKDIR.
Set to UNPACKDIR ??= WORKDIR.

Just send a patch to error out on this.

Would it be possible to define UNPACKDIR ?= ... in base?
Like that ??= as a fallback definition would not override the default, this is btw what I learned today about ??= behavior</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99116</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-06-03 14:22:00 +0000</bug_when>
    <thetext>https://lists.openembedded.org/g/openembedded-core/topic/106405273#msg200061

I can see arguments both ways on this one :/.

Thanks for the sanity test patch though, I&apos;ll queue that and get that in.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99495</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-08-06 08:34:43 +0000</bug_when>
    <thetext>Since https://git.yoctoproject.org/poky/commit/?id=3bb4c6bd18a088f20ee343cf7c96aabe73fa8ca0 has merged, we shouldn&apos;t run into this issue any more so marking as resolved.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>