Skip to content

Commit

Permalink
fix Makefile bug and update deps for checking bugfix (#2002)
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <kpango@vdaas.org>
  • Loading branch information
kpango authored Apr 10, 2023
1 parent 3becb61 commit 9503588
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 169 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ GIT_COMMIT := $(eval GIT_COMMIT := $(shell git rev-list -1 HEAD))$(GIT_COMMIT)

MAKELISTS := Makefile $(shell find Makefile.d -type f -regex ".*\.mk")

ROOTDIR = $(eval ROOTDIR := $(shell git rev-parse --show-toplevel))$(ROOTDIR)
ROOTDIR = $(eval ROOTDIR := $(or $(shell git rev-parse --show-toplevel), $(PWD)))$(ROOTDIR)
PROTODIRS := $(eval PROTODIRS := $(shell find apis/proto -type d | sed -e "s%apis/proto/%%g" | grep -v "apis/proto"))$(PROTODIRS)
BENCH_DATASET_BASE_DIR = hack/benchmark/assets
BENCH_DATASET_MD5_DIR_NAME = checksum
Expand Down
116 changes: 61 additions & 55 deletions Makefile.d/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ cmd/agent/core/ngt/ngt: \
$(PBGOS) \
$(shell find $(ROOTDIR)/cmd/agent/core/ngt -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \
$(shell find $(ROOTDIR)/pkg/agent/core/ngt $(ROOTDIR)/pkg/agent/internal -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go')
$(eval CGO_ENABLED = 1)
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CXXFLAGS)" \
CGO_ENABLED=1 \
CGO_ENABLED=$(CGO_ENABLED) \
CGO_CXXFLAGS="-g -Ofast -march=native" \
CGO_FFLAGS="-g -Ofast -march=native" \
CGO_LDFLAGS="-g -Ofast -march=native" \
Expand All @@ -41,15 +42,15 @@ cmd/agent/core/ngt/ngt: \
go build \
--ldflags "-w -linkmode 'external' \
-extldflags '-static -fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lm -z relro -z now $(EXTLDFLAGS)' \
-X '$(ROOTDIR)/internal/info.Version=$(VERSION)' \
-X '$(ROOTDIR)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(ROOTDIR)/internal/info.BuildTime=$(DATETIME)' \
-X '$(ROOTDIR)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(ROOTDIR)/internal/info.GoOS=$(GOOS)' \
-X '$(ROOTDIR)/internal/info.GoArch=$(GOARCH)' \
-X '$(ROOTDIR)/internal/info.CGOEnabled=$${CGO_ENABLED}' \
-X '$(ROOTDIR)/internal/info.NGTVersion=$(NGT_VERSION)' \
-X '$(ROOTDIR)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-X '$(GOPKG)/internal/info.Version=$(VERSION)' \
-X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \
-X '$(GOPKG)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \
-X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \
-X '$(GOPKG)/internal/info.CGOEnabled=$(CGO_ENABLED)' \
-X '$(GOPKG)/internal/info.NGTVersion=$(NGT_VERSION)' \
-X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-buildid=" \
-mod=readonly \
-modcacherw \
Expand All @@ -65,19 +66,20 @@ cmd/agent/sidecar/sidecar: \
$(PBGOS) \
$(shell find $(ROOTDIR)/cmd/agent/sidecar -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \
$(shell find $(ROOTDIR)/pkg/agent/sidecar $(ROOTDIR)/pkg/agent/internal -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go')
CGO_ENABLED=0 \
$(eval CGO_ENABLED = 0)
CGO_ENABLED=$(CGO_ENABLED) \
GO111MODULE=on \
GOPRIVATE=$(GOPRIVATE) \
go build \
--ldflags "-w -extldflags=-static \
-X '$(ROOTDIR)/internal/info.Version=$(VERSION)' \
-X '$(ROOTDIR)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(ROOTDIR)/internal/info.BuildTime=$(DATETIME)' \
-X '$(ROOTDIR)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(ROOTDIR)/internal/info.GoOS=$(GOOS)' \
-X '$(ROOTDIR)/internal/info.GoArch=$(GOARCH)' \
-X '$(ROOTDIR)/internal/info.CGOEnabled=$${CGO_ENABLED}' \
-X '$(ROOTDIR)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-X '$(GOPKG)/internal/info.Version=$(VERSION)' \
-X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \
-X '$(GOPKG)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \
-X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \
-X '$(GOPKG)/internal/info.CGOEnabled=$(CGO_ENABLED)' \
-X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-buildid=" \
-mod=readonly \
-modcacherw \
Expand All @@ -93,19 +95,20 @@ cmd/discoverer/k8s/discoverer: \
$(PBGOS) \
$(shell find $(ROOTDIR)/cmd/discoverer/k8s -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \
$(shell find $(ROOTDIR)/pkg/discoverer/k8s -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go')
CGO_ENABLED=0 \
$(eval CGO_ENABLED = 0)
CGO_ENABLED=$(CGO_ENABLED) \
GO111MODULE=on \
GOPRIVATE=$(GOPRIVATE) \
go build \
--ldflags "-w -extldflags=-static \
-X '$(ROOTDIR)/internal/info.Version=$(VERSION)' \
-X '$(ROOTDIR)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(ROOTDIR)/internal/info.BuildTime=$(DATETIME)' \
-X '$(ROOTDIR)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(ROOTDIR)/internal/info.GoOS=$(GOOS)' \
-X '$(ROOTDIR)/internal/info.GoArch=$(GOARCH)' \
-X '$(ROOTDIR)/internal/info.CGOEnabled=$${CGO_ENABLED}' \
-X '$(ROOTDIR)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-X '$(GOPKG)/internal/info.Version=$(VERSION)' \
-X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \
-X '$(GOPKG)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \
-X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \
-X '$(GOPKG)/internal/info.CGOEnabled=$(CGO_ENABLED)' \
-X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-buildid=" \
-mod=readonly \
-modcacherw \
Expand All @@ -121,19 +124,20 @@ cmd/gateway/lb/lb: \
$(PBGOS) \
$(shell find $(ROOTDIR)/cmd/gateway/lb -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \
$(shell find $(ROOTDIR)/pkg/gateway/lb -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go')
CGO_ENABLED=0 \
$(eval CGO_ENABLED = 0)
CGO_ENABLED=$(CGO_ENABLED) \
GO111MODULE=on \
GOPRIVATE=$(GOPRIVATE) \
go build \
--ldflags "-w -extldflags=-static \
-X '$(ROOTDIR)/internal/info.Version=$(VERSION)' \
-X '$(ROOTDIR)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(ROOTDIR)/internal/info.BuildTime=$(DATETIME)' \
-X '$(ROOTDIR)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(ROOTDIR)/internal/info.GoOS=$(GOOS)' \
-X '$(ROOTDIR)/internal/info.GoArch=$(GOARCH)' \
-X '$(ROOTDIR)/internal/info.CGOEnabled=$${CGO_ENABLED}' \
-X '$(ROOTDIR)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-X '$(GOPKG)/internal/info.Version=$(VERSION)' \
-X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \
-X '$(GOPKG)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \
-X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \
-X '$(GOPKG)/internal/info.CGOEnabled=$(CGO_ENABLED)' \
-X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-buildid=" \
-mod=readonly \
-modcacherw \
Expand All @@ -149,19 +153,20 @@ cmd/gateway/filter/filter: \
$(PBGOS) \
$(shell find $(ROOTDIR)/cmd/gateway/filter -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \
$(shell find $(ROOTDIR)/pkg/gateway/filter -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go')
CGO_ENABLED=0 \
$(eval CGO_ENABLED = 0)
CGO_ENABLED=$(CGO_ENABLED) \
GO111MODULE=on \
GOPRIVATE=$(GOPRIVATE) \
go build \
--ldflags "-w -extldflags=-static \
-X '$(ROOTDIR)/internal/info.Version=$(VERSION)' \
-X '$(ROOTDIR)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(ROOTDIR)/internal/info.BuildTime=$(DATETIME)' \
-X '$(ROOTDIR)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(ROOTDIR)/internal/info.GoOS=$(GOOS)' \
-X '$(ROOTDIR)/internal/info.GoArch=$(GOARCH)' \
-X '$(ROOTDIR)/internal/info.CGOEnabled=$${CGO_ENABLED}' \
-X '$(ROOTDIR)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-X '$(GOPKG)/internal/info.Version=$(VERSION)' \
-X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \
-X '$(GOPKG)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \
-X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \
-X '$(GOPKG)/internal/info.CGOEnabled=$(CGO_ENABLED)' \
-X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-buildid=" \
-mod=readonly \
-modcacherw \
Expand All @@ -177,19 +182,20 @@ cmd/manager/index/index: \
$(PBGOS) \
$(shell find $(ROOTDIR)/cmd/manager/index -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \
$(shell find $(ROOTDIR)/pkg/manager/index -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go')
CGO_ENABLED=0 \
$(eval CGO_ENABLED = 0)
CGO_ENABLED=$(CGO_ENABLED) \
GO111MODULE=on \
GOPRIVATE=$(GOPRIVATE) \
go build \
--ldflags "-w -extldflags=-static \
-X '$(ROOTDIR)/internal/info.Version=$(VERSION)' \
-X '$(ROOTDIR)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(ROOTDIR)/internal/info.BuildTime=$(DATETIME)' \
-X '$(ROOTDIR)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(ROOTDIR)/internal/info.GoOS=$(GOOS)' \
-X '$(ROOTDIR)/internal/info.GoArch=$(GOARCH)' \
-X '$(ROOTDIR)/internal/info.CGOEnabled=$${CGO_ENABLED}' \
-X '$(ROOTDIR)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-X '$(GOPKG)/internal/info.Version=$(VERSION)' \
-X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \
-X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \
-X '$(GOPKG)/internal/info.GoVersion=$(GO_VERSION)' \
-X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \
-X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \
-X '$(GOPKG)/internal/info.CGOEnabled=$(CGO_ENABLED)' \
-X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \
-buildid=" \
-mod=readonly \
-modcacherw \
Expand Down
10 changes: 5 additions & 5 deletions example/client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ replace (
github.com/golang/protobuf => github.com/golang/protobuf v1.5.3
github.com/kpango/glg => github.com/kpango/glg v1.6.15
github.com/pkg/sftp => github.com/pkg/sftp v1.13.5
golang.org/x/crypto => golang.org/x/crypto v0.7.0
golang.org/x/net => golang.org/x/net v0.8.0
golang.org/x/text => golang.org/x/text v0.8.0
golang.org/x/crypto => golang.org/x/crypto v0.8.0
golang.org/x/net => golang.org/x/net v0.9.0
golang.org/x/text => golang.org/x/text v0.9.0
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd
google.golang.org/grpc => google.golang.org/grpc v1.54.0
google.golang.org/protobuf => google.golang.org/protobuf v1.30.0
Expand All @@ -32,8 +32,8 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/kpango/fastime v1.1.9 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/protobuf v1.30.0 // indirect
)
12 changes: 6 additions & 6 deletions example/client/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ github.com/vdaas/vald-client-go v1.7.4/go.mod h1:jx7HvypeG7FQKADJm2hAefnQV1ZA2DY
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENEmZU3BkO4e+fod7nKzgM=
gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I=
Expand Down
Loading

0 comments on commit 9503588

Please sign in to comment.