Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ OBSERVABILITY_DIR := hack/observability

export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)

# DBG=1 for building binaries which includes DWARF and symbol table for delve
# degubbing. When DBG is unspecified it defaults to "-s -w" which strips debug
# information.
export DBG ?= 0

#
# Ginkgo configuration.
#
Expand Down
7 changes: 6 additions & 1 deletion hack/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ version::ldflags() {
add_ldflag "gitReleaseCommit" "${GIT_RELEASE_COMMIT}"

# The -ldflags parameter takes a single string, so join the output.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check if that breaks using Tilt with the debugger. Probably not, but not entirely sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ldflags set in separate place for Tilt. it does not affect the tilt debugging.

build_cmd = "{build_env} go build {build_options} -gcflags '{gcflags}' -ldflags '{ldflags}' -o .tiltbuild/bin/{binary_name} {go_main}".format(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also tested and working fine.

echo "${ldflags[*]-}"
# When DBG is set to 1 include DWARF and symbol table for delve degubbing
if [[ "${DBG:-}" == 1 ]]; then
echo "${ldflags[*]-}"
else
echo "${ldflags[*]-}" " -s -w"
fi
}

version::ldflags
3 changes: 3 additions & 0 deletions scripts/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ set -o errexit
set -o nounset
set -o pipefail

# Include debugging tools for build test
export DBG=1

REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

# Core Cluster API and Docker provider
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ source "${REPO_ROOT}/hack/ensure-kind.sh"
# Make sure the tools binaries are on the path.
export PATH="${REPO_ROOT}/hack/tools/bin:${PATH}"

# Include debugging tools for container images for e2e tests
export DBG=1

# Builds CAPI (and CAPD) images.
capi:buildDockerImages

Expand Down