GNU bug report logs - #32245
Guix does not search sources locally by hash

Previous Next

Package: guix;

Reported by: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>

Date: Sun, 22 Jul 2018 09:57:02 UTC

Severity: normal

Done: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 32245 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
Cc: 32245 <at> debbugs.gnu.org
Subject: Re: bug#32245: Guix does not search sources locally by hash
Date: Mon, 23 Jul 2018 16:50:49 +0200
Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de> skribis:

> On Mon, 23 Jul 2018 10:41:14 +0200
> ludo <at> gnu.org (Ludovic Courtès) wrote:
>
>> Hi,
>> 
>> Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de> skribis:
>> 
>> > $> ./pre-inst-env  guix build java-eclipse
>> > [..]
>> > @
>> > build-started /gnu/store/lqfw971srfifgql68ibdgh58vi4d8fq3-java-eclipse-oxygen-3a-linux-gtk-x86_64.tar.gz.drv
>> > -
>> > x86_64-linux /var/log/guix/drvs/lq//fw971srfifgql68ibdgh58vi4d8fq3-java-eclipse-oxygen-3a-linux-gtk-x86_64.tar.gz.drv.bz2
>> 
>> [...]
>> 
>> > But it does NOT search locally. Because I already have:
>> >
>> > guix
>> > hash /gnu/store/56h6snwcawpzk6rhcwgk442wsx6k86q2-eclipse-java-oxygen-3a-linux-gtk-x86_64.tar.gz
>> > 0m7y7jfm059w01x9j5b5qkinjjmhkyygpjabhjf19fg2smxmwcim
>> 
>> It does, but the file name matters.  In this case what you have is
>> “eclipse-java-…” but you’re trying to build “java-eclipse-…”.
>> 
>> So you first need to add the file to the store under its expected
>> name. You can do that for instance with:
>> 
>>   guix download file://…/java-eclipse-…
>> 
>> HTH!
>
> Not sure yet. I havent't tried it yet, but I'm sure your solution
> helps with the specific problem here. (Also updating the URL helps even
> better :-))
>
> What I feel strange here is:
>
> * When the file is already on the local disk, it has to match a certain
> file name criteria. Quite hard criteria.
> * But when asking outside repositories over the network, we just "take
> anything that has the hashsum".
>
> Is that wanted behaviour? 

It’s not optimal, as you pointed out.  But it’s not implemented in these
terms.  The ‘add-to-store’ RPC returns a file name that’s a function of
the content and the file name.  So the way ‘add-to-store’ works is:

  1. compute store file name = g(content, filename)
     (See ‘fixed-output-path’ in (guix store).)

  2. if store file name exists, return it, else create it.

Since /var/guix/db/db.sqlite contains the content hash of each store
item, we could in theory perform a lookup by hash.  To do that we’d need
to add a new RPC and use it in the correct places.  It’d be a nice
addition.

Ludo’.




This bug report was last modified 6 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.