Bug 11683

Summary: sanity.bbclass: bblayers.conf upgrade broken for versions 5 to 7
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Patrick Ohly <patrick.ohly>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: NEW --- QA Contact: nagarajagopal <nagarajagopalx.velu>
Severity: normal    
Priority: Medium CC: ee.peng.yeoh, meta.mr.watcher, meta.watcher, nagarajagopalx.velu, randy.macleod, sgw
Version: unspecified   
Target Milestone: 6.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Patrick Ohly 2017-06-16 20:21:47 UTC
When a distro happens to enter the 5 to 7 (inclusive) range for LCONF_VERSION, then updating existing bblayers.conf files no longer works as expected. Expected is that a developer is asked to manually update his bblayers.conf; what happens instead is that some special code in OE-core kicks in which claims to update the file without actually doing anything.

The root cause is that OE-core contains code that must have been valid at some point for some distro (Poky?) but that doesn't do the right thing for other distros.

Refkit is now hitting this problem.

Patch was sent back in May ("bblayers sanity: bblayers.conf.sample specific update code") but hasn't been merged, so let me file a bug to also get this problem prioritize through the bug triage.
Comment 1 Patrick Ohly 2017-06-22 14:56:33 UTC
Richard has concerns about the approach taken in my patch, so we need to go back to the design phase and come up with something better.

YinThong, we left this assigned to you as you have time for it. We can discuss how to approach this via chat (I'm pohly on IRC).
Comment 2 Patrick Ohly 2017-06-23 09:16:51 UTC
Related to bug #11686.
Comment 3 nagarajagopal 2017-10-20 07:12:02 UTC
Verification log,

 1) clone refkit
 2) source oe-init-build-env
 3) change LCONF_VERSION = "6" n build/conf/bblayers.conf file.
 4) run command bitbake refkit-image-minimal

 error log file ,
  NOTE: Your conf/bblayers.conf has been automatically updated.
ERROR: Your version of bblayers.conf has the wrong LCONF_VERSION (has 7, expecting 9).
Please compare your file against bblayers.conf.sample and merge any changes before continuing.
"meld conf/bblayers.conf /home/raj/refkit/intel-iot-refkit/openembedded-core/../meta-refkit/conf/bblayers.conf.sample"
Comment 4 Patrick Ohly 2017-10-20 09:08:23 UTC
(In reply to comment #3)
> Verification log,
> 
>  1) clone refkit
>  2) source oe-init-build-env
>  3) change LCONF_VERSION = "6" n build/conf/bblayers.conf file.
>  4) run command bitbake refkit-image-minimal
> 
>  error log file ,
>   NOTE: Your conf/bblayers.conf has been automatically updated.
> ERROR: Your version of bblayers.conf has the wrong LCONF_VERSION (has 7,
> expecting 9).
> Please compare your file against bblayers.conf.sample and merge any changes
> before continuing.
> "meld conf/bblayers.conf
> /home/raj/refkit/intel-iot-refkit/openembedded-core/../meta-refkit/conf/
> bblayers.conf.sample"

You can't reproduce the problem with refkit because we worked around the issue by skipping the problematic range of version numbers. The request to merge manually is only printed because the current LCONF_VERSION is 9.
Comment 5 nagarajagopal 2017-10-30 04:25:20 UTC
 I reproduced the problem with poky, LCONF_VERSION is 9 and done changes in /meta/classes/sanity.bbclass file as per below link,

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/classes/sanity.bbclass?id=6d3d4baeebc850492d523419683348cffa2d63b0

LCONF_VERSION = "9" is giving error pop out message and LCONF_VERSION = "7" is building error without pop out message.
Comment 6 nagarajagopal 2017-10-30 04:26:30 UTC

 LCONF_VERSION = "9" is giving error pop out message and LCONF_VERSION = "7" is building without pop out message.
Comment 7 Rebecca Chang 2017-12-11 09:40:00 UTC
https://patchwork.openembedded.org/patch/140291/

With reference to the patch above, we prefer not to load the python functions from the distro. I would suggest to move this to backlog and probably we would revisit in future.
Comment 8 Patrick Ohly 2017-12-11 12:56:58 UTC
(In reply to comment #7)
> https://patchwork.openembedded.org/patch/140291/
> 
> With reference to the patch above, we prefer not to load the python
> functions from the distro. I would suggest to move this to backlog and
> probably we would revisit in future.

Can we at least remove the obsolete and broken upgrade code already now?

That will resolve the main issue (not notifying the user when he needs to update manually). What can be deferred is then the reimplementation of automatic bblayers.conf updates.
Comment 9 Rebecca Chang 2017-12-11 13:13:05 UTC
(In reply to comment #8)
> Can we at least remove the obsolete and broken upgrade code already now?
> 
> That will resolve the main issue (not notifying the user when he needs to
> update manually). What can be deferred is then the reimplementation of
> automatic bblayers.conf updates.

Hi Patrick, do you mean we should remove sanity_conf_update from sanity.bbclass? I could try this out and this will require more testing to ensure we did not break anything.
Comment 10 Patrick Ohly 2017-12-11 14:21:43 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Can we at least remove the obsolete and broken upgrade code already now?
> > 
> > That will resolve the main issue (not notifying the user when he needs to
> > update manually). What can be deferred is then the reimplementation of
> > automatic bblayers.conf updates.
> 
> Hi Patrick, do you mean we should remove sanity_conf_update from
> sanity.bbclass?

That and everything else related to rewriting bblayers.conf. Basically, remove everything that my patch https://patchwork.openembedded.org/patch/140291/ removed and don't add anything else instead.
Comment 11 Rebecca Chang 2018-01-11 02:05:09 UTC
https://patchwork.openembedded.org/patch/146975/
Comment 12 Randy MacLeod 2023-10-24 14:24:38 UTC
Bulk move from 4.99 or 0.00 to 5.99