1
0
mirror of https://github.com/etcd-io/etcd.git synced 2026-02-05 06:46:49 +01:00

Disable optimization and inlining for Antithesis to make using debugger easier

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
Marek Siarkowicz
2025-11-16 21:40:49 +01:00
parent 91201b1a02
commit d6f85c53d6
2 changed files with 5 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ CGO_ENABLED="${CGO_ENABLED:-0}"
# Set GO_LDFLAGS="-s" for building without symbols for debugging.
# shellcheck disable=SC2206
GO_LDFLAGS=(${GO_LDFLAGS:-} "-X=${VERSION_SYMBOL}=${GIT_SHA}")
GO_GCFLAGS=${GO_GCFLAGS:-}
GO_BUILD_ENV=("CGO_ENABLED=${CGO_ENABLED}" "GO_BUILD_FLAGS=${GO_BUILD_FLAGS}" "GOOS=${GOOS}" "GOARCH=${GOARCH}")
etcd_build() {
@@ -46,6 +47,7 @@ etcd_build() {
-trimpath \
-installsuffix=cgo \
"-ldflags=${GO_LDFLAGS[*]}" \
-gcflags="${GO_GCFLAGS}" \
-o="../${out}/etcd" . || return 2
) || return 2
@@ -57,6 +59,7 @@ etcd_build() {
-trimpath \
-installsuffix=cgo \
"-ldflags=${GO_LDFLAGS[*]}" \
-gcflags="${GO_GCFLAGS}" \
-o="../${out}/etcdutl" . || return 2
) || return 2
@@ -68,6 +71,7 @@ etcd_build() {
-trimpath \
-installsuffix=cgo \
"-ldflags=${GO_LDFLAGS[*]}" \
-gcflags="${GO_GCFLAGS}" \
-o="../${out}/etcdctl" . || return 2
) || return 2
# Verify whether symbol we overwrote exists

View File

@@ -51,7 +51,7 @@ RUN for d in server etcdutl etcdctl; do \
# The instrumentation also adds a new main file which clashes with dummy.go found in non release-3.4 branches
RUN if [ -f "dummy.go" ]; then sed -i 's/package main_test/package main/' dummy.go; fi
RUN CGO_ENABLED=1 make build
RUN CGO_ENABLED=1 GO_GCFLAGS="all=-N -l" make build
RUN go install github.com/go-delve/delve/cmd/dlv@latest
FROM ubuntu:24.04