Hi Maxime, Maxime Devos <maximede...@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’.