This is an automated email from the ASF dual-hosted git repository.

liuhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-go.git


The following commit(s) were added to refs/heads/main by this push:
     new f989faf  Fix cannot find file when exec build in test/plugins (#211)
f989faf is described below

commit f989fafa9b646b403aacd453ac6ba17a1b0cf5e4
Author: Zixin Zhou <[email protected]>
AuthorDate: Tue Dec 17 07:59:31 2024 +0800

    Fix cannot find file when exec build in test/plugins (#211)
---
 CHANGES.md              | 1 +
 test/plugins/Makefile   | 8 +++++++-
 tools/go-agent/Makefile | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index 9b6eef0..7a545b0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -21,6 +21,7 @@ Release Notes.
 #### Bug Fixes
 * Fix wrong docker image name and `-version` command.
 * Fix redis plugin cannot work in cluster mode.
+* Fix cannot find file when exec build in test/plugins.
 
 #### Issues and PR
 - All issues are 
[here](https://github.com/apache/skywalking/milestone/219?closed=1)
diff --git a/test/plugins/Makefile b/test/plugins/Makefile
index 1527195..b66b86f 100644
--- a/test/plugins/Makefile
+++ b/test/plugins/Makefile
@@ -18,12 +18,18 @@
 GO = go
 GO_BUILD = $(GO) build
 
+GIT_VERSION := $(shell git rev-parse --short HEAD)
+ifeq ($(strip $(GIT_VERSION)),)
+    GIT_VERSION = $(shell grep gitCommit $(VERSION_FILE) | awk -F ': ' '{print 
$$2}')
+endif
+VERSION ?= $(GIT_VERSION)
+
 .PHONY: build
 build:
        mkdir -p dist
        # go agent
        @make -C ../../tools/go-agent linux
-       cp ../../bin/skywalking-go-agent--linux-$(shell go env GOARCH) 
dist/skywalking-go-agent
+       cp ../../bin/skywalking-go-agent-$(VERSION)-linux-$(shell go env 
GOARCH) dist/skywalking-go-agent
        # runner helper
        cd runner-helper && $(GO_BUILD) -o ../dist/runner-helper
        # validator container
diff --git a/tools/go-agent/Makefile b/tools/go-agent/Makefile
index 1ab2a69..5249214 100644
--- a/tools/go-agent/Makefile
+++ b/tools/go-agent/Makefile
@@ -30,6 +30,9 @@ ifeq ($(strip $(GIT_COMMIT)),)
     GIT_COMMIT = $(shell grep gitCommit $(VERSION_PATH) | awk -F ': ' '{print 
$$2}')
 endif
 VERSION ?= $(shell grep version $(VERSION_PATH) | awk -F ': ' '{print $$2}')
+ifeq ($(strip $(VERSION)),)
+    VERSION = $(GIT_COMMIT)
+endif
 
 GO_VERSION := $(shell $(GO) env GOVERSION)
 VERSION_PACKAGE := main

Reply via email to