Skip to contentSkip to conversation

package.bbclase: Add check for /build in copydebugsources()

PATCH In review Saul Wold 2 participants 3 messages Feb 20, 2023 – Feb 21, 2023

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH 1/1 package.bbclase: Add check for /build in copydebugsources()

This is needed when the SDK or eSDK is installed in a /build top level directory as it conflicts with the build directory within the existing /usr/src/debug/build (which is really a link). Rename it and then do the copy, this is not an issue with master currently due to some other changes that occurred in master.

Fixes [YOCTO #15026]
---
 meta/classes/package.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
meta/classes/package.bbclass +7 -0
index 8b11fdd155..2950218145 100644
@@ -636,6 +636,13 @@ def copydebugsources(debugsrcdir, sources, d):
         # Same check as above for externalsrc
         if workdir not in sdir:
             if os.path.exists(dvar + debugsrcdir + sdir):
+                # Special case for /build since we need to move into
+                # /usr/src/debug/build so rename sdir to build.build
+                if sdir.find("/build") == 0:
+                    cmd = "mv %s%s%s %s%s%s" % (dvar, debugsrcdir, "/build", dvar, debugsrcdir, "/build.build")
+                    subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+                    sdir = sdir.replace("/build", "/build.build", 1)
+
                 cmd = "mv %s%s%s/* %s%s" % (dvar, debugsrcdir, sdir, dvar,debugsrcdir)
                 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
 
Signature · 1 line
2.35.6
#1 lore raw
Quoted 8 lines · Saul Wold

This is needed when the SDK or eSDK is installed in a /build top level directory as it conflicts with the build directory within the existing /usr/src/debug/build (which is really a link). Rename it and then do the copy,

this is not an issue with master currently due to some other changes that occurred in master.

Is this an issue in master or not? I can't parse that! :)

Cheers,

Richard

Quoted 26 lines
Fixes [YOCTO #15026]
---
 meta/classes/package.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
meta/classes/package.bbclass +7 -0
index 8b11fdd155..2950218145 100644
@@ -636,6 +636,13 @@ def copydebugsources(debugsrcdir, sources, d):
         # Same check as above for externalsrc
         if workdir not in sdir:
             if os.path.exists(dvar + debugsrcdir + sdir):
+                # Special case for /build since we need to move into
+                # /usr/src/debug/build so rename sdir to build.build
+                if sdir.find("/build") == 0:
+                    cmd = "mv %s%s%s %s%s%s" % (dvar, debugsrcdir, "/build", dvar, debugsrcdir, "/build.build")
+                    subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+                    sdir = sdir.replace("/build", "/build.build", 1)
+
                 cmd = "mv %s%s%s/* %s%s" % (dvar, debugsrcdir, sdir, dvar,debugsrcdir)
                 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
 
#2 lore raw
Quoted 7 lines · Richard Purdie
Quoted 5 lines · Saul Wold

This is needed when the SDK or eSDK is installed in a /build top level directory as it conflicts with the build directory within the existing /usr/src/debug/build (which is really a link). Rename it and then do the copy,

Quoted 5 lines
Quoted 2 lines

this is not an issue with master currently due to some other changes that occurred in master.

Is this an issue in master or not? I can't parse that! :)
Oops, sorry this is meant for Kirkstone branch, their is a different problem in master since the code was refactored a direct backport is not possible.

Oops, sorry this is meant for Kirkstone branch, the code in master was refactored and seems to have solved the problem since /us/src/debug now has $PN/$PV components in the path.

I will resend it as kirkstone specific.

Sau!

Quoted 30 lines

Cheers,

Richard

Quoted 26 lines
Fixes [YOCTO #15026]
---
  meta/classes/package.bbclass | 7 +++++++
  1 file changed, 7 insertions(+)
meta/classes/package.bbclass +7 -0
index 8b11fdd155..2950218145 100644
@@ -636,6 +636,13 @@ def copydebugsources(debugsrcdir, sources, d):
          # Same check as above for externalsrc
          if workdir not in sdir:
              if os.path.exists(dvar + debugsrcdir + sdir):
+                # Special case for /build since we need to move into
+                # /usr/src/debug/build so rename sdir to build.build
+                if sdir.find("/build") == 0:
+                    cmd = "mv %s%s%s %s%s%s" % (dvar, debugsrcdir, "/build", dvar, debugsrcdir, "/build.build")
+                    subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+                    sdir = sdir.replace("/build", "/build.build", 1)
+
                  cmd = "mv %s%s%s/* %s%s" % (dvar, debugsrcdir, sdir, dvar,debugsrcdir)
                  subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)