mbox series

[0/2] devtool: fix finish for recipes using AUTOREV

Message ID 20260713060444.7-1-bbnpreetsingh@gmail.com
Headers show
Series devtool: fix finish for recipes using AUTOREV | expand

Message

Babanpreet Singh July 13, 2026, 6:04 a.m. UTC
devtool finish (and devtool update-recipe in srcrev mode) crashes with
"fatal: bad revision 'AUTOINC'" on any recipe with SRCREV = "${AUTOREV}",
e.g. one created with devtool add --autorev, because the unresolved
AUTOREV placeholder is passed to git format-patch as the base revision
for exporting patches.

Patch 1 uses the initial revision(s) recorded in the workspace bbappend
instead (as patch mode already does), and stops replacing the AUTOREV
with a pinned revision on finish. Patch 2 adds the oe-selftest case
Randy asked for in the bug; it fails with the exact reported error
before patch 1 and passes after.

While investigating I verified this is not a recent regression: the
same crash reproduces on wrynose, whinlatter, scarthgap and kirkstone,
so it most likely dates back to the introduction of --autorev.

Tested on oe-core master in a qemux86-64 build environment:
- devtool add --autorev + devtool finish: fails before, passes after,
  finished recipe keeps SRCREV = "${AUTOREV}"
- devtool add (pinned) + devtool finish: unchanged
- oe-selftest -r devtool.DevtoolAddTests.test_devtool_add_git_autorev_finish
  (new): PASSED
- oe-selftest -r devtool.DevtoolUpdateTests.test_devtool_update_recipe_git
  devtool.DevtoolUpdateTests.test_devtool_update_recipe_append_git: PASSED

[YOCTO #16354]

Babanpreet Singh (2):
  devtool: standard: fix finish/update-recipe for recipes using AUTOREV
  oeqa/selftest/devtool: add test for finishing a recipe using AUTOREV

 meta/lib/oeqa/selftest/cases/devtool.py | 32 +++++++++++++++++++++++++
 scripts/lib/devtool/standard.py         | 16 +++++++++++--
 2 files changed, 46 insertions(+), 2 deletions(-)