GNU bug report logs -
#32102
[PATCH] utils: Fix wrap-program filename generation.
Previous Next
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
Hello Arun,
I’m a bit late to the party, but hey!
Arun Isaac <arunisaac <at> systemreboot.net> skribis:
> From 6ee5cf4423109ab64df58c85f4114e456dda098b Mon Sep 17 00:00:00 2001
> From: Arun Isaac <arunisaac <at> systemreboot.net>
> Date: Wed, 11 Jul 2018 13:03:33 +0530
> Subject: [PATCH v3 1/3] build-system: python: Do not double wrap executables.
> To: clement <at> lassieur.org
> Cc: mhw <at> netris.org,
> andreas <at> enge.fr,
> 32102 <at> debbugs.gnu.org
Hmm, weird!
> * guix/build/python-build-system.scm (wrap): Only wrap executables that have
> not already been wrapped.
> * guix/build/utils.scm (is-wrapped?): New function.
[...]
> --- a/guix/build/python-build-system.scm
> +++ b/guix/build/python-build-system.scm
[...]
> (define* (wrap #:key inputs outputs #:allow-other-keys)
> (define (list-of-files dir)
> - (map (cut string-append dir "/" <>)
> - (or (scandir dir (lambda (f)
> - (let ((s (stat (string-append dir "/" f))))
> - (eq? 'regular (stat:type s)))))
> - '())))
> + (find-files dir (lambda (file stat)
> + (and (eq? 'regular (stat:type stat))
> + (not (is-wrapped? file))))))
Something I don’t get is that ‘wrap-program’ itself is supposed to
detect already-wrapped program. I vaguely remember discussing it before
but I forgot what the conclusions were; do we really need extra
‘wrapped?’ checks? Can’t we fix ‘wrap-program’ itself?
> (define bindirs
> (append-map (match-lambda
> diff --git a/guix/build/utils.scm b/guix/build/utils.scm
> index c58a1afd1..c310b792c 100644
> --- a/guix/build/utils.scm
> +++ b/guix/build/utils.scm
[...]
> +(define (is-wrapped? prog)
> + "Return #t if PROG is already wrapped using wrap-program, else return #f."
> + (with-directory-excursion (dirname prog)
> + (and-let* ((match-record (string-match "^\\.(.*)-real$" (basename prog))))
> + (access? (match:substring match-record 1) X_OK))))
By convention I’d suggest calling it ‘wrapped?’ rather than
‘is-wrapped?’. In fact, a more accurate name would be ‘wrapper?’.
Also I’d suggest not using SRFI-2 because IMO it doesn’t bring much and
it’s not used anywhere in Guix currently. Also, ‘file-exists?’ rather
than ‘access?’, and no need to change directories. So:
(define (wrapper? prog)
"Return #t if PROG is a wrapper as produced by 'wrap-program'."
(and (file-exists? prog)
(let ((base (basename prog)))
(and (string-prefix? "." base)
(string-suffix? "-real" base)))))
> From 71a7f6e39bd5b68b596bda2a75b1d245179349d0 Mon Sep 17 00:00:00 2001
> From: Arun Isaac <arunisaac <at> systemreboot.net>
> Date: Sat, 28 Jul 2018 17:31:44 +0530
> Subject: [PATCH v3 3/3] gnu: gajim: Return #t from wrap-gsettings-schema-dir
> phase.
> To: clement <at> lassieur.org
> Cc: mhw <at> netris.org,
> andreas <at> enge.fr,
> 32102 <at> debbugs.gnu.org
>
> * gnu/packages/messaging.scm (gajim)[arguments]: Return #t from
> wrap-gsettings-schema-dir phase.
LGTM!
Thanks,
Ludo’.
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.