Repository: containers/buildah (language: go)

Issue:
Make runs very, very slowly 
**Description**

In CI and Automation in general, it's often helpful to shallow-clone a repository to save time/space/bandwidth.  This is not practical with `https://github.com/containers/buildah.git` due to some unknown wizardry in the `Makefile`, causing `go` to spawn a billion (okay, maybe 20) `git` processes doing who-knows-what.

**Steps to reproduce the issue:**
1. On F33 with golang 1.15.14
2. `mkdir /tmp/go && export GOPATH=/tmp/go`
3. `git clone --depth=1 https://github.com/containers/buildah.git /tmp/buildah`
4. `cd /tmp/buildah`
5. `time make clean`

**Describe the results you received:**

```
$ time make clean
rm -f -r bin tests/testreport/testreport
make -C docs clean
make[1]: Entering directory '/tmp/buildah/docs'
rm -f buildah*.1
make[1]: Leaving directory '/tmp/buildah/docs'

________________________________________________________
Executed in  347.31 secs    fish           external
   usr time  383.37 secs    0.52 millis  383.37 secs
   sys time   40.91 secs    1.20 millis   40.91 secs
```

**Describe the results you expected:**

```
$ cd /tmp
$ podman unshare rm -rf /tmp/go /tmp/buildah   # files are user-namespaced!?!?!?
$ git clone https://github.com/containers/buildah.git /tmp/buildah
$ cd buildah
$ git checkout 52dfdd7868b  # suspect next commit caused the problem
$ time make clean
rm -f -r bin tests/testreport/testreport
make -C docs clean
make[1]: Entering directory '/tmp/buildah/docs'
rm -f buildah*.1
make[1]: Leaving directory '/tmp/buildah/docs'

________________________________________________________
Executed in  102.34 millis    fish           external
   usr time   59.73 millis    0.25 millis   59.48 millis
   sys time   50.80 millis    1.13 millis   49.67 millis
```

**Output of `rpm -q buildah` or `apt list buildah`:**

Not relevant

**Output of `buildah version`:**

Not relevant

**Output of `podman version` if reporting a `podman build` issue:**

Not relevant

**Output of `cat /etc/*release`:**

```
NAME=Fedora
VERSION="33 (Workstation Edition)"
ID=fedora
VERSION_ID=33
VERSION_CODENAME=""
PLATFORM_ID="platform:f33"
PRETTY_NAME="Fedora 33 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:33"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f33/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=33
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=33
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
```

**Output of `uname -a`:**

```
Linux fedora 5.13.12-100.fc33.x86_64 #1 SMP Wed Aug 18 20:12:01 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
```

**Output of `cat /etc/containers/storage.conf`:**

Not relevant



Discussion / hints:

Fix patch:
diff --git a/Makefile b/Makefile
index f2e58cf2224..0a2b7c2f7a9 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,6 @@ BINDIR := $(PREFIX)/bin
 BASHINSTALLDIR = $(PREFIX)/share/bash-completion/completions
 BUILDFLAGS := -tags "$(BUILDTAGS)"
 BUILDAH := buildah
-RACEFLAGS := $(shell go test -race ./pkg/rusage > /dev/null 2>&1 && echo -race)
 
 GO := go
 GO110 := 1.10
@@ -23,6 +22,7 @@ else
 export GO_BUILD=$(GO) build
 export GO_TEST=$(GO) test
 endif
+RACEFLAGS := $(shell $(GO_TEST) -race ./pkg/dummy > /dev/null 2>&1 && echo -race)
 
 GIT_COMMIT ?= $(if $(shell git rev-parse --short HEAD),$(shell git rev-parse --short HEAD),$(error "git failed"))
 SOURCE_DATE_EPOCH ?= $(if $(shell date +%s),$(shell date +%s),$(error "date failed"))
@@ -71,9 +71,10 @@ bin/buildah: $(SOURCES) cmd/buildah/*.go
 .PHONY: buildah
 buildah: bin/buildah
 
-LINUX_CROSS_TARGETS = $(addprefix bin/buildah.,$(subst /,.,$(shell $(GO) tool dist list | grep ^linux/)))
-DARWIN_CROSS_TARGETS = $(addprefix bin/buildah.,$(subst /,.,$(shell $(GO) tool dist list | grep ^darwin/)))
-WINDOWS_CROSS_TARGETS = $(addsuffix .exe,$(addprefix bin/buildah.,$(subst /,.,$(shell $(GO) tool dist list | grep ^windows/))))
+ALL_CROSS_TARGETS := $(addprefix bin/buildah.,$(subst /,.,$(shell $(GO) tool dist list)))
+LINUX_CROSS_TARGETS := $(filter bin/buildah.linux.%,$(ALL_CROSS_TARGETS))
+DARWIN_CROSS_TARGETS := $(filter bin/buildah.darwin.%,$(ALL_CROSS_TARGETS))
+WINDOWS_CROSS_TARGETS := $(addsuffix .exe,$(filter bin/buildah.windows.%,$(ALL_CROSS_TARGETS)))
 .PHONY: cross
 cross: $(LINUX_CROSS_TARGETS) $(DARWIN_CROSS_TARGETS) $(WINDOWS_CROSS_TARGETS)
 


Test patch:
diff --git a/pkg/dummy/dummy_test.go b/pkg/dummy/dummy_test.go
new file mode 100644
index 00000000000..4326a92b6ff
--- /dev/null
+++ b/pkg/dummy/dummy_test.go
@@ -0,0 +1,8 @@
+package dummy
+
+import (
+	"testing"
+)
+
+func TestDummy(t *testing.T) {
+}