View Issue Details

IDProjectCategoryView StatusLast Update
0029397CommunityWebsite:Gitpublic2017-12-21 19:54
ReporterabvAssigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Summary0029397: GitWeb produces different snapshot tarballs for the same commit
DescriptionThe problem has been reported by external user:

~~~~~

If I run the following two times in a row, I will get a different sha - note I am specify the V7_2_0 tag.

$ curl -L -o opencascade-7.2.0.tgz "http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_2_0;sf=tgz"
$ openssl sha -sha256 opencascade-7.2.0.tgz
SHA256(opencascade-7.2.0.tgz)= 7aecff59b9f4bc3dda87059c7b91f6d6be1ff0f4d80aef2704e11df51cc4dd1e
$ curl -L -o opencascade-7.2.0.tgz "http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_2_0;sf=tgz"
$ openssl sha -sha256 opencascade-7.2.0.tgz
SHA256(opencascade-7.2.0.tgz)= 0747951dee19c4fc644843d90218349e5d3192500da5282f5d3a923fe9c77448

So the tarball creation/download process must mutate the tarball slightly, even when used for a static tag like V7_2_0. Perhaps there is a configuration setting on the occt server that could be set to ensure that downloading a tagged snapshot will always produce an identical tarball?

~~~~~

The reason of this problem is a bug in GitWeb: it calls gzip without option "-n", so it adds timestamp in the archive each time it is generated. See http://git.661346.n2.nabble.com/PATCH-supply-n-to-gzip-to-produce-identical-tarballs-td6258329.html
Steps To ReproduceDownload archive from URL
http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_2_0;sf=tgz
several times and compute check sum of these archives -- they should be equal
TagsNo tags attached.
Test case number

Activities

abv

2017-12-21 16:59

manager   ~0073076

The problem is fixed by adding option "-n" to call to gzip in gitweb.cgi settings

abv

2017-12-21 19:54

manager   ~0073078

Checksums are now stable. For archive downloaded by URL http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_2_0;sf=tgz

> md5sum occt-V7_2_0.tar.gz
34fd3038227c29c81161cf2fd76892c3 *occt-V7_2_0.tar.gz

> openssl sha -sha256 occt-V7_2_0.tar.gz
SHA256(occt-V7_2_0.tar.gz)= adb6fc44efebdb09e30a487fa412afae9599992dc771b0039b4e
bf306891a558

Issue History

Date Modified Username Field Change
2017-12-21 16:56 abv New Issue
2017-12-21 16:56 abv Assigned To => aiv
2017-12-21 16:59 abv Note Added: 0073076
2017-12-21 16:59 abv Status new => resolved
2017-12-21 16:59 abv Steps to Reproduce Updated
2017-12-21 16:59 abv Assigned To aiv => abv
2017-12-21 19:54 abv Note Added: 0073078
2017-12-21 19:54 abv Status resolved => closed
2017-12-21 19:54 abv Resolution open => fixed