File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ os::build::internal::build_binaries() {
237
237
for test in " ${tests[@]: +${tests[@]} } " ; do
238
238
local outfile=" ${OS_OUTPUT_BINPATH} /${platform} /$( basename ${test} ) "
239
239
# 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 \
241
241
-pkgdir " ${OS_OUTPUT_PKGDIR} /${platform} " \
242
242
-tags " ${OS_GOFLAGS_TAGS-} ${! platform_gotags_test_envvar:- } " \
243
243
-ldflags " ${version_ldflags} " \
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ name="$(basename ${package})"
26
26
dlv_debug=" ${DLV_DEBUG:- } "
27
27
verbose=" ${VERBOSE:- } "
28
28
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
+
29
34
# build the test executable
30
35
if [[ -n " ${OPENSHIFT_SKIP_BUILD:- } " ]]; then
31
36
os::log::warn " Skipping build due to OPENSHIFT_SKIP_BUILD"
You can’t perform that action at this time.
0 commit comments