go: Apply package exclusion equally

The exclusion logic was moved out of getGoDirs but only buildPhase was updated
causing checkPhase to possibly fail. This happened in golint as it has go
files in testdata that are meant as testdata files and not go packages to
test which caused the checkPhase to fail.

Fixes #167717
main
Manuel Mendez 2 years ago committed by zowoq
parent 6443a5d6da
commit ddcc7c67d2
  1. 3
      pkgs/development/go-modules/generic/default.nix
  2. 3
      pkgs/development/go-packages/generic/default.nix

@ -204,7 +204,7 @@ let
if [ -n "$subPackages" ]; then
echo "$subPackages" | sed "s,\(^\| \),\1./,g"
else
find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique
find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique | grep -v "$exclude"
fi
}
@ -221,7 +221,6 @@ let
export NIX_BUILD_CORES=1
fi
for pkg in $(getGoDirs ""); do
grep -q "$exclude" <<<$pkg && continue
echo "Building subPackage $pkg"
buildGoDir install "$pkg"
done

@ -184,7 +184,7 @@ let
echo "$subPackages" | sed "s,\(^\| \),\1$goPackagePath/,g"
else
pushd "$NIX_BUILD_TOP/go/src" >/dev/null
find "$goPackagePath" -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort | uniq
find "$goPackagePath" -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort | uniq | grep -v "$exclude"
popd >/dev/null
fi
}
@ -202,7 +202,6 @@ let
export NIX_BUILD_CORES=1
fi
for pkg in $(getGoDirs ""); do
grep -q "$exclude" <<<$pkg && continue
echo "Building subPackage $pkg"
buildGoDir install "$pkg"
done

Loading…
Cancel
Save