Re: [PATCH 2/2] package.bbclass: manage external sources for debug source file packaging
From: Frederic Martinsons <hidden>
Date: 2021-06-23 13:10:04
Hello, I would like to add a link to a yocto mail where I expose my problematic that led to this patch series: https://lists.yoctoproject.org/g/yocto/topic/83622035?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,83622035 After further research, I think these patch can be simplified by modified only WORKDIR variable to be os.path.dirname(EXTERNALSRC) but I fear of consequence to have WORKDIR outside of TMPDIR so I didn't take this path. On Wed, 23 Jun 2021 at 15:06, Frederic Martinsons < frederic.martinsons@gmail.com> wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Frederic Martinsons <redacted> --- meta/classes/package.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index cf30f33f3d..38e9065f25 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass@@ -560,13 +560,20 @@ def copydebugsources(debugsrcdir, sources, d): strip = d.getVar("STRIP") objcopy = d.getVar("OBJCOPY") workdir = d.getVar("WORKDIR") - workparentdir = os.path.dirname(os.path.dirname(workdir)) + externalsrc = d.getVar('EXTERNALSRC') + if externalsrc: + workparentdir = os.path.dirname(externalsrc) + else: + workparentdir = os.path.dirname(os.path.dirname(workdir)) + workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" +os.path.basename(workdir) # If build path exists in sourcefile, it means toolchain did not use # -fdebug-prefix-map to compile if checkbuildpath(sourcefile, d): localsrc_prefix = workparentdir + "/" + elif externalsrc: + localsrc_prefix = os.path.join("/usr/src/debug/", workbasedir) + "/" else: localsrc_prefix = "/usr/src/debug/" -- 2.25.1