[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC 0/4] Getting rid of input labels?
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH RFC 0/4] Getting rid of input labels? |
Date: |
Wed, 26 May 2021 15:43:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hi Maxime,
Maxime Devos <maximedevos@telenet.be> skribis:
> Ludovic Courtès schreef op do 20-05-2021 om 16:58 [+0200]:
>> Hello Guix!
>>
>> Here’s a proposal for a soft revolution: getting rid of input labels
>> in package definitions. Instead of writing: [...]
>>
>> one can write:
>>
>> (native-inputs (list autoconf automake pkg-config guile-3.0))
>> [...]
>
> This concept LGTM (but I haven't looked closely at the patches), but
> as noted on #guix, some issues with eliminating labels completely:
>
> A package definition of P may require both Q@1.0 and Q@2.0 as inputs,
> in which case a ‘label collision’ would be created if we generate
> labels package-name. More specifically, I'm thinking of packaging
> go-ipfs-migrations (or what's its name ...). It would be a good idea
> to add an (additional?) test to actually try to migrate from
> go-ipfs@first-version to go-ipfs@another-version.
Keep in mind that labels exist to make it easier to refer to a specific
input from the build side—in a phase, configure flag, etc.
In many cases, you don’t need the ability to refer to a specific input;
you just need all the inputs to contribute to search path environment
variables, and that’s enough. A “label collision” does not matter at
all in this case.
In some cases, you do need to refer to a specific input, as in:
#:configure-flags (list (string-append "--with-gmp-prefix="
(assoc-ref %build-inputs "gmp")))
In this case, there are now two options:
1. Arrange so that label is unique among your inputs, as is already
the case.
2. Use a gexp instead (possible on ‘core-updates’) like so:
#:configure-flags #~(list (string-append "--with-gmp-prefix=" #$gmp))
or, to allow for inheritance:
#:configure-flags #~(list (string-append "--with-gmp-prefix="
#$@(assoc-ref
(package-inputs
this-package)
"gmp")))
The second variant is ugly, but we could provide helpers to make it
prettier.
Do you think there are unaddressed issues with go-ipfs-migrations?
Thanks for your feedback!
Ludo’.
- [PATCH RFC 0/4] Getting rid of input labels?, Ludovic Courtès, 2021/05/20
- [PATCH RFC 2/4] DRAFT packages: Allow inputs to be plain package lists., Ludovic Courtès, 2021/05/20
- [PATCH RFC 1/4] records: Support field sanitizers., Ludovic Courtès, 2021/05/20
- [PATCH RFC 3/4] DRAFT gnu: Change inputs of core packages to plain lists., Ludovic Courtès, 2021/05/20
- [PATCH RFC 4/4] DRAFT lint: Add 'input-labels' checker., Ludovic Courtès, 2021/05/20
- Re: [PATCH RFC 0/4] Getting rid of input labels?, Vincent Legoll, 2021/05/20
- Re: [PATCH RFC 0/4] Getting rid of input labels?, Maxime Devos, 2021/05/20
- Re: [PATCH RFC 0/4] Getting rid of input labels?,
Ludovic Courtès <=
- Re: [PATCH RFC 0/4] Getting rid of input labels?, Nicolas Goaziou, 2021/05/21