diff --git a/Makefile b/Makefile index f7d48f98a3..1ccadd8496 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ disk_index = OFF export GIT_BRANCH=master -milvus: build-cpp update-api-version print-build-info +milvus: build-cpp print-build-info @echo "Building Milvus ..." @source $(PWD)/scripts/setenv.sh && \ mkdir -p $(INSTALL_PATH) && go env -w CGO_ENABLED="1" && \ @@ -71,7 +71,7 @@ lint: tools/bin/revive @tools/bin/revive -formatter friendly -config tools/check/revive.toml ./... #TODO: Check code specifications by golangci-lint -static-check: update-api-version +static-check: @echo "Running $@ check" @GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean @source $(PWD)/scripts/setenv.sh && GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=30m --config ./.golangci.yml ./internal/... @@ -119,13 +119,15 @@ embd-milvus: build-cpp-embd print-build-info GO111MODULE=on $(GO) build -ldflags="-r /tmp/milvus/lib/ -X '$(OBJPREFIX).BuildTags=$(BUILD_TAGS)' -X '$(OBJPREFIX).BuildTime=$(BUILD_TIME)' -X '$(OBJPREFIX).GitCommit=$(GIT_COMMIT)' -X '$(OBJPREFIX).GoVersion=$(GO_VERSION)'" \ ${APPLE_SILICON_FLAG} -buildmode=c-shared -o $(INSTALL_PATH)/embd-milvus.so $(PWD)/pkg/embedded/embedded.go 1>/dev/null +update-milvus-api: download-milvus-proto update-api-version + download-milvus-proto: @echo "Download milvus-proto repo ..." @(env bash $(PWD)/scripts/download_milvus_proto.sh) update-api-version: @echo "Update milvus/api version ..." - @(env bash $(PWD)/scripts/update_api_version.sh) + @(env bash $(PWD)/scripts/update_milvus_api.sh) build-cpp: download-milvus-proto @echo "Building Milvus cpp library ..." diff --git a/go.mod b/go.mod index e9ae3e964a..b1c6bf5252 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( github.com/panjf2000/ants/v2 v2.4.8 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 + github.com/quasilyte/go-ruleguard/dsl v0.3.21 github.com/sandertv/go-formula/v2 v2.0.0-alpha.7 github.com/sbinet/npyio v0.6.0 github.com/shirou/gopsutil/v3 v3.22.9 @@ -193,8 +194,6 @@ require ( sigs.k8s.io/yaml v1.2.0 // indirect ) -require github.com/quasilyte/go-ruleguard/dsl v0.3.21 // indirect - replace ( github.com/apache/pulsar-client-go => github.com/milvus-io/pulsar-client-go v0.6.8 github.com/bketelsen/crypt => github.com/bketelsen/crypt v0.0.4 // Fix security alert for core-os/etcd @@ -202,7 +201,4 @@ replace ( github.com/go-kit/kit => github.com/go-kit/kit v0.1.0 github.com/streamnative/pulsarctl => github.com/xiaofan-luan/pulsarctl v0.5.1 github.com/tecbot/gorocksdb => github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b // indirect -// If you want to use the hook interceptor, the following code should be commented out -// and you should modify the api version to be the same as the `so` project. -//replace github.com/milvus-io/milvus-proto/go-api => github.com/SimFG/milvus-proto/go-api v0.0.0-20221012123137-df1cf6457a79 ) diff --git a/go.sum b/go.sum index 024d8dec7d..b683db34fa 100644 --- a/go.sum +++ b/go.sum @@ -493,8 +493,6 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyex github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZzUfIfYe5qYDBzt4ZYRqzUjTR6CvUzjat8= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4= -github.com/milvus-io/milvus-proto/go-api v0.0.0-20221013061520-f0f555f4f091 h1:hCuXvhJweswxha1A9+VlnrcZPRwcRwukb00Y6k+RaJo= -github.com/milvus-io/milvus-proto/go-api v0.0.0-20221013061520-f0f555f4f091/go.mod h1:148qnlmZ0Fdm1Fq+Mj/OW2uDoEP25g3mjh0vMGtkgmk= github.com/milvus-io/milvus-proto/go-api v0.0.0-20221014075920-6c03ca8c3749 h1:IB+Jyx3dVtrMSGYYVlobkSC9Kat+lxd/GM1i0cKIJXA= github.com/milvus-io/milvus-proto/go-api v0.0.0-20221014075920-6c03ca8c3749/go.mod h1:148qnlmZ0Fdm1Fq+Mj/OW2uDoEP25g3mjh0vMGtkgmk= github.com/milvus-io/pulsar-client-go v0.6.8 h1:fZdZH73aPRszu2fazyeeahQEz34tyn1Pt9EkqJmV100= diff --git a/rules.go b/rules.go index 4c45aa7c5d..6142b4b581 100644 --- a/rules.go +++ b/rules.go @@ -14,9 +14,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build ignore -// +build ignore - package gorules import ( diff --git a/scripts/update_api_version.sh b/scripts/update-api-version.sh similarity index 70% rename from scripts/update_api_version.sh rename to scripts/update-api-version.sh index 31e141814a..22c0ac0681 100755 --- a/scripts/update_api_version.sh +++ b/scripts/update-api-version.sh @@ -6,12 +6,11 @@ function line() } line -echo "Update the milvus/api version" -commitID=$(git ls-remote https://github.com/milvus-io/milvus-proto.git refs/heads/$GIT_BRANCH | cut -f 1) +echo "Update the milvus-proto/api version" +commitID=$(git ls-remote https://github.com/milvus-io/milvus-proto.git refs/heads/master | cut -f 1) go get github.com/milvus-io/milvus-proto/go-api@$commitID SCRIPTS_DIR=$(dirname "$0") EXAMPLE_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty/protobuf/protobuf-src/examples rm -rf $EXAMPLE_DIR -go mod tidy -go get github.com/quasilyte/go-ruleguard/dsl@v0.3.21 \ No newline at end of file +go mod tidy \ No newline at end of file