<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13303</bug_id>
          
          <creation_ts>2019-04-21 16:47:59 +0000</creation_ts>
          <short_desc>git fetcher should verify tags for releases</short_desc>
          <delta_ts>2025-02-27 16:00:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>2.7</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Bunk">bunk</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>JPEWhacker</cc>
    
    <cc>p.lobacz</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83626</commentid>
    <comment_count>0</comment_count>
    <who name="Adrian Bunk">bunk</who>
    <bug_when>2019-04-21 16:47:59 +0000</bug_when>
    <thetext>Especially due to the instability of github tarball releases it has become common to use the git fetcher also for releases.

This leads to the following problem:

--- a/meta/recipes-kernel/cryptodev/cryptodev.inc
+++ b/meta/recipes-kernel/cryptodev/cryptodev.inc
@@ -4,7 +4,7 @@ LICENSE = &quot;GPLv2&quot;
 LIC_FILES_CHKSUM = &quot;file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263&quot;

 SRC_URI = &quot;git://github.com/cryptodev-linux/cryptodev-linux&quot;
-SRCREV = &quot;fd8b15ef1c8398a69a37932ee48c74ab40329a29&quot;
+SRCREV = &quot;f971e0cd4a0ebe59fb2e8e17240399bf6901b09b&quot;

This change does move the package from a release to a git snapshot, but both look the same and it is impossible to see or review what is going on.

It should be assumed that every upstream release is tagged, and then the tag made mandatory for SRCREV that match a release.

Then could be checked automatically with (pseudo-code):
  if(TAG) (commit(TAG) == SRCREV)
  TAG xor (PV contains &quot;+git&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90437</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-05-20 15:32:11 +0000</bug_when>
    <thetext>We already have the option of adding a tag to the SRC_URI which the SRCREV would be verified against. We could then make it a general policy that the URL should have a tag specified in it for OE-Core recipes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94963</commentid>
    <comment_count>2</comment_count>
    <who name="Piotr Łobacz">p.lobacz</who>
    <bug_when>2023-02-17 17:53:27 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; We already have the option of adding a tag to the SRC_URI which the SRCREV
&gt; would be verified against. We could then make it a general policy that the
&gt; URL should have a tag specified in it for OE-Core recipes?

I am trying to use tag with git fetcher and it causes me a problem like that https://www.openembedded.org/pipermail/openembedded-core/2017-November/144422.html

and my SRCREV is pointing me to the correct hash.

My bitbake is 2.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94981</commentid>
    <comment_count>3</comment_count>
    <who name="Piotr Łobacz">p.lobacz</who>
    <bug_when>2023-02-22 09:25:01 +0000</bug_when>
    <thetext>OK,I have found a solution for that issue. I need to set nobranch=1 and tag=hash_value of tag release. By hash_value for a tag release I mean the hash of the that e.g. which can be returned by `git ls-remote --tags &lt;remote_branch&gt; refs/tags/&lt;tag_id&gt;`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101246</commentid>
    <comment_count>4</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2025-02-27 16:00:18 +0000</bug_when>
    <thetext>We don&apos;t want to move away from SRCREV specifying SHA-1, but it would also be useful to be able to mark a way for the fetcher to check if a specified tag matches that SHA-1, perhaps something sort of like:

 SRCREV = &quot;f971e0cd4a0ebe59fb2e8e17240399bf6901b09b&quot;
 SRCREF_TAG = &quot;v1.0.0&quot;

(although another mechanism might be preferred). This would give the best of both worlds where we are fixed to a SHA-1, but it would be clearly indicated what tag that tag is supposed to be, and we would be notified if upstream did something silly like move a tag</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101247</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2025-02-27 16:00:47 +0000</bug_when>
    <thetext>That should be SRCREV_TAG for reference</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>