Bug 16212 - bitbake-setup: build/conf change detection limited to source updates
Summary: bitbake-setup: build/conf change detection limited to source updates
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 6.0
Hardware: All Multiple
: Medium normal
Target Milestone: 6.1
Assignee: Alexander Kanavin
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-03-25 03:23 UTC by Clayton Casciato
Modified: 2026-04-10 12:21 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clayton Casciato 2026-03-25 03:23:02 UTC
Potential problem: on `update`, a change to build/conf/local.conf is only detected on a source update

Potential behavior: on `update`, change is detected even when no source updates occur

I discovered this discrepancy while configuring Scarthgap, where local.conf may be populated using TEMPLATECONF.

Setup:
```
test-bbs$ git clone https://git.openembedded.org/bitbake bitbake

test-bbs$ git -C bitbake checkout a70c336790a9188aae67975fac6ca13579ad1d3e

test-bbs$ cp bitbake/default-registry/configurations/oe-nodistro-master.conf.json oe-nodistro-custom.conf.json

test-bbs$ sed -i '8{s/^\([[:space:]]*\).*/\1"rev": "a70c336790a9188aae67975fac6ca13579ad1d3e"/;}' oe-nodistro-custom.conf.json
test-bbs$ sed -i '15{s/^\([[:space:]]*\).*/\1"rev": "be8cdcf13a658e9e81ff2f7b71d1c8c37a920ce7"/;}' oe-nodistro-custom.conf.json
test-bbs$ sed -i '22{s/^\([[:space:]]*\).*/\1"rev": "d97cfeaa55ed42722998d3313c1857aa377f6881"/;}' oe-nodistro-custom.conf.json

test-bbs$ ./bitbake/bin/bitbake-setup init --non-interactive --setup-dir-name oe-nodistro-custom oe-nodistro-custom.conf.json nodistro machine/qemuarm64

test-bbs$ . bitbake-builds/oe-nodistro-custom/build/init-build-env
```

Introduce change:
```
test-bbs$ echo "# Modification detection test" >> bitbake-builds/oe-nodistro-custom/build/conf/local.conf
```

local.conf change undetected:
```
test-bbs$ ./bitbake/bin/bitbake-setup update
NOTE: Bitbake-setup is using [...]/test-bbs/bitbake-builds as top directory.
NOTE: Reading configuration from local file
    [...]/test-bbs/oe-nodistro-custom.conf.json

Configuration in [...]/test-bbs/bitbake-builds/oe-nodistro-custom has not changed.
```

local.conf change detected on a source change (e.g. BitBake):
```
test-bbs$ sed -i '8{s/^\([[:space:]]*\).*/\1"rev": "112bddd8fc684fbdd71139429251b127739f863b"/;}' oe-nodistro-custom.conf.json

test-bbs$ ./bitbake/bin/bitbake-setup update
[...]

Upstream bitbake configuration changes were found:
diff '--color=always' -uNr [...]/test-bbs/bitbake-builds/oe-nodistro-custom/build/conf-backup.20260324205715/local.conf [...]/test-bbs/bitbake-builds/oe-nodistro-custom/build/conf/local.conf
--- [...]/test-bbs/bitbake-builds/oe-nodistro-custom/build/conf-backup.20260324205715/local.conf      2026-03-24 20:54:31.919838770 -0600
+++ [...]/test-bbs/bitbake-builds/oe-nodistro-custom/build/conf/local.conf    2026-03-24 20:57:15.544151275 -0600
@@ -5,4 +5,3 @@
 # it is recommended to put them into a distro config, or to create
 # layer fragments from changes made here.
 #
-# Modification detection test
```

This is also detected with a change to a different source (e.g. OE-C):
```
test-bbs$ sed -i '15{s/^\([[:space:]]*\).*/\1"rev": "aa441c5d7c306fb308cb7890a8ebe3cd218780b5"/;}' oe-nodistro-custom.conf.json

test-bbs$ ./bitbake/bin/bitbake-setup update
[...]

Upstream bitbake configuration changes were found:
[...]
```
Comment 1 Alexander Kanavin 2026-03-26 15:31:14 UTC
But is this a real problem? Is there a use case? If you make modifications in build/conf, I don't think bitbake-setup should track what you do there and compare that against 'pristine' build/conf, if nothing has otherwise changed. That would be heavy handed: people modify build/conf all the time, and they don't need bitbake-setup telling them their local modifications caused the build to become 'out of date'.

The build/conf comparison only kicks in when updates happened elsewhere (e.g. in config template, or layer revisions changed), because then build/conf may have changed as well, and it needs to be setup anew, and compared with the existing one. At that point there's no way to tell what was original, and what was added by the user. Bitbake-setup could potentially track that too (by putting a copy of the original build/conf into a local git under config/), but again, I do not see the use case clearly, but I do see increased code complexity that would result.
Comment 2 Clayton Casciato 2026-03-30 14:50:39 UTC
Thanks for the feedback, Alex!

I do not have a sample use case where this is required.

Related to the original finding, it would be convenient to be able to configure the default value of `--update-bb-conf` (per Setup).
This is most relevant for sans-fragment builds (e.g. Scarthgap), where the "no" option would be handy.
Comment 3 Randy MacLeod 2026-04-09 15:05:55 UTC
Alex ?
Comment 4 Alexander Kanavin 2026-04-10 12:21:09 UTC
Alright. Closing for lack of clear use case.