Bug 15967

Summary: PREFERRED_VERSION does not necessarily select highest matching version.
Product: [Build System, Metadata & Runtime] BitBake Reporter: Josef Holzmayr <jester>
Component: bitbakeAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: minor    
Priority: Medium CC: ccasciato, poky.bs.watcher, poky.watcher, randy.macleod, ross.burton
Version: unspecified   
Target Milestone: 5.99   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Josef Holzmayr 2025-09-09 09:22:51 UTC
Steps to reproduce:

Create three recipes with PV 4.0, 4.0.1, 4.1, like
- example_4.0.bb
- example_4.0.1.bb
- example_4.1.bb

Set PREFERRED_VERSION_example = "4.%" in local.conf

bitbake-getvar -r example PV yields 4.0.1.

The naive assumption is that if more than one version matches the wildcard, then the highest one is picked.
Comment 1 Randy MacLeod 2025-09-11 14:46:50 UTC
An oversight that can be reduced with a more specific glob pattern or a specific version.
Solving the problem in general may require being psychic.

- YP Bug review team.