Bug 13533

Summary: Devtool finish on _git package with SRCPV in PV points to wrong WORKDIR
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jaewon Lee <jaewon>
Component: Scripts and ToolsAssignee: David Reyna <david.reyna>
Status: IN PROGRESS REVIEW --- QA Contact:
Severity: normal    
Priority: Medium+ CC: alex.kanavin, bluelightning, bruce.ashfield, ccasciato, randy.macleod, richard.purdie, ross.burton
Version: 3.0   
Target Milestone: 6.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Jaewon Lee 2019-09-17 00:22:00 UTC
Taking blktrace package as an example,

First do a devtool modify blktrace,

workdir while devtool workspace exists for blktrace will be for ex. blktrace/1.2.0+git999-r0  because in externalsrc.bbclass if  SRCPV is in PV, SRCPV is changed to 999. 

but in devtool finish, this data store: rd = parse_recipe(config, tinfoil, args.recipename, True)

will not reflect that change if you do a rd.getVar('WORKDIR'), SRCPV will not be changed to 999, so you can point to build artifacts in devtool finish using WORKDIR.
Comment 1 Jaewon Lee 2019-09-17 00:42:31 UTC
After investigation, its due to filter_workspace being default true for parse_recipe definition in devtool/__init__.py

for modify I get the reasoning for filtering out devtool workspace, but is there a reason for filtering out devtool workspace for finish?
if I turn filtering off for the parse_recipe call in finish, it behaves as expected

we need WORKDIR to be correct during finish. just as an example, this ccmake patch where is looking for generated cfg or cmake files and this wont work in cases where SRCPV is in PV

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=89c4424d6d875e102ca324d3b81426b4466dccc5
Comment 2 Jaewon Lee 2019-09-20 16:43:35 UTC
Patch sent on mailing list
[OE-core][master][PATCH] standard.py: Not filtering devtool workspace for devtool finish
Comment 3 Jaewon Lee 2019-09-20 18:10:05 UTC
Also if this change gets merged, we should take another look at devtool cfg generation because right now it gets written to $S

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=73bf792c858752008fe174840dad1171eee86635

quote from the commit:
"${S}/.config will be a symlink to ${B}/.config. We need to do this as
    devtool is not able to access ${B} because ${B} is set in a .bbappend in
    the workspace layer which is not parsed by devtool itself."

but we should align with bitbake method of writing to B if devtool can access correct $B
Comment 5 Randy MacLeod 2020-03-26 15:12:31 UTC
Please retest with the latest tinfoil datastore connector changes.
Comment 6 Randy MacLeod 2021-04-29 15:28:06 UTC
ping
Comment 7 Randy MacLeod 2021-07-15 15:09:41 UTC
Any update?
Comment 8 David Reyna 2023-06-22 09:42:40 UTC
I have a new intern to help understand and resolve this issue.