From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:35774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvH6N-0005YU-2s for guix-patches@gnu.org; Sun, 17 Feb 2019 02:43:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvH6M-0003Nt-5K for guix-patches@gnu.org; Sun, 17 Feb 2019 02:43:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvH6M-0003No-1M for guix-patches@gnu.org; Sun, 17 Feb 2019 02:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gvH6L-0004ii-OJ for guix-patches@gnu.org; Sun, 17 Feb 2019 02:43:01 -0500 Subject: [bug#34223] Fixing timestamps in archives. Resent-Message-ID: Date: Sun, 17 Feb 2019 08:42:09 +0100 In-Reply-To: <87imxjfjjt.fsf@gnu.org> References: <87imxjfjjt.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Julien Lepiller Message-ID: <2223B2BF-B691-45B1-82FE-A781CBFF0CDB@lepiller.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tim Gesthuizen Cc: 34223@debbugs.gnu.org Le 16 f=C3=A9vrier 2019 23:35:50 GMT+01:00, "Ludovic Court=C3=A8s" a =C3=A9crit : >Hi Tim, > >Sorry for the delay! > >Tim Gesthuizen skribis: > >> as discussed before I have looked into the problems of timestamps in >the >> zip files=2E >> I looked at the way this is solved in ant-build-system with jar files >> and thought that this could be done in a more elegant way=2E >> Because of this I wrote a simple frontend for LibArchive in C that >> repacks archives and sets their timestamps to zero and disables >> compression as it is done in the ant-build-system=2E >> Creative as I am the program is called repack=2E >> You find a git repository attached with the history of the repack >program=2E >> The attached patches add repack to Guix and use it for pwsafe and the >> ant-build-system=2E > >Nice work! It=E2=80=99s great that libarchive doesn=E2=80=99t need to ac= tually extract >the zip file to operate on it=2E > >Overall I think the approach of factorizing archive-timestamp-resetting >in one place and using it everywhere (=E2=80=98ant-build-system=E2=80=99 = and all) is >the >right thing to do=2E > >However, I=E2=80=99m not sure whether we should introduce a new program f= or >this >purpose=2E I believe =E2=80=98strip-nondeterminism=E2=80=99=C2=B9 (in Pe= rl) by fellow >Reproducible Builds hackers also addresses this problem, so it may be >wiser to use it=2E > >But really, since (guix build utils) already implements a significant >subset of =E2=80=98strip-nondeterminism=E2=80=99, it would be even better= if could >avoid >to shell out to a C or Perl program=2E > >I played a bit with this idea and, as an example, the attached file >allows you to traverse the list of entries in a zip file (it uses >=E2=80=98guile-bytestructures=E2=80=99)=2E Specifically, you can get the= list of file >names in a zip file by running: > > (call-with-input-file "something=2Ezip" > (lambda (port) > (fold-entries cons '() port))) > >Resetting timestamps should be just as simple=2E > >How about taking this route? > >Thanks, >Ludo=E2=80=99=2E > >=C2=B9 https://salsa=2Edebian=2Eorg/reproducible-builds/strip-nondetermin= ism One of the reasons why we extract jar files is to remove compression, beca= use the content might have store references that would be hidden, so grafti= ng for instance wouldn't work=2E