Overview: The "mv" command during devtool build <package> 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 <package> && devtool build <package> (i.e., python3-numpy) Actual Results: Subprocess output: mv: cannot move '/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' to '/build/username/yocto-esdk/nodistro_sdk/tmp/work/riscv64-oe-linux/python3-numpy/1.22.3-r0/package/usr/src/debug/build': 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 & langdale branch. This line is moved to openembedded-core/meta/lib/oe/package.py in master branch. cmd = "mv %s%s%s/* %s%s" % (dvar, debugsrcdir, sdir, dvar,debugsrcdir)
This is a bug but the obvious work-around is to use a different directory name.
(In reply to comment #1) > This is a bug but the obvious work-around is to use a different directory > name. Yes, I'm aware of the workaround. However, there are systems that use /build directory. FYI, if the <package> uses a directory name same as any directory that exists in /build/username/yocto-esdk/nodistro_sdk/tmp/work/riscv64-oe-linux/<package>/<package-revision>/package/usr/src/debug/, the "devtool build <package>" will encounter the same error. Hence, I wonder if the line: cmd = "mv %s%s%s/* %s%s" % (dvar, debugsrcdir, sdir, dvar,debugsrcdir) is replaced with: cmd = "cp -r %s%s%s/* %s%s && rm -rf %s%s%s/*" % (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!
So I tried to reproduce this using a /build/<username>/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.
(In reply to comment #3) > So I tried to reproduce this using a /build/<username>/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. 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!
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'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.
Created attachment 4931 [details] Patch for testing /build issue
Please test patch
(In reply to comment #5) > 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'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. Hi Saul, The patch works fine, no issue with the "devtool build <package>" 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've mentioned, do you mean that the "dvar + debugsrcdir + sdir" path is missing? Thanks!
Patch sent to list
Build move to 5.0 -- ../Randy
Bulk move of 5.0 medium importance issues to 5.99. Move to 5.1 if you want to actively work on an issue.
Move to 5.99 since no one is actively working on this issue. Move to 5.x if you start on a task, please.
bulk change to add Saul's non-WR address.
Bulk change: Remove Saul's old WR address.