From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: =?utf-8?Q?What=E2=80=99s?= next? Date: Sun, 28 May 2017 22:44:10 +0200 Message-ID: <87h904ogo5.fsf@gnu.org> References: <877f16z9eo.fsf@gnu.org> <87y3tm8k2r.fsf@elephly.net> <87zidyvctf.fsf@gnu.org> <877f12ezzj.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dF551-0003FC-6e for guix-devel@gnu.org; Sun, 28 May 2017 16:47:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dF52s-00014u-0t for guix-devel@gnu.org; Sun, 28 May 2017 16:46:27 -0400 In-Reply-To: <877f12ezzj.fsf@elephly.net> (Ricardo Wurmus's message of "Sat, 27 May 2017 23:44:48 +0200") 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: Ricardo Wurmus Cc: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ricardo Wurmus skribis: > Ludovic Court=C3=A8s 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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)); } --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Should we apply it? >> I agree with this direction, but we=E2=80=99ll have to work on concrete = cases >> here. Bug reports of the form =E2=80=9Cwhen I do this I get a stack tra= ce >> instead of an error message=E2=80=9D are welcome! > > Danny submitted bug #27100 for this with two examples. Great. Thanks, Ludo=E2=80=99. --=-=-=--