all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arun Isaac <arunisaac@systemreboot.net>
To: "Clément Lassieur" <clement@lassieur.org>
Cc: 32102@debbugs.gnu.org
Subject: [bug#32102] [PATCH] utils: Fix wrap-program filename generation.
Date: Mon, 09 Jul 2018 16:19:15 +0530	[thread overview]
Message-ID: <cu7efgcn0pg.fsf@systemreboot.net> (raw)
In-Reply-To: <87k1q4j1zk.fsf@lassieur.org>


>> * 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?

  reply	other threads:[~2018-07-09 10:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09  1:31 [bug#32102] [PATCH] utils: Fix wrap-program filename generation Arun Isaac
2018-07-09  7:35 ` Clément Lassieur
2018-07-09 10:49   ` Arun Isaac [this message]
2018-07-09 14:12     ` Clément Lassieur
2018-07-10  5:16       ` Arun Isaac
2018-07-10  8:57         ` Clément Lassieur
2018-07-10 18:13           ` Mark H Weaver
2018-07-11 19:26 ` [bug#32102] [PATCH v2 0/2] build-system: python: Only wrap non-hidden executable files Arun Isaac
2018-07-11 19:26   ` [bug#32102] [PATCH v2 1/2] " Arun Isaac
2018-07-13  7:42     ` Clément Lassieur
2018-07-13  8:35       ` Arun Isaac
2018-07-11 19:26   ` [bug#32102] [PATCH v2 2/2] gnu: gajim: Combine wrap-program phases Arun Isaac
2018-07-13  8:38     ` Clément Lassieur
2018-07-13  9:45       ` Arun Isaac
2018-07-28 20:42         ` Arun Isaac
2018-07-29 14:20           ` Ludovic Courtès
2018-07-30  0:30             ` Arun Isaac
2018-08-27 11:37               ` Ludovic Courtès
2018-08-28  8:37                 ` Arun Isaac
2018-08-29 20:42                   ` Ludovic Courtès
2018-11-22 16:54                     ` Arun Isaac
2018-11-23  9:09                       ` Ludovic Courtès
2018-11-27 10:43                         ` bug#32102: " Arun Isaac
2018-11-27 12:24                           ` [bug#32102] " Clément Lassieur

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=cu7efgcn0pg.fsf@systemreboot.net \
    --to=arunisaac@systemreboot.net \
    --cc=32102@debbugs.gnu.org \
    --cc=clement@lassieur.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.