<?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>15026</bug_id>
          
          <creation_ts>2023-02-02 02:50:13 +0000</creation_ts>
          <short_desc>Unable to &quot;devtool build &lt;package&gt;&quot; in /build directory</short_desc>
          <delta_ts>2025-02-14 16:48:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>eSDK</product>
          <component>eSDK</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>IN PROGRESS REVIEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="WeiHeng Cheng">weiheng.cheng</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>sgw</cc>
    
    <cc>weiheng.cheng</cc>
          
          <qa_contact name="Francisco Pedraza">francisco.j.pedraza.gonzalez</qa_contact>
          <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>94844</commentid>
    <comment_count>0</comment_count>
    <who name="WeiHeng Cheng">weiheng.cheng</who>
    <bug_when>2023-02-02 02:50:13 +0000</bug_when>
    <thetext>Overview: 
The &quot;mv&quot; command during devtool build &lt;package&gt; unable to execute as the directory is not empty if the eSDK is installed in /build directory. 

Steps to Reproduce: 
1) Install eSDK in any directory within /build (i.e., /build/username/yocto-esdk/nodistro_sdk)
2) Source the oe environment 
3) devtool modify &lt;package&gt; &amp;&amp; devtool build &lt;package&gt; (i.e., python3-numpy)

Actual Results: 
Subprocess output:
mv: cannot move &apos;/build/username/yocto-esdk/nodistro_sdk/tmp/work/riscv64-oe-linux/python3-numpy/1.22.3-r0/package/usr/src/debug/build/username/yocto-esdk/nodistro_sdk/workspace/sources/python3-numpy/build&apos; to &apos;/build/username/yocto-esdk/nodistro_sdk/tmp/work/riscv64-oe-linux/python3-numpy/1.22.3-r0/package/usr/src/debug/build&apos;: Directory not empty

Expected Results: 
The package should be built without any error. 

Additional Builds and Platforms: 
Using kirkstone branch for openembedded-core on Linux platform. 

Additional Information: 
The line below creates this error, which exists in openembedded-core/meta/classes/package.bbclass in kirkstone &amp; langdale branch. This line is moved to openembedded-core/meta/lib/oe/package.py in master branch. 

cmd = &quot;mv %s%s%s/* %s%s&quot; % (dvar, debugsrcdir, sdir, dvar,debugsrcdir)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94856</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-02-02 15:48:59 +0000</bug_when>
    <thetext>This is a bug but the obvious work-around is to use a different directory name.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94872</commentid>
    <comment_count>2</comment_count>
    <who name="WeiHeng Cheng">weiheng.cheng</who>
    <bug_when>2023-02-03 02:17:21 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; This is a bug but the obvious work-around is to use a different directory
&gt; name.

Yes, I&apos;m aware of the workaround. However, there are systems that use /build directory. FYI, if the &lt;package&gt; uses a directory name same as any directory that exists in /build/username/yocto-esdk/nodistro_sdk/tmp/work/riscv64-oe-linux/&lt;package&gt;/&lt;package-revision&gt;/package/usr/src/debug/, the &quot;devtool build &lt;package&gt;&quot; will encounter the same error. 

Hence, I wonder if the line: 

cmd = &quot;mv %s%s%s/* %s%s&quot; % (dvar, debugsrcdir, sdir, dvar,debugsrcdir)

is replaced with:

cmd = &quot;cp -r %s%s%s/* %s%s &amp;&amp; rm -rf %s%s%s/*&quot; % (dvar, debugsrcdir, sdir, dvar, debugsrcdir, dvar, debugsrcdir, sdir)

will it work without any implication? If this fix can work, I can submit a patch for this. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94927</commentid>
    <comment_count>3</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2023-02-15 00:40:46 +0000</bug_when>
    <thetext>So I tried to reproduce this using a /build/&lt;username&gt;/sdk

NOTE: python3-numpy: compiling from external source tree /build/swold/sdk/workspace/sources/python3-numpy

devtool modify / devool build worked correctly.

The workdir: /build/swold/sdk/tmp/work/core2-64-poky-linux/python3-numpy/1.24.1-r0

I am using the current master branch, it did not reproduce, I guess I need more details.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94961</commentid>
    <comment_count>4</comment_count>
    <who name="WeiHeng Cheng">weiheng.cheng</who>
    <bug_when>2023-02-17 07:36:06 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; So I tried to reproduce this using a /build/&lt;username&gt;/sdk
&gt; 
&gt; NOTE: python3-numpy: compiling from external source tree
&gt; /build/swold/sdk/workspace/sources/python3-numpy
&gt; 
&gt; devtool modify / devool build worked correctly.
&gt; 
&gt; The workdir:
&gt; /build/swold/sdk/tmp/work/core2-64-poky-linux/python3-numpy/1.24.1-r0
&gt; 
&gt; I am using the current master branch, it did not reproduce, I guess I need
&gt; more details.

Hi Saul, 

FYI previously I replicated the error using Kirkstone branch for openembedded-core. I tried to replicate the error using master branch for openembedded-core but end up with no error, as what you found out. 

So, I think you can replicate it if you use Kirkstone branch for openembedded-core. If possible, try to use bitbake version 2.0 and Kirkstone branch for all layers. 

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94965</commentid>
    <comment_count>5</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2023-02-18 01:34:59 +0000</bug_when>
    <thetext>Ok, I missed that it was kirkstone specific, you mentioned it was a line in multiple releases including master.

Please try testing that attached patch which I think helps with this specific case, yes it&apos;s a bit of a corner case due to the /build directory as Randy pointed out.

This moves the internal /usr/src/debug/build to /usr/src/debug/build.build and then does the other move.

I think you might have actually found an issue with master also, which I need to review more carefully.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94966</commentid>
    <comment_count>6</comment_count>
      <attachid>4931</attachid>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2023-02-18 01:40:31 +0000</bug_when>
    <thetext>Created attachment 4931
Patch for testing /build issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94971</commentid>
    <comment_count>7</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2023-02-19 01:30:50 +0000</bug_when>
    <thetext>Please test patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94972</commentid>
    <comment_count>8</comment_count>
    <who name="WeiHeng Cheng">weiheng.cheng</who>
    <bug_when>2023-02-19 06:11:08 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; Ok, I missed that it was kirkstone specific, you mentioned it was a line in
&gt; multiple releases including master.
&gt; 
&gt; Please try testing that attached patch which I think helps with this
&gt; specific case, yes it&apos;s a bit of a corner case due to the /build directory
&gt; as Randy pointed out.
&gt; 
&gt; This moves the internal /usr/src/debug/build to /usr/src/debug/build.build
&gt; and then does the other move.
&gt; 
&gt; I think you might have actually found an issue with master also, which I
&gt; need to review more carefully.

Hi Saul,

The patch works fine, no issue with the &quot;devtool build &lt;package&gt;&quot; command. I also tested the image with edited recipe to make sure everything works fine, sorry for the delay. 

Regarding the issue with master that you&apos;ve mentioned, do you mean that the &quot;dvar + debugsrcdir + sdir&quot; path is missing? 

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94978</commentid>
    <comment_count>9</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2023-02-21 02:04:17 +0000</bug_when>
    <thetext>Patch sent to list</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97156</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-30 15:37:32 +0000</bug_when>
    <thetext>Build move to 5.0 -- ../Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98813</commentid>
    <comment_count>11</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-04-25 01:13:51 +0000</bug_when>
    <thetext>Bulk move of 5.0 medium importance issues to 5.99.
Move to 5.1 if you want to actively work on an issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98874</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-04-25 01:23:13 +0000</bug_when>
    <thetext>Move to 5.99 since no one is actively working on this issue.
Move to 5.x if you start on a task, please.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100966</commentid>
    <comment_count>13</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-02-14 16:46:23 +0000</bug_when>
    <thetext>bulk change to add Saul&apos;s non-WR address.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101032</commentid>
    <comment_count>14</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-02-14 16:48:13 +0000</bug_when>
    <thetext>Bulk change: Remove Saul&apos;s old WR address.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>4931</attachid>
            <date>2023-02-18 01:40:31 +0000</date>
            <delta_ts>2023-02-18 01:40:31 +0000</delta_ts>
            <desc>Patch for testing /build issue</desc>
            <filename>0001-package.bbclase-Add-check-for-build-in-copydebugsour.patch</filename>
            <type>text/plain</type>
            <size>1707</size>
            <attacher name="Saul Wold">saul.wold</attacher>
            
              <data encoding="base64">RnJvbSAwMGJkMGEwYzJiNWM1N2Y3ZjcxMjg5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ICAgc3VicHJvY2Vzcy5jaGVja19vdXRwdXQoY21k
LCBzaGVsbD1UcnVlLCBzdGRlcnI9c3VicHJvY2Vzcy5TVERPVVQpCiAKLS0gCjIuMzUuNgoK
</data>

          </attachment>
      

    </bug>

</bugzilla>