all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 34223@debbugs.gnu.org
Subject: [bug#34223] Fixing timestamps in archives.
Date: Mon, 18 Feb 2019 21:07:03 +0100	[thread overview]
Message-ID: <87mumshndk.fsf@yahoo.de> (raw)
In-Reply-To: <87imxjfjjt.fsf@gnu.org>

Hi Ludo,

> Sorry for the delay!

No problem! I have very little time anyway.

> Nice work!  It’s great that libarchive doesn’t need to actually extract
> the zip file to operate on it.
>
> Overall I think the approach of factorizing archive-timestamp-resetting
> in one place and using it everywhere (‘ant-build-system’ and all) is the
> right thing to do.
>
> However, I’m not sure whether we should introduce a new program for this
> purpose.  I believe ‘strip-nondeterminism’¹ (in Perl) by fellow
> Reproducible Builds hackers also addresses this problem, so it may be
> wiser to use it.

I also think so. If there is already another program that does the job
we should probably use it.

> But really, since (guix build utils) already implements a significant
> subset of ‘strip-nondeterminism’, it would be even better if could avoid
> to shell out to a C or Perl program.
>
> 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
> ‘guile-bytestructures’).  Specifically, you can get the list of file
> names in a zip file by running:
>
>   (call-with-input-file "something.zip"
>     (lambda (port)
>       (fold-entries cons '() port)))
>
> Resetting timestamps should be just as simple.
>
> How about taking this route?

I also thought about taking this route.
There are some problems with it though:

- As Julien pointed out, the archive contents need to be uncompressed.
  This makes the problem much more complex and keeps us from writing
  a partial ZIP parser that replaces the timestamps in place.
- While it would be quite elegant to just implement the parser in
  Scheme it would be redundant. After all we are developing a package
  manager so we should use it.
  This approach would be more attractive if there would be a Guile
  library for this.
  The best solution would be creating a proper library for handling
  archives when going with Scheme.
- Maintaining a ZIP parser in Guix is a burden we should not take.
- We need to care about a lot of details (ZIP64, probably more exotic
  extensions).

I would be fine with writing an own parser in Scheme but I would like to
point out that in every other place in Guix we are using external tools
for handling archives (AFAIK).

I am not quite sure which version would be the best, so I am open for
other opinions on this.
Maybe you could rephrase your position taking the compression problem
into consideration.

Tim.

  parent reply	other threads:[~2019-02-18 20:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-27 17:58 [bug#34223] Fixing timestamps in archives Tim Gesthuizen
2019-02-16 22:35 ` Ludovic Courtès
2019-02-17  7:42   ` Julien Lepiller
2019-02-18 20:07   ` Tim Gesthuizen [this message]
2019-02-18 22:24     ` Ludovic Courtès
2019-03-01 23:23       ` Tim Gesthuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mumshndk.fsf@yahoo.de \
    --to=tim.gesthuizen@yahoo.de \
    --cc=34223@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.