From 4194cb5d56b1eec8bcc4f16cfd7add806aa8b5d7 Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Tue, 3 Nov 2020 20:19:08 +0800 Subject: [PATCH] Add cmake_build directory to gitignore and optimize the logic of golangci-lint Signed-off-by: cai.zhang --- .gitignore | 1 + Makefile | 6 ++++-- docker-compose.yml | 2 +- internal/core/build.sh | 6 +++--- scripts/core_build.sh | 3 +-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index d8734841ee..a1966bddf2 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ sdk/cmake_build_release # Compiled source bin/ lib/ +cmake_build/ *.a *.so *.so.* diff --git a/Makefile b/Makefile index 9d841f9b7a..9b6218e870 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,9 @@ fmt: lint: @echo "Running $@ check" @GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean - @GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=1m --config ./.golangci.yml || true + @GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=1m --config ./.golangci.yml ./internal/ || true + @GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=1m --config ./.golangci.yml ./cmd/ || true + @GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=1m --config ./.golangci.yml ./test/ || true ruleguard: @echo "Running $@ check" @@ -45,7 +47,7 @@ ruleguard: verifiers: get-check-deps fmt lint ruleguard # Builds various components locally. -build-go: verifiers +build-go: @echo "Building each component's binary to './'" @echo "Building reader ..." @mkdir -p $(INSTALL_PATH) && GO111MODULE=on $(GO) build -o $(INSTALL_PATH)/reader $(PWD)/cmd/reader/reader.go 1>/dev/null diff --git a/docker-compose.yml b/docker-compose.yml index 4375391cd7..ce0566991b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,4 +24,4 @@ services: working_dir: "/milvus-distributed" command: &ubuntu-command > /bin/bash -c " - make all" + make verifiers && make all" diff --git a/internal/core/build.sh b/internal/core/build.sh index 2af4ff088a..484fcc500a 100755 --- a/internal/core/build.sh +++ b/internal/core/build.sh @@ -14,10 +14,10 @@ done SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -BUILD_OUTPUT_DIR="cmake_build" +BUILD_OUTPUT_DIR="${SCRIPTS_DIR}/../../cmake_build" BUILD_TYPE="Release" BUILD_UNITTEST="OFF" -INSTALL_PREFIX=${SCRIPTS_DIR}/output +INSTALL_PREFIX="${SCRIPTS_DIR}/output" MAKE_CLEAN="OFF" BUILD_COVERAGE="OFF" DB_PATH="/tmp/milvus" @@ -133,7 +133,7 @@ CMAKE_CMD="cmake \ -DMILVUS_WITH_PROMETHEUS=${WITH_PROMETHEUS} \ -DMILVUS_CUDA_ARCH=${CUDA_ARCH} \ -DCUSTOM_THIRDPARTY_DOWNLOAD_PATH=${CUSTOM_THIRDPARTY_PATH} \ -../" +${SCRIPTS_DIR}" echo ${CMAKE_CMD} ${CMAKE_CMD} diff --git a/scripts/core_build.sh b/scripts/core_build.sh index aef80771bd..f74decce30 100755 --- a/scripts/core_build.sh +++ b/scripts/core_build.sh @@ -14,9 +14,8 @@ done SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" CPP_SRC_DIR="${SCRIPTS_DIR}/../internal/core" -CPP_BUILD_DIR="${CPP_SRC_DIR}/cmake_build" -BUILD_OUTPUT_DIR=${CPP_BUILD_DIR} +BUILD_OUTPUT_DIR="${SCRIPTS_DIR}/../cmake_build" BUILD_TYPE="Release" BUILD_UNITTEST="OFF" INSTALL_PREFIX="${CPP_SRC_DIR}/output"