Subject: [bug#32102] [PATCH v2 2/2] gnu: gajim: Combine wrap-program phases.

From: [email-masked] (Ludovic Courtès)
Date: Mon, 27 Aug 2018 13:37:13 +0200

Hi Arun,

Sorry for the delay.

Arun Isaac <[email-masked]> skribis:

> [email-masked] (Ludovic Courtès) writes:
>
>>> From 6ee5cf4423109ab64df58c85f4114e456dda098b Mon Sep 17 00:00:00 2001
>>> From: Arun Isaac <[email-masked]>
>>> Date: Wed, 11 Jul 2018 13:03:33 +0530
>>> Subject: [PATCH v3 1/3] build-system: python: Do not double wrap executables.
>>> To: [email-masked]
>>> Cc: [email-masked],
>>>     [email-masked],
>>>     [email-masked]
>>
>> Hmm, weird!
>
> What's weird? Are you referring to the Cc field? The people in the Cc
> field were originally referred to by Clement. So, I put them there to
> keep them in the loop.

Yes that makes perfect sense.  Sorry for the obscure comment on my side;
I was just surprised to see a Cc: header like this in the patch itself,
but it’s nothing special after all.

>>>  (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?
>
> Could you refer to our earlier discussion on 32102?
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32102
>
> In the case of Gajim, our current wrapping ends up double wrapping and
> creating bin/.gajim-real-real. The original fix I proposed was to modify
> `wrap-program` to fix already-wrapped detection. But, after discussion
> with Clement, we decided to go with a is-wrapped? check in the python
> build system. Do check out our earlier discussion and let us know what
> you think.

Right.  I re-read it and it’s all clear again.  :-)  The issue is that
‘list-of-files’ in the ‘wrap’ phase of python-build-system would pick up
files that are themselves wrappers already.

Because of my slow reaction we missed the train of this ‘core-updates’
cycle.  :-/  So I think it’ll have to be for next time.  Sounds good?

Let’s not forget about it…

Thank you,
Ludo’.