Skip to content

Commit 70a2ac6

Browse files
authored
Merge pull request #20933 from serathius/antithesis-gcflags
Disable optimization and inlining for Antithesis to make using debugger easier
2 parents 91201b1 + d6f85c5 commit 70a2ac6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

scripts/build_lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ CGO_ENABLED="${CGO_ENABLED:-0}"
3131
# Set GO_LDFLAGS="-s" for building without symbols for debugging.
3232
# shellcheck disable=SC2206
3333
GO_LDFLAGS=(${GO_LDFLAGS:-} "-X=${VERSION_SYMBOL}=${GIT_SHA}")
34+
GO_GCFLAGS=${GO_GCFLAGS:-}
3435
GO_BUILD_ENV=("CGO_ENABLED=${CGO_ENABLED}" "GO_BUILD_FLAGS=${GO_BUILD_FLAGS}" "GOOS=${GOOS}" "GOARCH=${GOARCH}")
3536

3637
etcd_build() {
@@ -46,6 +47,7 @@ etcd_build() {
4647
-trimpath \
4748
-installsuffix=cgo \
4849
"-ldflags=${GO_LDFLAGS[*]}" \
50+
-gcflags="${GO_GCFLAGS}" \
4951
-o="../${out}/etcd" . || return 2
5052
) || return 2
5153

@@ -57,6 +59,7 @@ etcd_build() {
5759
-trimpath \
5860
-installsuffix=cgo \
5961
"-ldflags=${GO_LDFLAGS[*]}" \
62+
-gcflags="${GO_GCFLAGS}" \
6063
-o="../${out}/etcdutl" . || return 2
6164
) || return 2
6265

@@ -68,6 +71,7 @@ etcd_build() {
6871
-trimpath \
6972
-installsuffix=cgo \
7073
"-ldflags=${GO_LDFLAGS[*]}" \
74+
-gcflags="${GO_GCFLAGS}" \
7175
-o="../${out}/etcdctl" . || return 2
7276
) || return 2
7377
# Verify whether symbol we overwrote exists

tests/antithesis/server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ RUN for d in server etcdutl etcdctl; do \
5151

5252
# The instrumentation also adds a new main file which clashes with dummy.go found in non release-3.4 branches
5353
RUN if [ -f "dummy.go" ]; then sed -i 's/package main_test/package main/' dummy.go; fi
54-
RUN CGO_ENABLED=1 make build
54+
RUN CGO_ENABLED=1 GO_GCFLAGS="all=-N -l" make build
5555
RUN go install github.com/go-delve/delve/cmd/dlv@latest
5656

5757
FROM ubuntu:24.04

0 commit comments

Comments
 (0)