dblab: fix build error

This commit is contained in:
Angel J
2026-05-15 20:57:56 -07:00
committed by Angel J
parent 97ce11ac52
commit ccf166aa37
+19 -2
View File
@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
}:
@@ -15,7 +16,10 @@ buildGoModule (finalAttrs: {
hash = "sha256-0tkIDWAub+wfoJ760m1kU7XYnGNner/zLtCod6UPF60=";
};
vendorHash = "sha256-B5wyERNUkJIrKjKET9HX3F43CFW6aBtzAarkAuhxw9o=";
vendorHash = "sha256-UGnbXjXnZ3EVcAk0ZTaV2wWWXv5nsbyNlTv8PMl2rP4=";
# Fix case-insensitive conflicts producing platform-dependent checksums
# https://github.com/microsoft/go-mssqldb/issues/234
proxyVendor = true;
ldflags = [
"-s"
@@ -23,7 +27,20 @@ buildGoModule (finalAttrs: {
];
doCheck = true;
checkFlags = [ "-short" ]; # Skip Docker-based integration tests
preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
# modernc reads /etc/protocols during package init, which Darwin sandboxing blocks.
go mod download modernc.org/libc
chmod -R u+w "$GOPATH/pkg/mod/modernc.org/libc@"*
substituteInPlace "$GOPATH"/pkg/mod/modernc.org/libc@*/honnef.co/go/netdb/netdb.go \
--replace-fail '!os.IsNotExist(err)' '!os.IsNotExist(err) && !os.IsPermission(err)'
'';
checkFlags = [
"-short"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Tries to bind a local TCP listener, which Darwin sandboxing blocks.
"-skip=^TestSSHKeyFileAuthentication$"
];
meta = {
description = "Database client every command line junkie deserves";