[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#39807] [PATCH] guix: pack: Only wrap executable files.
From: |
Ludovic Courtès |
Subject: |
[bug#39807] [PATCH] guix: pack: Only wrap executable files. |
Date: |
Wed, 21 Oct 2020 23:31:13 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi,
Eric Bavier <bavier@posteo.net> skribis:
> On Wed, 2020-10-21 at 17:35 +0200, Ludovic Courtès wrote:
>> Hi Eric,
>>
>> Eric Bavier <bavier@posteo.net> skribis:
>>
>> > (mkdir-p (dirname result))
>> > (apply invoke #$compiler "-std=gnu99" "-static" "-Os" "-g0"
>> > "-Wall"
>> > "run.c" "-o" result
>> > + (string-append "-DWRAPPER_PROGRAM=\"" result "\"")
>>
>> Can we just write (canonical-path result) here? That way we wouldn’t
>> need ‘find-input-files’ and related changes.
>>
>
> Guile's canonicalize-path will raise and error if the path does not
> already exist. We could create a dummy file at result, then call
> canonicalize-path? but that seems clumsier than forming a canonical
> name in the first place?
Oh you’re right, sorry.
The patch you sent has ‘find-files’ use ‘stat’ instead of the trailing
slash. It introduces a difference: by using ‘stat’ all the way, it
follows all symlinks, not just the higher-level ones. I don’t know if
this could have undesired implications, like wrapping the same file
twice because there’s a symlink pointing to it. (Or am I too paranoid?)
To be on the safe side, we could write:
(string-append (canonical-path (dirname) result) "/" result)
WDYT?
Thanks,
Ludo’.
- [bug#39807] [PATCH] guix: pack: Only wrap executable files., Eric Bavier, 2020/10/21
- [bug#39807] [PATCH] guix: pack: Only wrap executable files., Ludovic Courtès, 2020/10/21
- [bug#39807] [PATCH] guix: pack: Only wrap executable files., Eric Bavier, 2020/10/21
- [bug#39807] [PATCH] guix: pack: Only wrap executable files., Ludovic Courtès, 2020/10/21
- [bug#39807] [PATCH] guix: pack: Only wrap executable files., Eric Bavier, 2020/10/21
- [bug#39807] [PATCH] guix: pack: Only wrap executable files.,
Ludovic Courtès <=
- [bug#39807] [PATCH] guix: pack: Only wrap executable files., Eric Bavier, 2020/10/21
- [bug#39807] [PATCH] guix: pack: Only wrap executable files., Ludovic Courtès, 2020/10/23
- bug#39807: [PATCH] guix: pack: Only wrap executable files., Eric Bavier, 2020/10/30