depot question: clarification about hashes

Johannes Schlatow schlatow at ida.ing.tu-bs.de
Thu Jun 28 16:15:20 CEST 2018


Hi Norman,

thanks for your reply. I was a bit inexact with my commands. I actually performed a `git checkout genodelabs/master` rather than a git clone.

As it turned out, I had an unversioned file in base/include which was responsible for the different hash as the base/api archive copies all files from base/include/.

I'm afraid having unversioned files in the working tree that pollute the hash calculation could be a common pitfall (such as *.orig files from a merge conflict or similar). What do you think about using `git ls-files` when copying the content of archives?

Cheers
 Johannes

On Wed, 27 Jun 2018 11:28:19 +0200
Norman Feske <norman.feske at genode-labs.com> wrote:

> Hi Johannes,
> 
> > $> git clone https://github.com/genodelabs/genode.git
> > $> cd genode
> > $> ./tool/depot/extract local/api/base  
> 
> for reference, these commands work on my machine without error. It's
> puzzling.
> 
> > $> cd depot/local/api/base/incomplete
> > $> find . -type f | sort | xargs -d '\n' cat | sha1sum | sed
> > "s/ .*// 731162f0b76bebabc0741366600973b9bbe23651
> > 
> > As you can see, I get a different hash as the extract tool suggested
> > before. Both hashes are different from the recipe hash, by the way.
> > I might be lacking some sleep today and am probably misconceiving
> > the process. Anyway, I'd appreciate if anyone could help and
> > clarify this point.  
> 
> I think the third hash can be explained: The 'sort' order depends on
> your locale settings. Within the depot tools, we use
> 
>   export LC_COLLATE=C
> 
> You certainly use a different setting on your interactive shell. May
> you try your command with this setting?
> 
> Still, the fact that extract tool creates a hash different from the
> one in repos/base/recipes/api/base/hash is strange. Could you compare
> the content of the archive created by you with the content downloaded
> from [1]?
> 
> [1] https://depot.genode.org/genodelabs/api/base/2018-06-12.tar.xz
> 
> Cheers
> Norman
> 



More information about the users mailing list