buildGoPackage: Skip directories which don't have buildable go packages

This commit is contained in:
William A. Kennington III 2015-05-14 17:51:04 -07:00
parent 1a045673f6
commit 0ff12d88ea

View File

@ -57,7 +57,13 @@ go.stdenv.mkDerivation ( args // {
else else
(cd go/src (cd go/src
find $goPackagePath -type f -name \*.go -exec dirname {} \; | sort | uniq | while read d; do find $goPackagePath -type f -name \*.go -exec dirname {} \; | sort | uniq | while read d; do
go install $buildFlags "''${buildFlagsArray[@]}" -p $NIX_BUILD_CORES -v $d local OUT;
if ! OUT="$(go install $buildFlags "''${buildFlagsArray[@]}" -p $NIX_BUILD_CORES -v $d 2>&1)"; then
if ! echo "$OUT" | grep -q 'no buildable Go source files'; then
echo "$OUT" >&2
exit 1
fi
fi
done) done)
fi fi