GNU bug report logs - #32102
[PATCH] utils: Fix wrap-program filename generation.

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Mon, 9 Jul 2018 01:32:02 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 32102 <at> debbugs.gnu.org
Subject: [bug#32102] [PATCH] utils: Fix wrap-program filename generation.
Date: Mon, 09 Jul 2018 16:19:15 +0530
>> * guix/build/utils.scm (wrap-program): While generating a new filename for the
>> wrapped program, trim dots from the left of the basename. This prevents
>> already wrapped files being wrapped again with two or more dots prepended to
>> them.
>
> Why is it a problem that two or more dots are prepended to them?

(define (wrap-program prog #:rest vars)
  (define wrapped-file
    (string-append
     (dirname prog) "/." (basename prog) "-real"))

  (define already-wrapped?
    (file-exists? wrapped-file))

...)

If wrap-program finds that PROG has previously been wrapped, it extends
the wrapper; it does not create a wrapper around the previously existing
wrapper (a "double wrapper"). wrap-program detects that PROG has
previously been wrapped by comparing the expected wrapped filename (see
code snippet above). Without the string-trim I added, this
already-wrapped? detection fails and a double wrapper ends up being
created.

For a concrete example of what I mean, look at the gajim package. You
will find double wrappers such as "bin/..gajim-real-real". This
shouldn't have happened. Furthermore, many other packages have similar
issues. You might find some if you search through /gnu/store.

find /gnu/store -name "*-real-real"

> It means that 'foo' and '.foo' will have the same generated file name
> '.foo-real'.  Wrapping a hidden file and its non-hidden counterpart is
> something that probably shouldn't happen, but if for some reason it must
> happen, we'll face an annoying bug.  WDYT?

It's true that we could face an annoying bug in the future. But then,
we'll have to find some alternative means to determine
alread-wrapped?. Is that worth it? Any ideas?




This bug report was last modified 6 years and 256 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.