delve: Fix tests on Linux, disable tests on Darwin

Bug fixed by #173702 runs the previously skipped tests for this
package.
This commit is contained in:
Berk D. Demir 2022-05-01 23:15:08 +00:00
parent 7f2ef311e2
commit 032f261fae

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub, makeWrapper }:
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, stdenv }:
buildGoModule rec {
pname = "delve";
@ -17,7 +17,19 @@ buildGoModule rec {
nativeBuildInputs = [ makeWrapper ];
checkFlags = [ "-short" ];
hardeningDisable = [ "fortify" ];
preCheck = ''
XDG_CONFIG_HOME=$(mktemp -d)
'';
# Disable tests on Darwin as they require various workarounds.
#
# - Tests requiring local networking fail with or without sandbox,
# even with __darwinAllowLocalNetworking allowed.
# - CGO_FLAGS warnings break tests' expected stdout/stderr outputs.
# - DAP test binaries exit prematurely.
doCheck = !stdenv.isDarwin;
postInstall = ''
# fortify source breaks build since delve compiles with -O0