Skip to content

Commit

Permalink
ci: Fix go build issues
Browse files Browse the repository at this point in the history
`-i` flag was removed from the Go 1.17, see
golang/go#41696. Besides, this PR fixes a jsonrpc
issue that has three same interface names.

`DOCKER_HOST_IP` is not used. Obtaining it depends on ifconfig, which is not
built-in on Ubuntu. This could lead to the command not found issue.

Signed-off-by: Xuewei Niu <[email protected]>
  • Loading branch information
justxuewei committed Apr 5, 2023
1 parent c24ddfb commit 280bff1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ export GONOPROXY ?= **.gitee.com**
OS := $(shell uname)
ifeq ($(OS), Linux)
export GOOS ?= linux
export DOCKER_HOST_IP = $(shell ifconfig enp3s0 | grep inet | grep -v inet6 | awk '{print $$2}')
else ifeq ($(OS), Darwin)
export GOOS ?= darwin
export DOCKER_HOST_IP = $(shell ifconfig en0 | grep inet | grep -v inet6 | awk '{print $$2}')
else
export GOOS ?= windows
export DOCKER_HOST_IP = $(shell ifconfig en0 | grep inet | grep -v inet6 | awk '{print $$2}')
endif

ifeq ($(GOOS), windows)
Expand Down Expand Up @@ -97,7 +94,7 @@ build: $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME)
.PHONY: $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME)
$(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME):
$(info > Buiding application binary: $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME))
@CGO_ENABLED=$(CGO) GOOS=$(GOOS) GOARCH=$(GOARCH) go build $(GCFLAGS) -ldflags=$(LDFLAGS) -i -o $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME) $(SOURCES)
@CGO_ENABLED=$(CGO) GOOS=$(GOOS) GOARCH=$(GOARCH) go build $(GCFLAGS) -ldflags=$(LDFLAGS) -o $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME) $(SOURCES)

## docker-health-check: check services health on docker
.PHONY: docker-health-check
Expand Down
4 changes: 2 additions & 2 deletions rpc/jsonrpc/go-client/conf/dubbogo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ dubbo:
UserProvider1:
protocol: jsonrpc
version: 2.0
interface: org.apache.dubbo.samples.UserProvider
interface: org.apache.dubbo.samples.UserProvider1
UserProvider2:
protocol: jsonrpc
version: 2.0
group: as
interface: org.apache.dubbo.samples.UserProvider
interface: org.apache.dubbo.samples.UserProvider2
logger:
zap-config:
level: info
4 changes: 2 additions & 2 deletions rpc/jsonrpc/go-server/conf/dubbogo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ dubbo:
UserProvider:
interface: org.apache.dubbo.samples.UserProvider
UserProvider1:
interface: org.apache.dubbo.samples.UserProvider
interface: org.apache.dubbo.samples.UserProvider1
version: 2.0
UserProvider2:
interface: org.apache.dubbo.samples.UserProvider
interface: org.apache.dubbo.samples.UserProvider2
version: 2.0
group: as
logger:
Expand Down

0 comments on commit 280bff1

Please sign in to comment.