<?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>15148</bug_id>
          
          <creation_ts>2023-06-20 15:03:58 +0000</creation_ts>
          <short_desc>Is uninative-tarball reproducible?</short_desc>
          <delta_ts>2024-03-22 17:58:28 +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>core</component>
          <version>4.1.4</version>
          <rep_platform>All</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>JPEWhacker</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>95754</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-20 15:03:58 +0000</bug_when>
    <thetext>I created a new workflow with github/gitea actions and observed, that whenever I bitbake unintaive-tarball a different sha256sum is created.

Is this a known problem?

I will switch to something closer to master and give it another try.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95772</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-06-21 09:27:17 +0000</bug_when>
    <thetext>It isn&apos;t a known issue, no. I&apos;d be interested to understand a bit more about where the differences are inside the tarballs. diffoscope is good at helping identify those issues. Please do let us know if that happens with master too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95797</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-06-22 14:36:49 +0000</bug_when>
    <thetext>Please run the tests that Richard requested.- YP bug review</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95825</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-27 06:40:24 +0000</bug_when>
    <thetext>Maybe my test case is flawed and I need SSTATE involved?

Here is what I do:

1) uninative-tarball --runall=fetch

2) create a tarball from the sources and add them to some web server

3) site.conf excerpt:

UNINATIVE_TARBALL=&quot;&quot;
UNINATIVE_CHECKSUM[x86_64]=&quot;954182f691bb2dbae157ee991654ad2fd4cb51c7f3d3ab429e9f84654c8dc990&quot;
INHERIT += &quot;own-mirrors&quot;
SOURCE_MIRROR_URL = &quot;file:///workspace/rber/yocto-build-docker-action/workdir/source_mirror/&quot;
SRCREV:pn-ascii-invaders = &quot;2644be38afc06f7f7bba55034966dd66d9ad524f&quot;
BB_NO_NETWORK = &quot;1

4) local SSTATE_DIR, DL_DIR empty, 

5) bitbake uninative-tarball

If I do that 2 times I get different results.

===

The first problem I detected was, that if I INHERIT += &quot;image-buildinfo&quot; it creates in the tarball a buildinfo file and DATETIME = 20230624080445 differs with different builds.
So I removed the image-buildinfo class from my configuration.

===

Still the checksum differs.

I tried with diffoscope, but it seems to run out of memory all the time (magic.MagicException: b&apos;Output buffer space exceeded 1038+20&apos;)

Here[1] is some diffoscope output when I only compare the etc:

[1] https://pastebin.com/9TKsfach

It&apos;s not master (yet) I will try it as soon as I find some more time, but here is my build output attached[2]. 

[2] https://drive.google.com/drive/folders/1Y1vKYCi-4TEyRqlcnyHhPeVcn-wUpzSb?usp=sharing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95827</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-27 15:45:17 +0000</bug_when>
    <thetext>I am staring to suspect that something is wrong with the xz compression ;)

1) md5sum on unpacked files:

if [ -d unzip ]; then
   rm -rf unzip
fi

mkdir unzip

pushd unzip

tar xf ../x86_64-nativesdk-libc.tar.xz

find -type f \( -not -name &quot;md5sum.txt&quot; \) -exec md5sum &apos;{}&apos; \; &gt; md5sum.txt

mv md5sum.txt ../../3.7-md5sum.txt

popd

If I diff the md5sums they are identical ;)

2) filesize is different:

+ diff 3.7-ls 3.7.ori-ls
1c1
&lt; -rw-r--r-- 1 rber rber 10517496 Jun 26 19:30 x86_64-nativesdk-libc.tar.xz
---
&gt; -rw-r--r-- 1 rber rber 10472856 Jun 26 18:57 x86_64-nativesdk-libc.tar.xz

3) sha256sum is different

+ diff 3.7-sha256sum 3.7.ori-sha256sum
1c1
&lt; 0d2fbb42ac43942f79f01228e9178fa020b9349c607d041020aafe72de828698  x86_64-nativesdk-libc.tar.xz
---
&gt; 237fb8bc21f5ab092c590bfbb0300a57d161af78317e05d4c81bb5dbaf416520  x86_64-nativesdk-libc.tar.xz

4) xz analysis is different:

+ diff 3.7-xz-lvv 3.7.ori-xz-lvv
4c4
&lt;   Compressed size:    10.0 MiB (10,517,496 B)
---
&gt;   Compressed size:    10.0 MiB (10,472,856 B)
6c6
&lt;   Ratio:              0.020
---
&gt;   Ratio:              0.019
11c11
&lt;          1         3               0               0      10,517,496     537,323,520  0.020  CRC64            0
---
&gt;          1         3               0               0      10,472,856     537,323,520  0.019  CRC64            0
14,16c14,16
&lt;          1         1              12               0       2,838,320     201,326,592  0.014  CRC64      52bfb8d78735c230      20  cu          2,838,290      65 MiB  --lzma2=dict=64MiB
&lt;          1         2       2,838,332     201,326,592       3,000,080     201,326,592  0.015  CRC64      bec544b6964ca059      20  cu          3,000,049      65 MiB  --lzma2=dict=64MiB
&lt;          1         3       5,838,412     402,653,184       4,679,040     134,670,336  0.035  CRC64      15177e5b5aee9516      20  cu          4,679,012      65 MiB  --lzma2=dict=64MiB
---
&gt;          1         1              12               0       2,815,944     201,326,592  0.014  CRC64      1294ec05da356697      20  cu          2,815,913      65 MiB  --lzma2=dict=64MiB
&gt;          1         2       2,815,956     201,326,592       2,978,612     201,326,592  0.015  CRC64      a0dcc97d77de4299      20  cu          2,978,583      65 MiB  --lzma2=dict=64MiB

&gt;          1         3       5,794,568     402,653,184       4,678,244     134,670,336  0.035  CRC64      7a5c0920eedcf24a      20  cu          4,678,215      65 MiB  --lzma2=dict=64MiB


full report:

+ cat 3.7-xz-lvv
x86_64-nativesdk-libc.tar.xz (1/1)
  Streams:            1
  Blocks:             3
  Compressed size:    10.0 MiB (10,517,496 B)
  Uncompressed size:  512.4 MiB (537,323,520 B)
  Ratio:              0.020
  Check:              CRC64
  Stream padding:     0 B
  Streams:
    Stream    Blocks      CompOffset    UncompOffset        CompSize      UncompSize  Ratio  Check      Padding
         1         3               0               0      10,517,496     537,323,520  0.020  CRC64            0
  Blocks:
    Stream     Block      CompOffset    UncompOffset       TotalSize      UncompSize  Ratio  Check      CheckVal          Header  Flags        CompSize    MemUsage  Filters
         1         1              12               0       2,838,320     201,326,592  0.014  CRC64      52bfb8d78735c230      20  cu          2,838,290      65 MiB  --lzma2=dict=64MiB
         1         2       2,838,332     201,326,592       3,000,080     201,326,592  0.015  CRC64      bec544b6964ca059      20  cu          3,000,049      65 MiB  --lzma2=dict=64MiB
         1         3       5,838,412     402,653,184       4,679,040     134,670,336  0.035  CRC64      15177e5b5aee9516      20  cu          4,679,012      65 MiB  --lzma2=dict=64MiB
  Memory needed:      65 MiB
  Sizes in headers:   Yes
  Minimum XZ Utils version: 5.0.0
+ cat 3.7.ori-xz-lvv
x86_64-nativesdk-libc.tar.xz (1/1)
  Streams:            1
  Blocks:             3
  Compressed size:    10.0 MiB (10,472,856 B)
  Uncompressed size:  512.4 MiB (537,323,520 B)
  Ratio:              0.019
  Check:              CRC64
  Stream padding:     0 B
  Streams:
    Stream    Blocks      CompOffset    UncompOffset        CompSize      UncompSize  Ratio  Check      Padding
         1         3               0               0      10,472,856     537,323,520  0.019  CRC64            0
  Blocks:
    Stream     Block      CompOffset    UncompOffset       TotalSize      UncompSize  Ratio  Check      CheckVal          Header  Flags        CompSize    MemUsage  Filters
         1         1              12               0       2,815,944     201,326,592  0.014  CRC64      1294ec05da356697      20  cu          2,815,913      65 MiB  --lzma2=dict=64MiB
         1         2       2,815,956     201,326,592       2,978,612     201,326,592  0.015  CRC64      a0dcc97d77de4299      20  cu          2,978,583      65 MiB  --lzma2=dict=64MiB
         1         3       5,794,568     402,653,184       4,678,244     134,670,336  0.035  CRC64      7a5c0920eedcf24a      20  cu          4,678,215      65 MiB  --lzma2=dict=64MiB
  Memory needed:      65 MiB
  Sizes in headers:   Yes
  Minimum XZ Utils version: 5.0.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95835</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-29 10:21:00 +0000</bug_when>
    <thetext>In order to get a reproducible tar archive we need to take care about

*) owner
*) group
*) timestamps

Owner and group are taking care of[1] like that:

SDKTAROPTS = &quot;--owner=root --group=root&quot;

But timestamps are not!

Something like this would fix it:

SDKTAROPTS_ADDON ?= &quot;--mtime=&apos;1970-01-01 00:00:00&apos;&quot;

d.setVar(&apos;SDK_ARCHIVE_CMD&apos;, &apos;cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} ${SDKTAROPTS_ADDON} -cf - . | xz ${SDK_XZ_OPTIONS} &gt; ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}&apos;)

[1] https://git.yoctoproject.org/poky/tree/meta/classes-recipe/populate_sdk_base.bbclass</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95836</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-06-29 10:50:59 +0000</bug_when>
    <thetext>For mtime we often do things like &quot;--clamp-mtime --mtime=@${SOURCE_DATE_EPOCH}&quot;, would that work here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95837</commentid>
    <comment_count>7</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-29 11:31:08 +0000</bug_when>
    <thetext>@RP: I will give it a try.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95838</commentid>
    <comment_count>8</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-29 12:52:18 +0000</bug_when>
    <thetext>it seems to do the trick:

cat 3.7/sha256sum.txt 
772ed808389b3e3051c69e58e2b63c022ce5c7d5d241b1fb26ca465c0089a94e
cat 3.7.ori/sha256sum.txt 
772ed808389b3e3051c69e58e2b63c022ce5c7d5d241b1fb26ca465c0089a94e

I will create a patch and send it upstream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95840</commentid>
    <comment_count>9</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-29 14:06:11 +0000</bug_when>
    <thetext>patch:

https://lists.openembedded.org/g/openembedded-core/message/183628</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95844</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-06-29 14:44:45 +0000</bug_when>
    <thetext>Underway on the email list. Thanks Robert! -- YP bug review</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95870</commentid>
    <comment_count>11</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-30 07:00:13 +0000</bug_when>
    <thetext>https://patchwork.yoctoproject.org/project/oe-core/patch/20230629140258.5635-1-Robert.Berger@ReliableEmbeddedSystems.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95873</commentid>
    <comment_count>12</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-30 13:18:23 +0000</bug_when>
    <thetext>v2 is on it&apos;s way:

https://lists.openembedded.org/g/openembedded-core/message/183694</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95874</commentid>
    <comment_count>13</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-06-30 15:42:25 +0000</bug_when>
    <thetext>https://patchwork.yoctoproject.org/project/oe-core/patch/20230630131430.5051-1-Robert.Berger@ReliableEmbeddedSystems.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96626</commentid>
    <comment_count>14</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-05 15:01:06 +0000</bug_when>
    <thetext>Oneline change patch on list. To be merged.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97705</commentid>
    <comment_count>15</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2023-12-22 12:16:09 +0000</bug_when>
    <thetext>My understanding is, that this patch is OK and should go upstream. It it trapped since 2023-06-30 in patchwork. Is there anything else I should/can do about it to get it upstream?

... and ..

if we believe what the doc says[1] and the uninative tarball is rebuilt whenever the eSDK is built and included in the eSDK, than the eSDK is non reproducible as well without this patch.

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=13920</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98069</commentid>
    <comment_count>16</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2024-01-31 12:00:41 +0000</bug_when>
    <thetext>It looks like it made it upstream[1]

[1] https://git.yoctoproject.org/poky/tree/meta/classes-recipe/populate_sdk_base.bbclass#n288

So we can close it, I guess.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98593</commentid>
    <comment_count>17</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-03-22 17:58:28 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/?id=23549b87c597f1c7b8492dbdacaf88e4e4b6ee76</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>