Bug 15466

Summary: devtool uses a gitsm URI for a version not using submodules if HEAD does
Product: [Build System, Metadata & Runtime] OE-Core Reporter: alexandre.truong
Component: devtools / tool chainAssignee: alexandre.truong
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod, tim.orling, vincent, yoann.congal
Version: unspecified   
Target Milestone: 5.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description alexandre.truong 2024-04-04 14:20:30 UTC
devtool's submodule detection seems to check HEAD for sub-modules but not the version we're asking.

Link to a patch to workaround this in the test-suite (test_devtool_add_git_style2)
:
https://lists.openembedded.org/g/openembedded-core/message/197961

In the test, the mbedtls repo is used and triggered this with this patch on the development branch (the main one):
https://github.com/Mbed-TLS/mbedtls/commit/456a54da8ef44c8b725b524567c08cffec6a7214
The test asks for the 3.1.0 version which does not contain sub-modules.

How to reproduce the problem:
devtool add --version v3.1.0 mbedtls git://git@github.com/ARMmbed/mbedtls.git;protocol=https
# We should have git://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master
 we get gitsm://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master
Comment 1 Vincent Kriek 2024-04-14 19:15:57 UTC
This is not an issue with devtool not setting the correct URI for a version, but the --version not being used for anything else but setting the "PV" value in the recipe. The version it will check out from git will be the same as if no version is specified.

If I add mbedtls by doing: 
> devtool add --srcrev v3.1.0 mbedtls git://git@github.com/ARMmbed/mbedtls.git

it checks out the correct tag and sets the SRC_URI as expected.
> SRC_URI = "git://git@github.com/ARMmbed/mbedtls.git;protocol=ssh;branch=master"

To fix this issue I ould change the command to set both the --srcrev and the --version:
> devtool add --srcrev v3.1.0 --version v3.1.0 mbedtls git://git@github.com/ARMmbed/mbedtls.git