Gnutls 3.9.6 - ChecksumMismatchError: SHA256 mismatch

Hi,

Installing gnutls 3.9.6 resulting in:

==> Installing gnutls
==> Downloading https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.9.tar.xz
######################################################################## 100.0%
==> Downloading https://gitlab.com/gnutls/gnutls/commit/ef80617d1e17e0878a909baad62a75ba265c0e00.patch
######################################################################## 100.0%
Error: An exception occurred within a child process:
ChecksumMismatchError: SHA256 mismatch
Expected: 3b1634fa348c0f0064e43f3fb673e30a5e46f2b51cd6cd0d4a0cbf326e71c90e
Actual: 34480b13120e2167060795060b6738c26622c341498cf6303b17b143642b14cd
Archive: /Users/cpedersen/Library/Caches/Homebrew/downloads/0c113ab0098bc4c3f2e8f410741b6104f2928fe63eb38cf98f8dcc3362f02ac4–ef80617d1e17e0878a909baad62a75ba265c0e00.patch
To retry an incomplete download, remove the file above.

Doing a edit of the gnutls bottle (brew edit gnutls) replacing the checksum for the patch with the correct one, allows gnutls to install.

Cheers,
Casper

1 Like

See https://github.com/Homebrew/homebrew-core/pull/43161 to keep track of the issue

Can you please how did you edit the checksum? How do I do it?
I am having the same issue:

Actual: 34480b13120e2167060795060b6738c26622c341498cf6303b17b143642b14cd

Archive: /Users/X/Library/Caches/Homebrew/downloads/ 0c113ab0098bc4c3f2e8f410741b6104f2928fe63eb38cf98f8dcc3362f02ac4 --ef80617d1e17e0878a909baad62a75ba265c0e00.patch

Below is my bottle file:

Editing /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gnutls.rb
Warning: Using vim because no editor was set in the environment.
This may change in the future, so we recommend setting EDITOR,
or HOMEBREW_EDITOR to your preferred text editor.

This patch has been merged upstream and this issue should be fixed in the 3.6.10 release.

patch do
url “https://gitlab.com/gnutls/gnutls/commit/ef80617d1e17e0878a909baad62a75ba265c0e00.patch
sha256 “3b1634fa348c0f0064e43f3fb673e30a5e46f2b51cd6cd0d4a0cbf326e71c90e”
end

def install
args = %W[
–disable-dependency-tracking
–disable-silent-rules
–disable-static
–prefix=#{prefix}
–sysconfdir=#{etc}
–with-default-trust-store-file=#{etc}/openssl/cert.pem
–disable-guile
–disable-heartbeat-support
–with-p11-kit
]

system "./configure", *args
system "make", "install"

# certtool shadows the macOS certtool utility
mv bin/"certtool", bin/"gnutls-certtool"
mv man1/"certtool.1", man1/"gnutls-certtool.1"

end

def post_install
keychains = %w[
/System/Library/Keychains/SystemRootCertificates.keychain
]

certs_list = `security find-certificate -a -p #{keychains.join(" ")}`
certs = certs_list.scan(/-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m)

valid_certs = certs.select do |cert|
  IO.popen("openssl x509 -inform pem -checkend 0 -noout", "w") do |openssl_io|
    openssl_io.write(cert)
    openssl_io.close_write
  end

  $CHILD_STATUS.success?
end

openssldir = etc/"openssl"
openssldir.mkpath
(openssldir/"cert.pem").atomic_write(valid_certs.join("\n"))

end

test do
system bin/“gnutls-cli”, “–version”
end
end

a) brew edit gnutls
b) scroll down to the lines with:
sha256 “3b1634fa348c0f0064e43f3fb673e30a5e46f2b51cd6cd0d4a0cbf326e71c90e”
c) replase the line with:
sha256 “34480b13120e2167060795060b6738c26622c341498cf6303b17b143642b14cd”
d) save the file
e) run “brew install gnutls” again, and it should work.

Casper

2 Likes

I did the following:

Patch for build error on Sierra:

Undefined symbols for architecture x86_64:

“___get_cpuid_count”, referenced from:

_register_x86_crypto in libaccelerated.a(x86-common.o)

This patch has been merged upstream and this issue should be fixed in the 3.6.10 release.

patch do
url “https://gitlab.com/gnutls/gnutls/commit/ef80617d1e17e0878a909baad62a75ba265c0e00.patch
sha256 “34480b13120e2167060795060b6738c26622c341498cf6303b17b143642b14cd”

Yet it gives the same error