guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What’s next?


From: Ricardo Wurmus
Subject: Re: What’s next?
Date: Sun, 28 May 2017 23:36:40 +0200
User-agent: mu4e 0.9.18; emacs 25.2.1

Ludovic Courtès <address@hidden> writes:

> Ricardo Wurmus <address@hidden> skribis:
>
>> Ludovic Courtès <address@hidden> writes:
>>
>>> Hello!
>>>
>>> Ricardo Wurmus <address@hidden> skribis:
>>>
>>>> Here are some other annoyances:
>>>>
>>>> * the verbosity of reporting hash mismatches.  You posted a neat little
>>>>   change for that some time ago, but I cannot find it any more.
>>>
>>> Oh right, see attached.
>>
>> I think you forgot to attach it.
>
> Oops.  Here we go:
>
> modified   nix/libstore/build.cc
> @@ -2449,8 +2449,11 @@ void DerivationGoal::registerOutputs()
>              Hash h2 = recursive ? hashPath(ht, actualPath).first : 
> hashFile(ht, actualPath);
>              if (h != h2)
>                  throw BuildError(
> -                    format("output path `%1%' should have %2% hash `%3%', 
> instead has `%4%'")
> -                    % path % i->second.hashAlgo % printHash16or32(h) % 
> printHash16or32(h2));
> +                    format("%1% hash mismatch for output path `%2%'\n"
> +                        "  expected: %3%\n"
> +                        "  actual:   %4%")
> +                    % i->second.hashAlgo % path
> +                 % printHash16or32(h) % printHash16or32(h2));
>          }
>
>          /* Get rid of all weird permissions.  This also checks that
> @@ -3096,7 +3099,9 @@ void SubstitutionGoal::finished()
>              Hash expectedHash = parseHash16or32(hashType, 
> string(expectedHashStr, n + 1));
>              Hash actualHash = hashType == htSHA256 ? hash.first : 
> hashPath(hashType, destPath).first;
>              if (expectedHash != actualHash)
> -                throw SubstError(format("hash mismatch in downloaded path 
> `%1%': expected %2%, got %3%")
> +                throw SubstError(format("hash mismatch in downloaded path 
> `%1%'\n"
> +                                     "  expected: %2%\n"
> +                                     "  actual:   %3%")
>                      % storePath % printHash(expectedHash) % 
> printHash(actualHash));
>          }
>
> Should we apply it?

Yes, please.  This looks much better!  Thank you!

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]