Skip to content

Check that version number is corectly embedded in the binary #7092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 3, 2025
Merged
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: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ else
RACE=-race
endif
# sed on Mac does not support the same syntax for in-place updates as sed on Linux
# When running on MacOS it's best to install gsed and run Makefile with SED=gsed
ifeq ($(GOOS),darwin)
# When running on MacOS it's best to install gsed and run Makefile with SED=gsed.
# We want the actual OS here, not what GOOS may have been set to by recursive make calls.
ifeq ($(shell GOOS= $(GO) env GOOS),darwin)
SED=gsed
else
SED=sed
Expand Down
26 changes: 23 additions & 3 deletions scripts/makefiles/BuildBinaries.mk
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,26 @@ _build-a-binary-%:
build-jaeger: BIN_NAME = jaeger
build-jaeger: BUILD_INFO = $(BUILD_INFO_V2)
build-jaeger: build-ui _build-a-binary-jaeger$(SUFFIX)-$(GOOS)-$(GOARCH)
@ set -euf -o pipefail ; \
echo "Checking version of built binary" ; \
REAL_GOOS=$(shell GOOS= $(GO) env GOOS) ; \
REAL_GOARCH=$(shell GOARCH= $(GO) env GOARCH) ; \
if [ "$(GOOS)" == "$$REAL_GOOS" ] && [ "$(GOARCH)" == "$$REAL_GOARCH" ]; then \
./cmd/jaeger/jaeger-$(GOOS)-$(GOARCH) version 2>/dev/null ; \
echo "" ; \
want=$(GIT_CLOSEST_TAG_V2) ; \
have=$$(./cmd/jaeger/jaeger-$(GOOS)-$(GOARCH) version 2>/dev/null | jq -r .gitVersion) ; \
if [ "$$want" == "$$have" ]; then \
echo "🟢 versions match: want=$$want, have=$$have" ; \
else \
echo "❌ ERROR: version mismatch: want=$$want, have=$$have" ; \
false; \
fi ; \
else \
echo ".. skipping version check for cross-compilation" ; \
echo ".. see build-binaries-$(GOOS)-$(GOARCH)" ; \
fi


.PHONY: build-all-in-one
build-all-in-one: BIN_NAME = all-in-one
Expand Down Expand Up @@ -127,11 +147,11 @@ build-binaries-linux-ppc64le:
# build all binaries for one specific platform GOOS/GOARCH
.PHONY: _build-platform-binaries
_build-platform-binaries: \
build-jaeger \
build-all-in-one \
build-collector \
build-query \
build-ingester \
build-jaeger \
build-remote-storage \
build-examples \
build-tracegen \
Expand All @@ -146,12 +166,12 @@ _build-platform-binaries: \
.PHONY: _build-platform-binaries-debug
_build-platform-binaries-debug:
_build-platform-binaries-debug: \
build-jaeger \
build-collector \
build-query \
build-ingester \
build-remote-storage \
build-all-in-one \
build-jaeger
build-all-in-one

.PHONY: build-all-platforms
build-all-platforms:
Expand Down
Loading