<?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>15288</bug_id>
          
          <creation_ts>2023-11-20 21:55:20 +0000</creation_ts>
          <short_desc>systemtap is not reproducible</short_desc>
          <delta_ts>2024-11-21 22:04:05 +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>OE-Core</product>
          <component>kernel</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>AB-INT</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexandre Belloni">alexandre.belloni</reporter>
          <assigned_to name="Mathieu Dubois-Briand">mathieu.dubois-briand</assigned_to>
          <cc>alexandre.belloni</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>tom.zanussi</cc>
    
    <cc>victor.kamensky7</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97284</commentid>
    <comment_count>0</comment_count>
    <who name="Alexandre Belloni">alexandre.belloni</who>
    <bug_when>2023-11-20 21:55:20 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3955/steps/13/logs/stdio

https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20231120-n7gjv4_t/packages/diff-html/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97286</commentid>
    <comment_count>1</comment_count>
    <who name="Alexandre Belloni">alexandre.belloni</who>
    <bug_when>2023-11-20 22:16:26 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3950/steps/13/logs/stdio</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97291</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandre Belloni">alexandre.belloni</who>
    <bug_when>2023-11-20 22:41:16 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3940/steps/12/logs/stdio</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97313</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-11-23 15:42:16 +0000</bug_when>
    <thetext>release-4.8-74-g418f0a45-dirty vs release-4.9a-dirty</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97314</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-11-23 15:42:44 +0000</bug_when>
    <thetext>from http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20231120-n7gjv4_t/packages/diff-html/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97315</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-11-23 15:43:40 +0000</bug_when>
    <thetext>Likely useing git describe in the build...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97316</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-11-23 15:47:18 +0000</bug_when>
    <thetext>Yeah that&apos;s a `git describe` call thats not reproducible because they pushed a tag. We need a patch to rip out the git describe and just replace it with PV.

Ideally, in an upstreamable way, because this is a relatively common pattern and we&apos;ve a few places where we force the version directly.  If we&apos;re lucky there&apos;s already an option to override the value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97623</commentid>
    <comment_count>7</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2023-12-19 18:48:25 +0000</bug_when>
    <thetext>There&apos;s a relatively extensive script that gathers information about the git repository.

It isn&apos;t easy to replace it with PV, since the script is called from the Makefiles and there&apos;s no single variable to override all the callsites.

We could always modify the generated version file AFTER configure runs, or we could remove .git before starting the build (I still support the recipe coming directly from git, but this would be a workaround).

There&apos;s one thing that I&apos;m not understanding / seeing though.

Between the two runs that aren&apos;t reproducible, the script should be returning the same tag, as the repository is the same, and it isn&apos;t using a git hash from a local commit.

What is the scenario between the two runs that is triggering the different version ? (all my runs are exactly the same).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97624</commentid>
    <comment_count>8</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-12-19 20:36:54 +0000</bug_when>
    <thetext>So what&apos;s happening is that they&apos;re using &quot;git describe&quot; and that isn&apos;t stable over time.

At one point in time the SHA 418f0a45 was 78 commits ahead of the &quot;release-4.8&quot; tag.  Then in a later build another git fetch had been done and that shame SHA is now the &quot;release-4.9a&quot; tag.

Thus: shame SHA, different embedded version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97625</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-12-19 20:40:00 +0000</bug_when>
    <thetext>That&apos;s an annoying implementation of git-version, some take a version override from the environment.  Might be worth hacking that in and sending it upstream.

Alternatively building from a tarball would also work, if they make them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97627</commentid>
    <comment_count>10</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2023-12-19 21:07:58 +0000</bug_when>
    <thetext>(In reply to Ross Burton from comment #8)
&gt; So what&apos;s happening is that they&apos;re using &quot;git describe&quot; and that isn&apos;t
&gt; stable over time.
&gt; 
&gt; At one point in time the SHA 418f0a45 was 78 commits ahead of the
&gt; &quot;release-4.8&quot; tag.  Then in a later build another git fetch had been done
&gt; and that shame SHA is now the &quot;release-4.9a&quot; tag.
&gt; 
&gt; Thus: shame SHA, different embedded version.

That&apos;s what I mean.

I wouldn&apos;t want that to be the same version, as it isn&apos;t.

I only see this as a problem if the script is pulling in a different answer from the same SRCREV on two different machines, or a different answer on the same machine on two different builds.

Just embed the +git in the PV and let the SRCPV background stuff take care of the versioning.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97628</commentid>
    <comment_count>11</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2023-12-19 21:09:10 +0000</bug_when>
    <thetext>(In reply to Bruce Ashfield from comment #10)
&gt; (In reply to Ross Burton from comment #8)
&gt; &gt; So what&apos;s happening is that they&apos;re using &quot;git describe&quot; and that isn&apos;t
&gt; &gt; stable over time.
&gt; &gt; 
&gt; &gt; At one point in time the SHA 418f0a45 was 78 commits ahead of the
&gt; &gt; &quot;release-4.8&quot; tag.  Then in a later build another git fetch had been done
&gt; &gt; and that shame SHA is now the &quot;release-4.9a&quot; tag.
&gt; &gt; 
&gt; &gt; Thus: shame SHA, different embedded version.
&gt; 
&gt; That&apos;s what I mean.
&gt; 
&gt; I wouldn&apos;t want that to be the same version, as it isn&apos;t.
&gt; 
&gt; I only see this as a problem if the script is pulling in a different answer
&gt; from the same SRCREV on two different machines, or a different answer on the
&gt; same machine on two different builds.
&gt; 
&gt; Just embed the +git in the PV and let the SRCPV background stuff take care
&gt; of the versioning.

I should also say, that the bouncing/moving tag is not something that commonly happens.

So I don&apos;t think spending a lot of effort to worry about it, is a good use of time.

Spending</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100163</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-11-14 15:56:04 +0000</bug_when>
    <thetext>Fix underway/merged. A bit more work to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100181</commentid>
    <comment_count>13</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-11-15 11:22:59 +0000</bug_when>
    <thetext>(In reply to Bruce Ashfield from comment #10)
&gt; (In reply to Ross Burton from comment #8)
&gt; &gt; So what&apos;s happening is that they&apos;re using &quot;git describe&quot; and that isn&apos;t
&gt; &gt; stable over time.
&gt; &gt; 
&gt; &gt; At one point in time the SHA 418f0a45 was 78 commits ahead of the
&gt; &gt; &quot;release-4.8&quot; tag.  Then in a later build another git fetch had been done
&gt; &gt; and that shame SHA is now the &quot;release-4.9a&quot; tag.
&gt; &gt; 
&gt; &gt; Thus: shame SHA, different embedded version.
&gt; 
&gt; That&apos;s what I mean.
&gt; 
&gt; I wouldn&apos;t want that to be the same version, as it isn&apos;t.
&gt; 
&gt; I only see this as a problem if the script is pulling in a different answer
&gt; from the same SRCREV on two different machines, or a different answer on the
&gt; same machine on two different builds.
&gt; 
&gt; Just embed the +git in the PV and let the SRCPV background stuff take care
&gt; of the versioning.

I think there is a bit of confusion here. We&apos;re talking about a recipe with the same SRCREV, that doesn&apos;t change.

What does change is the &quot;git describe&quot; output as upstream adds more commits.

If I run it today I can see one output from git describe. If I run it later even on the same checked out revision, the string can change depending on what was pushed to the upstream repo in the meantime.

This does break reproducibility as we want stable output.

I do therefore think we need to do something to fix this...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100182</commentid>
    <comment_count>14</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-11-15 11:26:52 +0000</bug_when>
    <thetext>The version information coming from the script:

Makefile.am:GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh
Makefile.am:	$(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h
Makefile.in:GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh
Makefile.in:	$(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h

i.e. git_version.sh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100183</commentid>
    <comment_count>15</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-11-15 11:31:27 +0000</bug_when>
    <thetext>My proposal is we just patch ${S}/version.h not to use the git codepath. A really simple patch, yes, we&apos;d have to carry it but it should be simple.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100192</commentid>
    <comment_count>16</comment_count>
    <who name="Victor Kamensky">victor.kamensky7</who>
    <bug_when>2024-11-18 04:11:25 +0000</bug_when>
    <thetext>STAP_EXTENDED_VERSION is defined in version.h as

#ifdef GIT_REPO
#define STAP_EXTENDED_VERSION \
  (STAP_EXTRA_VERSION[0] ? GIT_MESSAGE &quot;, &quot; STAP_EXTRA_VERSION : GIT_PRETTY_REV)
#else
#define STAP_EXTENDED_VERSION \
  (STAP_EXTRA_VERSION[0] ? STAP_EXTRA_VERSION : GIT_MESSAGE)
#endif

STAP_EXTRA_VERSION could be defined with configure --with-extra-version option (i.e --with-extra-version=&quot;oe&quot;) in this case instead of GIT_PRETTY_REV (that
I understand causes problem and comes from &apos;git describe&apos; will not be used.

In this case --version output would be something like this:

./tmp/work/x86_64-linux/systemtap-native/5.2/build/stap --version
Systemtap translator/driver (version 5.2/0.191, git branch master, url sourceware.org/git/systemtap.git, commit 3a92ffe673c1621309a0b60892114495b651c9de-dirty, oe)
Copyright (C) 2005-2024 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 3.10 ... 6.12-rc
enabled features: BOOST_STRING_REF BPF PYTHON3 LIBSQLITE3 PROLOGUES READLINE MONITOR_LIBS JSON_C LIBDEBUGINFOD

As far as I understand it would be reproducible since githash is fixed from
SRCREV, and &apos;dirty&apos; comes from our patches.

Is it acceptable solution? If so, I can include adding --with-extra-version=&quot;oe&quot;
to EXTRA_OECONF along with SystemTap 5.2 update that I am currently testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100225</commentid>
    <comment_count>17</comment_count>
    <who name="Victor Kamensky">victor.kamensky7</who>
    <bug_when>2024-11-20 22:45:49 +0000</bug_when>
    <thetext>Fix with --with-extra-version &quot;oe&quot; was merged to master:
https://git.openembedded.org/openembedded-core/commit/?id=37fb7c4e469baf53f85319c3cbb75af41a6ddbe7
Please retest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100247</commentid>
    <comment_count>18</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-11-21 22:04:05 +0000</bug_when>
    <thetext>Thanks for the fix Victor, it gets rid of another annoying intermittent issue! :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>