[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32749: package-with-explicit-inputs leaks-in additional inputs
From: |
Ludovic Courtès |
Subject: |
bug#32749: package-with-explicit-inputs leaks-in additional inputs |
Date: |
Tue, 18 Sep 2018 16:38:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello,
Jan Nieuwenhuizen <address@hidden> skribis:
> Ludovic Courtès writes:
>
>> The difference comes from the fact that ‘gnu-make-explicit-inputs’ has
>> Guile in its ‘inputs’:
>
> Ah, I missed that!
>
>> scheme@(gnu packages pawei)> (package-direct-inputs gnu-make-explicit-inputs)
>> $5 = (("libc" #<package address@hidden gnu/packages/bootstrap.scm:150
>> 3d216c0>) ("gcc" #<package address@hidden gnu/packages/bootstrap.scm:150
>> 3d21600>) ("binutils" #<package address@hidden
>> gnu/packages/bootstrap.scm:150 3d21540>) ("coreutils&co" #<package
>> address@hidden gnu/packages/bootstrap.scm:150 3d21480>) ("bash" #<package
>> address@hidden gnu/packages/bootstrap.scm:150 3d21480>) ("guile" #<package
>> address@hidden gnu/packages/bootstrap.scm:150 3d213c0>))
>>
>> This comes from the fact that the ‘inputs’ field is not overridden,
>> unlike in the case of ‘gnu-make-no-implicit-inputs’.
>>
>> To solve this, the solution is to add this one ‘inputs’ line:
>>
>> (define gnu-make-explicit-inputs
>> (let ((p (package-with-explicit-inputs gnu-make
>> (%bootstrap-inputs+toolchain)
>> #:guile %bootstrap-guile)))
>> (package-with-bootstrap-guile
>> (package (inherit p)
>> (name "make-explicit-inputs")
>> (inputs '()) ;<- HERE
>> (arguments (package-arguments p))))))
>>
>> Perhaps you hit similar cases on ‘wip-bootstrap’? It’s easy to leave
>> out too many inputs…
>
> I tried this! The dependencies look OK, but the package won't build --
> there's no tar, make etc.
Ah, true!
> That can be fixed by repeating the explicit inputs, like this:
>
> (define gnu-make-explicit-inputs
> (let ((p (package-with-explicit-inputs gnu-make
> (%bootstrap-inputs+toolchain)
> #:guile %bootstrap-guile)))
> (package-with-bootstrap-guile
> (package (inherit p)
> (name "make-explicit-inputs")
> (inputs (%bootstrap-inputs+toolchain))
> (native-inputs '())
> (arguments (package-arguments p))))))
>
> ...but that looks a bit strange: if we have to mention the inputs a
> second time the advantage over using the `gnu-make-no-implicit-inputs'
> package description becomes real small?
The key thing is that ‘package-with-explicit-inputs’ works recursively:
it adds (it does *not* replace) inputs to the whole package graph.
> I also tried
>
> (inputs (package-inputs p))
>
> but that pulls in gcc-bootstrap-0 again; which lead me to believe
> `package-with-explicit-inputs' has no observable effect?
Consider this:
(define x
(let ((p (package-with-explicit-inputs gnu-make
(%bootstrap-inputs+toolchain)
…)))
…))
Here ‘%bootstrap-inputs+toolchain’ is called from the top level, when
‘%current-system’ has its default value. So if you’re on x86_64, you
get the x86_64 inputs.
So it’s not a bug per se, but it’s definitely an annoyance.
I just realized that there’s already a fix for this, which is to pass
‘package-with-explicit-inputs’ a procedure rather than the input list,
like this:
(package-with-explicit-inputs gnu-make
%bootstrap-inputs+toolchain
…)
Does it work for you?
Thanks,
Ludo’.