Skip to content

Commit ae8709f

Browse files
CopilotyurishkuroCopilot
authored
fix: use $(SUFFIX) in version-check binary path for debug builds (#8148)
The version-check step in `build-jaeger` hardcoded the binary name without `$(SUFFIX)`, so when invoked via `_build-platform-binaries-debug` (which sets `DEBUG_BINARY=1` → `SUFFIX=-debug`), the check either failed with "binary not found" or silently validated the release binary instead of the debug one. - **`scripts/makefiles/BuildBinaries.mk`**: Replace `./cmd/jaeger/jaeger-$(GOOS)-$(GOARCH)` with `./cmd/jaeger/jaeger$(SUFFIX)-$(GOOS)-$(GOARCH)` in both version-check invocations — no-op for release builds (`SUFFIX` is empty), correct for debug builds (`SUFFIX=-debug`). <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/jaegertracing/jaeger/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: yurishkuro <3523016+yurishkuro@users.noreply.github.com> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 24b2464 commit ae8709f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

scripts/build/build-upload-docker-images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ build_image() {
8383
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" "${base_flags[@]}" -c "$component" -d "$dir" -p "${platforms}" "${target_flags[@]}"
8484

8585
if [[ "$build_debug" == "true" ]] && [[ "${add_debugger}" == "Y" ]]; then
86-
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" "${base_flags[@]}" -c "${component}-debug" -d "$dir" -t debug
86+
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" "${base_flags[@]}" -c "${component}-debug" -d "$dir" -p "${platforms}" -t debug
8787
fi
8888
}
8989

scripts/makefiles/BuildBinaries.mk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ build-jaeger: build-ui _build-a-binary-jaeger$(SUFFIX)-$(GOOS)-$(GOARCH)
8585
REAL_GOOS=$(shell GOOS= $(GO) env GOOS) ; \
8686
REAL_GOARCH=$(shell GOARCH= $(GO) env GOARCH) ; \
8787
if [ "$(GOOS)" == "$$REAL_GOOS" ] && [ "$(GOARCH)" == "$$REAL_GOARCH" ]; then \
88-
./cmd/jaeger/jaeger-$(GOOS)-$(GOARCH) version 2>/dev/null ; \
88+
./cmd/jaeger/jaeger$(SUFFIX)-$(GOOS)-$(GOARCH) version 2>/dev/null ; \
8989
echo "" ; \
9090
want=$(GIT_CLOSEST_TAG) ; \
91-
have=$$(./cmd/jaeger/jaeger-$(GOOS)-$(GOARCH) version 2>/dev/null | jq -r .gitVersion) ; \
91+
have=$$(./cmd/jaeger/jaeger$(SUFFIX)-$(GOOS)-$(GOARCH) version 2>/dev/null | jq -r .gitVersion) ; \
9292
if [ "$$want" == "$$have" ]; then \
9393
echo "☑️ versions match: want=$$want, have=$$have" ; \
9494
else \
@@ -157,11 +157,11 @@ ifneq ($(SKIP_DEBUG_BINARIES),1)
157157
endif
158158

159159
# build binaries that support DEBUG release, for one specific platform GOOS/GOARCH
160+
# Uses recursive make calls so that DEBUG_BINARY=1 is set at parse time,
161+
# ensuring SUFFIX=-debug is correctly evaluated in the ifeq conditional at the top.
160162
.PHONY: _build-platform-binaries-debug
161-
_build-platform-binaries-debug: DEBUG_BINARY=1
162-
_build-platform-binaries-debug: \
163-
build-jaeger \
164-
build-remote-storage
163+
_build-platform-binaries-debug:
164+
$(MAKE) build-jaeger build-remote-storage GOOS=$(GOOS) GOARCH=$(GOARCH) DEBUG_BINARY=1
165165

166166
.PHONY: build-all-platforms
167167
build-all-platforms:

0 commit comments

Comments
 (0)