From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: =?utf-8?Q?What=E2=80=99s?= next? Date: Sun, 28 May 2017 23:36:40 +0200 Message-ID: <87fufoiryv.fsf@elephly.net> References: <877f16z9eo.fsf@gnu.org> <87y3tm8k2r.fsf@elephly.net> <87zidyvctf.fsf@gnu.org> <877f12ezzj.fsf@elephly.net> <87h904ogo5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dF5rn-0002KP-Dq for guix-devel@gnu.org; Sun, 28 May 2017 17:36:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dF5rm-0006Fv-G4 for guix-devel@gnu.org; Sun, 28 May 2017 17:36:51 -0400 In-reply-to: <87h904ogo5.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel Ludovic Courtès writes: > Ricardo Wurmus skribis: > >> Ludovic Courtès writes: >> >>> Hello! >>> >>> Ricardo Wurmus 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