unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19816: 'guix environment' always downloads all the outputs of dependencies
@ 2015-02-08 18:24 Ludovic Courtès
  2015-12-20 22:34 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-02-08 18:24 UTC (permalink / raw)
  To: 19816; +Cc: Dave Thompson

From <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19641#16>:

There’s another problem, though.  When a dependency is a multiple-output
package, all its outputs are added to the environment, because
‘package->transitive-inputs’ discards the information of which output is
needed.

So for instance, both the ‘out’ and the ‘debug’ output of Coreutils end
up being downloaded and added to the environment, even though only ‘out’
is an input.

Now, the problem is that ‘build-derivations’ can only build *all* the
outputs of the given derivation.  This could be worked around either:

  1. by creating a “sink” derivation, for instance with
     ‘profile-derivation’, that could refer precisely to the output(s)
     needed; not ideal.

  2. by using (build-things (list "/the/output/path")) and resorting to
     ‘build-derivations’ only if the ‘build-things’ call did nothing
     (when passed a non-.drv store item, ‘build-things’ tries to
     substitute and does nothing if that fails.)

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19816: 'guix environment' always downloads all the outputs of dependencies
  2015-02-08 18:24 bug#19816: 'guix environment' always downloads all the outputs of dependencies Ludovic Courtès
@ 2015-12-20 22:34 ` Ludovic Courtès
  2015-12-21 17:21   ` Thompson, David
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-12-20 22:34 UTC (permalink / raw)
  To: Dave Thompson; +Cc: 19816

ludo@gnu.org (Ludovic Courtès) skribis:

>From <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19641#16>:
>
> There’s another problem, though.  When a dependency is a multiple-output
> package, all its outputs are added to the environment, because
> ‘package->transitive-inputs’ discards the information of which output is
> needed.
>
> So for instance, both the ‘out’ and the ‘debug’ output of Coreutils end
> up being downloaded and added to the environment, even though only ‘out’
> is an input.
>
> Now, the problem is that ‘build-derivations’ can only build *all* the
> outputs of the given derivation.  This could be worked around either:
>
>   1. by creating a “sink” derivation, for instance with
>      ‘profile-derivation’, that could refer precisely to the output(s)
>      needed; not ideal.

David, I think you had started looking at doing exactly this.  Do you
have a preliminary patch you’d like to post?

I understand you may be busy preparing the Lisp Game Jam now and I
wouldn’t want to distract you from that.  ;-)  If you have something to
share, I’m happy to help start from there though (says the guy who sees
its ‘guix environment’ pointlessly downloading “debug” and “doc” outputs
again.)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19816: 'guix environment' always downloads all the outputs of dependencies
  2015-12-20 22:34 ` Ludovic Courtès
@ 2015-12-21 17:21   ` Thompson, David
  2015-12-21 21:31     ` Ludovic Courtès
  2016-02-12 21:07     ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Thompson, David @ 2015-12-21 17:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 19816, Dave Thompson

On Sun, Dec 20, 2015 at 5:34 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> ludo@gnu.org (Ludovic Courtès) skribis:
>
>>From <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19641#16>:
>>
>> There’s another problem, though.  When a dependency is a multiple-output
>> package, all its outputs are added to the environment, because
>> ‘package->transitive-inputs’ discards the information of which output is
>> needed.
>>
>> So for instance, both the ‘out’ and the ‘debug’ output of Coreutils end
>> up being downloaded and added to the environment, even though only ‘out’
>> is an input.
>>
>> Now, the problem is that ‘build-derivations’ can only build *all* the
>> outputs of the given derivation.  This could be worked around either:
>>
>>   1. by creating a “sink” derivation, for instance with
>>      ‘profile-derivation’, that could refer precisely to the output(s)
>>      needed; not ideal.
>
> David, I think you had started looking at doing exactly this.  Do you
> have a preliminary patch you’d like to post?
>
> I understand you may be busy preparing the Lisp Game Jam now and I
> wouldn’t want to distract you from that.  ;-)  If you have something to
> share, I’m happy to help start from there though (says the guy who sees
> its ‘guix environment’ pointlessly downloading “debug” and “doc” outputs
> again.)

The wip-environment-profiles branch has the code I've written thus
far.  I rebased it on master and resolved some conflicts in hopefully
the right way. :)

When I last hacked on it I got into a fully working state AFAICT, but
the tests needed updating and that proved to be the most challenging
part.  If you're willing to finish it up, that would be awesome!

Thanks,

- Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19816: 'guix environment' always downloads all the outputs of dependencies
  2015-12-21 17:21   ` Thompson, David
@ 2015-12-21 21:31     ` Ludovic Courtès
  2016-02-12 21:07     ` Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2015-12-21 21:31 UTC (permalink / raw)
  To: Thompson, David; +Cc: 19816, Dave Thompson

"Thompson, David" <dthompson2@worcester.edu> skribis:

> On Sun, Dec 20, 2015 at 5:34 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> ludo@gnu.org (Ludovic Courtès) skribis:
>>
>>>From <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19641#16>:
>>>
>>> There’s another problem, though.  When a dependency is a multiple-output
>>> package, all its outputs are added to the environment, because
>>> ‘package->transitive-inputs’ discards the information of which output is
>>> needed.
>>>
>>> So for instance, both the ‘out’ and the ‘debug’ output of Coreutils end
>>> up being downloaded and added to the environment, even though only ‘out’
>>> is an input.
>>>
>>> Now, the problem is that ‘build-derivations’ can only build *all* the
>>> outputs of the given derivation.  This could be worked around either:
>>>
>>>   1. by creating a “sink” derivation, for instance with
>>>      ‘profile-derivation’, that could refer precisely to the output(s)
>>>      needed; not ideal.
>>
>> David, I think you had started looking at doing exactly this.  Do you
>> have a preliminary patch you’d like to post?
>>
>> I understand you may be busy preparing the Lisp Game Jam now and I
>> wouldn’t want to distract you from that.  ;-)  If you have something to
>> share, I’m happy to help start from there though (says the guy who sees
>> its ‘guix environment’ pointlessly downloading “debug” and “doc” outputs
>> again.)
>
> The wip-environment-profiles branch has the code I've written thus
> far.  I rebased it on master and resolved some conflicts in hopefully
> the right way. :)
>
> When I last hacked on it I got into a fully working state AFAICT, but
> the tests needed updating and that proved to be the most challenging
> part.  If you're willing to finish it up, that would be awesome!

Excellent, I had forgotten there was already a branch.

I’ll see what I can do before or after my vacations!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19816: 'guix environment' always downloads all the outputs of dependencies
  2015-12-21 17:21   ` Thompson, David
  2015-12-21 21:31     ` Ludovic Courtès
@ 2016-02-12 21:07     ` Ludovic Courtès
  2016-02-12 21:37       ` Thompson, David
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-02-12 21:07 UTC (permalink / raw)
  To: Thompson, David; +Cc: 19816-done, Dave Thompson

"Thompson, David" <dthompson2@worcester.edu> skribis:

> On Sun, Dec 20, 2015 at 5:34 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> ludo@gnu.org (Ludovic Courtès) skribis:
>>
>>>>From <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19641#16>:
>>>
>>> There’s another problem, though.  When a dependency is a multiple-output
>>> package, all its outputs are added to the environment, because
>>> ‘package->transitive-inputs’ discards the information of which output is
>>> needed.
>>>
>>> So for instance, both the ‘out’ and the ‘debug’ output of Coreutils end
>>> up being downloaded and added to the environment, even though only ‘out’
>>> is an input.
>>>
>>> Now, the problem is that ‘build-derivations’ can only build *all* the
>>> outputs of the given derivation.  This could be worked around either:
>>>
>>>   1. by creating a “sink” derivation, for instance with
>>>      ‘profile-derivation’, that could refer precisely to the output(s)
>>>      needed; not ideal.
>>
>> David, I think you had started looking at doing exactly this.  Do you
>> have a preliminary patch you’d like to post?
>>
>> I understand you may be busy preparing the Lisp Game Jam now and I
>> wouldn’t want to distract you from that.  ;-)  If you have something to
>> share, I’m happy to help start from there though (says the guy who sees
>> its ‘guix environment’ pointlessly downloading “debug” and “doc” outputs
>> again.)
>
> The wip-environment-profiles branch has the code I've written thus
> far.  I rebased it on master and resolved some conflicts in hopefully
> the right way. :)
>
> When I last hacked on it I got into a fully working state AFAICT, but
> the tests needed updating and that proved to be the most challenging
> part.  If you're willing to finish it up, that would be awesome!

It took me a while but I’ve finally finished it and pushed as 779aa00.

I took a different strategy for the tests, which is to rely (in part) on
the output of ‘guix gc --references’ to determine whether the profile
contains all we need.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19816: 'guix environment' always downloads all the outputs of dependencies
  2016-02-12 21:07     ` Ludovic Courtès
@ 2016-02-12 21:37       ` Thompson, David
  0 siblings, 0 replies; 6+ messages in thread
From: Thompson, David @ 2016-02-12 21:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 19816-done, Dave Thompson

On Fri, Feb 12, 2016 at 4:07 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> "Thompson, David" <dthompson2@worcester.edu> skribis:
>
>> On Sun, Dec 20, 2015 at 5:34 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>>> ludo@gnu.org (Ludovic Courtès) skribis:
>>>
>>>>>From <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19641#16>:
>>>>
>>>> There’s another problem, though.  When a dependency is a multiple-output
>>>> package, all its outputs are added to the environment, because
>>>> ‘package->transitive-inputs’ discards the information of which output is
>>>> needed.
>>>>
>>>> So for instance, both the ‘out’ and the ‘debug’ output of Coreutils end
>>>> up being downloaded and added to the environment, even though only ‘out’
>>>> is an input.
>>>>
>>>> Now, the problem is that ‘build-derivations’ can only build *all* the
>>>> outputs of the given derivation.  This could be worked around either:
>>>>
>>>>   1. by creating a “sink” derivation, for instance with
>>>>      ‘profile-derivation’, that could refer precisely to the output(s)
>>>>      needed; not ideal.
>>>
>>> David, I think you had started looking at doing exactly this.  Do you
>>> have a preliminary patch you’d like to post?
>>>
>>> I understand you may be busy preparing the Lisp Game Jam now and I
>>> wouldn’t want to distract you from that.  ;-)  If you have something to
>>> share, I’m happy to help start from there though (says the guy who sees
>>> its ‘guix environment’ pointlessly downloading “debug” and “doc” outputs
>>> again.)
>>
>> The wip-environment-profiles branch has the code I've written thus
>> far.  I rebased it on master and resolved some conflicts in hopefully
>> the right way. :)
>>
>> When I last hacked on it I got into a fully working state AFAICT, but
>> the tests needed updating and that proved to be the most challenging
>> part.  If you're willing to finish it up, that would be awesome!
>
> It took me a while but I’ve finally finished it and pushed as 779aa00.
>
> I took a different strategy for the tests, which is to rely (in part) on
> the output of ‘guix gc --references’ to determine whether the profile
> contains all we need.

Thank you!  I'm excited that this is finally in master.

- Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-12 21:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-08 18:24 bug#19816: 'guix environment' always downloads all the outputs of dependencies Ludovic Courtès
2015-12-20 22:34 ` Ludovic Courtès
2015-12-21 17:21   ` Thompson, David
2015-12-21 21:31     ` Ludovic Courtès
2016-02-12 21:07     ` Ludovic Courtès
2016-02-12 21:37       ` Thompson, David

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).