Bug 15472

Summary: devtool add fails to create tags when tag.gpgSign is set
Product: [Yocto Project Subprojects] eSDK Reporter: 90degs2infty
Component: eSDKAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact: Francisco Pedraza <francisco.j.pedraza.gonzalez>
Severity: normal    
Priority: Medium CC: ccasciato, randy.macleod, saisneha196
Version: 4.3.4   
Target Milestone: 6.1   
Hardware: All   
OS: Multiple   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description 90degs2infty 2024-04-23 07:02:00 UTC
On a fresh install of the eSDK, `devtool add` fails when the user has `tag.gpgSign` enabled in the git config.

```
$ git config --get tag.gpgSign
true
$ devtool add <some-repo>
NOTE: Starting bitbake server...
NOTE: Starting bitbake server...
INFO: Fetching <some-repo>...
WARNING: You are using a local hash equivalence server but have configured an sstate mirror. This will likely mean no sstate will match from the mirror. You may wish to disable the hash equivalence use (BB_HASHSERVE), or use a hash equivalence server alongside the sstate mirror.
Loading cache: 100% |##########################################################################################| Time: 0:00:00
Loaded 1844 entries from dependency cache.
Parsing recipes: 100% |########################################################################################| Time: 0:00:01
Parsing of 913 .bb files complete (912 cached, 1 parsed). 1845 targets, 61 skipped, 0 masked, 0 errors.

Summary: There was 1 WARNING message.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#####################################################################################| Time: 0:00:00
Sstate summary: Wanted 1 Local 0 Mirrors 0 Missed 1 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 3 tasks of which 0 didn't need to be rerun and all succeeded.
INFO: Fetching submodules...
INFO: Using default source tree path <some-path>
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)... (06:18:29.073018)
NOTE: Reconnecting to bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)... (06:18:29.073018)
NOTE: Retrying server connection (#1)... (06:18:29.073018)
NOTE: Starting bitbake server...
Traceback (most recent call last):
  File "/path/to/esdk/sysroots/x86_64-pokysdk-linux/usr/bin/devtool", line 349, in <module>
    ret = main()
          ^^^^^^
  File "/path/to/esdk/sysroots/x86_64-pokysdk-linux/usr/bin/devtool", line 336, in main
    ret = args.func(args, config, basepath, workspace)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/esdk/layers/build/scripts/lib/devtool/standard.py", line 235, in add
    setup_git_repo(srctree, args.version, 'devtool', d=tinfoil.config_data)
  File "/path/to/esdk/layers/build/scripts/lib/devtool/__init__.py", line 234, in setup_git_repo
    bb.process.run('git tag -f %s' % basetag, cwd=repodir)
  File "/path/to/esdk/layers/build/bitbake/lib/bb/process.py", line 189, in run
    raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
bb.process.ExecutionError: Execution of 'git tag -f devtool-base' failed with exit code 1:
Vim: Error reading input, exiting...

Vim: Finished.
error: There was a problem with the editor 'nvim'.
Please supply the message using either -m or -F option.
```

The reason is - at least to my understanding of git's documentation at [1] - that `git tag` defaults to a lightweight tag only when not asked to sign the tag:

> To create a lightweight tag, don’t supply any of the -a, -s, or -m options, just provide a tag name

With `tag.gpgSign` being set, git defaults to an annotated tag. This then forces git into asking for a tag message, which in turn breaks `devtool add`'s execution.

To fix the issue, simply force git to not sign the commit (I guess auto-generated tags shouldn't be signed anyway) by adding `--no-sign` to above command, i.e. execute `git tag --no-sign -f devtool-base`. See the docs at [2] for additional details.

[1] https://git-scm.com/book/en/v2/Git-Basics-Tagging
[2] https://git-scm.com/docs/git-tag
Comment 1 Randy MacLeod 2024-04-25 14:35:58 UTC
Can you send a patch to the list?

As an aside, we need to fix the general problem of people's git configs conflicting with the assumptions that devtool needs but that's out of scope for this bug.
Comment 2 Randy MacLeod 2025-05-01 14:07:10 UTC
Bulk move of all unassigned 5.2 medium importance bugs to 5.3.
Comment 3 Randy MacLeod 2026-03-26 15:23:03 UTC
Add the --no-sign to git-tag command.
Comment 4 Sai Sneha 2026-06-15 06:45:13 UTC
I would like to work on this bug
Comment 5 Sai Sneha 2026-06-15 06:53:00 UTC
Confirmed fixed in commit b5c84b07b8. Dropping this as no further work needed.
Comment 6 Randy MacLeod 2026-06-16 00:03:00 UTC
Sai, 

I agree that it's fixed.

For next time, some tips / requests:

Put a link in such as the one in question:

https://git.openembedded.org/openembedded-core/commit/?id=b5c84b07b87eafb4f68f7662b6cf26d8b73e3247

a commit ID assumes that it's oe-core which is usually true.
The link makes things easier for anyone who might want confirm the fix.

Also, as is the case, here, you can just resolve the defect.
People will get an email and re-open it if there's a problem.
Other than the automated tests, we don't have a dedicated test team
to run QA on each commit.

Thanks,
../Randy