Bug 13748

Summary: bitbake doesn't detect changes in code to run do_compile when using devtool modify on recipe with destsuffix
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Scott Branden <scott.branden>
Component: devtools / tool chainAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: jon.richardson, meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, tim.orling
Version: unspecified   
Target Milestone: 3.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
rwmem recipe modified to demonstrate bitbake task do_compile not working none

Description Scott Branden 2020-01-23 21:21:02 UTC
Created attachment 4616 [details]
rwmem recipe modified to demonstrate bitbake task do_compile not working

bitbake does not detect changes in code that has been modified if destsuffix is specified in the SRC_URI of the recipe.  I have simplified the rwmem recipe from the meta-openembedded layer to demonstrate.

To reproduce:

devtool modify rwmem
bitbake rwmem
(do_configure, do_compile, do_install as expected)

bitbake rwmem
(nothing changed - expected)

touch workspace/sources/rwmem/ext/inih/test
bitbake rwmem
(BUG - nothing run do_compile and do_install should run)

touch workspace/sources/rwmem/test
bitbake rwmem
(RUNS - because not in the destsuffix part of the recipe)
Comment 1 Scott Branden 2020-01-23 21:21:32 UTC
Recipe placed here so you don't need to look at the attachment:

SUMMARY = "rwmemTesting"
DESCRIPTION = "rwmemTesting"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"

PV .= "+git${SRCPV}"

SRCREV_rwmem = "3ec3e421211b58e766651c2e3a3a21acf14a1906"
SRCREV_inih = "4b10c654051a86556dfdb634c891b6c3224c4109"

SRCREV_FORMAT = "rwmem_inih"

SRC_URI = " \
    git://github.com/tomba/rwmem.git;protocol=https;name=rwmem \
    git://github.com/benhoyt/inih.git;protocol=https;name=inih;nobranch=1;destsuffix=git/ext/inih \
"

S = "${WORKDIR}/git"

do_configure() {
  bbwarn "Testing do_configure"
}

do_compile() {
  bbwarn "Testing do_compile"
}

do_install() {
  bbwarn "Testing do_install"
}
Comment 2 Scott Branden 2020-02-24 22:13:00 UTC
Hi Robert,
Have you been able to reproduce?
Comment 3 Scott Branden 2020-07-02 15:55:26 UTC
Bug still present in master branch of yocto
Comment 4 Scott Branden 2021-02-06 05:41:52 UTC
Bug seems to have been fixed by this commit:

externalsrc: Detect code changes in submodules
The srctree_hash was calculated only from main source directory ignoring
changes in submodules.

[YOCTO #13748]

Use submodule--helper to determine all submodules, and calculate hash
from all git tree objects names combined.

(From OE-Core rev: 50ff9afb3990bcf60b4fa1f937506cb84028c32d)

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>org>
Comment 5 Scott Branden 2021-02-06 05:42:01 UTC
Bug seems to have been fixed by this commit:

externalsrc: Detect code changes in submodules
The srctree_hash was calculated only from main source directory ignoring
changes in submodules.

[YOCTO #13748]

Use submodule--helper to determine all submodules, and calculate hash
from all git tree objects names combined.

(From OE-Core rev: 50ff9afb3990bcf60b4fa1f937506cb84028c32d)

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>org>
Comment 6 Scott Branden 2021-02-10 22:32:21 UTC
Fixed in commit "externalsrc: Detect code changes in submodules"
Comment 7 Randy MacLeod 2021-02-11 17:12:08 UTC
Here's the link to that commit for those interested:
http://cgit.openembedded.org/openembedded-core/commit/?id=50ff9afb3990bcf60b4fa1f937506cb84028c32d