[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: downloading a tarball
From: |
Ludovic Courtès |
Subject: |
Re: downloading a tarball |
Date: |
Fri, 24 Mar 2017 23:10:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hartmut Goebel <address@hidden> 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//n80kgcbc90hfl2vl54adci7675fwb7-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 [####################] 100.0%
sha256 hash mismatch for output path
`/gnu/store/si0rm701sqmi3w69k2b2yzar4p99j66k-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/si0rm701sqmi3w69k2b2yzar4p99j66k-idutils-4.6.tar.xz'
expected: 1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c2
actual: 1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c1
cannot build derivation
`/gnu/store/kk172bqfx6ya7w62xm1vmr2c9iyq6cpy-idutils-4.6.tar.xz.drv': 1
dependencies couldn't be built
guix build: error: build failed: build of
`/gnu/store/kk172bqfx6ya7w62xm1vmr2c9iyq6cpy-idutils-4.6.tar.xz.drv' failed
--8<---------------cut here---------------end--------------->8---
(Here ‘guix build’ repeats the error message because of
#:print-build-trace, which is #true in ‘guix build’.)
Probably not optimal but hopefully an improvement.
Thanks,
Ludo’.
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));
}
Re: downloading a tarball, Ricardo Wurmus, 2017/03/24