Skip to content

Commit d8023d4

Browse files
Merge pull request #13325 from smarterclayton/cherryp1
CGO_ENABLED prevents build cache reuse
2 parents 161cc0a + 45ad91d commit d8023d4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

hack/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ os::build::internal::build_binaries() {
237237
for test in "${tests[@]:+${tests[@]}}"; do
238238
local outfile="${OS_OUTPUT_BINPATH}/${platform}/$(basename ${test})"
239239
# disabling cgo allows use of delve
240-
CGO_ENABLED=0 GOOS=${platform%/*} GOARCH=${platform##*/} go test \
240+
CGO_ENABLED="${OS_TEST_CGO_ENABLED:-}" GOOS=${platform%/*} GOARCH=${platform##*/} go test \
241241
-pkgdir "${OS_OUTPUT_PKGDIR}/${platform}" \
242242
-tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_test_envvar:-}" \
243243
-ldflags "${version_ldflags}" \

hack/test-integration.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ name="$(basename ${package})"
2626
dlv_debug="${DLV_DEBUG:-}"
2727
verbose="${VERBOSE:-}"
2828

29+
# CGO must be disabled in order to debug
30+
if [[ -n "${dlv_debug}" ]]; then
31+
export OS_TEST_CGO_ENABLED=0
32+
fi
33+
2934
# build the test executable
3035
if [[ -n "${OPENSHIFT_SKIP_BUILD:-}" ]]; then
3136
os::log::warn "Skipping build due to OPENSHIFT_SKIP_BUILD"

0 commit comments

Comments
 (0)