From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: downloading a tarball Date: Fri, 24 Mar 2017 23:10:38 +0100 Message-ID: <87h92ixr4x.fsf@gnu.org> References: <70f61b82-be0d-e493-6841-cb2d121f3051@tobias.gr> <58D52E2A.3040203@goebel-consult.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crXPw-0003su-8L for help-guix@gnu.org; Fri, 24 Mar 2017 18:10:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crXPt-0001lg-0O for help-guix@gnu.org; Fri, 24 Mar 2017 18:10:44 -0400 In-Reply-To: <58D52E2A.3040203@goebel-consult.de> (Hartmut Goebel's message of "Fri, 24 Mar 2017 15:33:14 +0100") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Hartmut Goebel Cc: help-guix@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hartmut Goebel skribis: > Am 24.03.2017 um 14:14 schrieb Tobias Geerinckx-Rice: >>> > HTH - speaking from experience making the same mistake here.. >> I suspect most people have. The message isn't as clear as it could be. > > Either way round the message is hard to read: squezzed between many > other message, no line-break and arguable wording. IMHO this should be > improved to empower more people. Yeah I agree. What about this (patch below)? --8<---------------cut here---------------start------------->8--- @ build-started /gnu/store/0rn80kgcbc90hfl2vl54adci7675fwb7-idutils-4.6.tar= .xz.drv - x86_64-linux /var/log/guix/drvs/0r//n80kgcbc90hfl2vl54adci7675fwb= 7-idutils-4.6.tar.xz.drv.bz2 Starting download of /gnu/store/si0rm701sqmi3w69k2b2yzar4p99j66k-idutils-4.= 6.tar.xz >From http://ftpmirror.gnu.org/idutils/idutils-4.6.tar.xz... following redirection to `http://mirror.ibcp.fr/pub/gnu/idutils/idutils-4.6= .tar.xz'... idutils-4.6.tar.xz 978KiB 743KiB/s 00:01 [####################] 1= 00.0% sha256 hash mismatch for output path `/gnu/store/si0rm701sqmi3w69k2b2yzar4p= 99j66k-idutils-4.6.tar.xz' expected: 1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c2 actual: 1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c1 @ build-failed /gnu/store/0rn80kgcbc90hfl2vl54adci7675fwb7-idutils-4.6.tar.= xz.drv - 1 sha256 hash mismatch for output path `/gnu/store/si0rm701sqmi3w6= 9k2b2yzar4p99j66k-idutils-4.6.tar.xz' expected: 1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c2 actual: 1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c1 cannot build derivation `/gnu/store/kk172bqfx6ya7w62xm1vmr2c9iyq6cpy-idutil= s-4.6.tar.xz.drv': 1 dependencies couldn't be built guix build: error: build failed: build of `/gnu/store/kk172bqfx6ya7w62xm1vm= r2c9iyq6cpy-idutils-4.6.tar.xz.drv' failed --8<---------------cut here---------------end--------------->8--- (Here =E2=80=98guix build=E2=80=99 repeats the error message because of #:print-build-trace, which is #true in =E2=80=98guix build=E2=80=99.) Probably not optimal but hopefully an improvement. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 9b7bb5391..a93095dd1 100644 --- a/nix/libstore/build.cc +++ b/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)); } --=-=-=--