mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
Use AdressSantizer build when cpp files changed (#21809)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
e96af4e516
commit
66feb295da
22
.github/workflows/main.yaml
vendored
22
.github/workflows/main.yaml
vendored
@ -46,6 +46,26 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: 'Check Changed files'
|
||||||
|
id: changed-files-cpp
|
||||||
|
uses: tj-actions/changed-files@v35
|
||||||
|
with:
|
||||||
|
since_last_remote_commit: 'true'
|
||||||
|
files: |
|
||||||
|
**/*.cpp
|
||||||
|
**/*.cc
|
||||||
|
**/*.c
|
||||||
|
**/*.h
|
||||||
|
**/*.hpp
|
||||||
|
**/*.CMakeLists.txt
|
||||||
|
**/conanfiles.*
|
||||||
|
- name: 'Setup Use USE_ASAN'
|
||||||
|
if: steps.changed-files-cpp.outputs.any_changed == 'true'
|
||||||
|
run: |
|
||||||
|
echo "useasan=true" >> $GITHUB_ENV
|
||||||
|
echo "Setup USE_ASAN to true since cpp file(s) changed"
|
||||||
- name: 'Generate CCache Hash'
|
- name: 'Generate CCache Hash'
|
||||||
env:
|
env:
|
||||||
CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }}
|
CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }}
|
||||||
@ -76,7 +96,7 @@ jobs:
|
|||||||
docker-compose up -d pulsar etcd minio
|
docker-compose up -d pulsar etcd minio
|
||||||
- name: Build and UnitTest
|
- name: Build and UnitTest
|
||||||
run: |
|
run: |
|
||||||
./build/builder.sh /bin/bash -c "make ci-ut"
|
./build/builder.sh /bin/bash -c "make USE_ASAN={{env.useasan}} ci-ut"
|
||||||
- name: Get the status & restart count for containers when ut failed
|
- name: Get the status & restart count for containers when ut failed
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -150,7 +150,7 @@ build-cpp-with-unittest: download-milvus-proto
|
|||||||
|
|
||||||
build-cpp-with-coverage: download-milvus-proto
|
build-cpp-with-coverage: download-milvus-proto
|
||||||
@echo "Building Milvus cpp library with coverage and unittest ..."
|
@echo "Building Milvus cpp library with coverage and unittest ..."
|
||||||
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -u -a -c -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -u -a ${USE_ASAN} -c -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
||||||
|
|
||||||
|
|
||||||
# Run the tests.
|
# Run the tests.
|
||||||
|
|||||||
@ -59,7 +59,7 @@ EMBEDDED_MILVUS="OFF"
|
|||||||
BUILD_DISK_ANN="OFF"
|
BUILD_DISK_ANN="OFF"
|
||||||
USE_ASAN="OFF"
|
USE_ASAN="OFF"
|
||||||
|
|
||||||
while getopts "p:d:t:s:f:n:ulrcghzmeba" arg; do
|
while getopts "p:d:t:s:f:n:a:ulrcghzmeb" arg; do
|
||||||
case $arg in
|
case $arg in
|
||||||
f)
|
f)
|
||||||
CUSTOM_THIRDPARTY_PATH=$OPTARG
|
CUSTOM_THIRDPARTY_PATH=$OPTARG
|
||||||
@ -107,8 +107,12 @@ while getopts "p:d:t:s:f:n:ulrcghzmeba" arg; do
|
|||||||
BUILD_DISK_ANN=$OPTARG
|
BUILD_DISK_ANN=$OPTARG
|
||||||
;;
|
;;
|
||||||
a)
|
a)
|
||||||
|
ENV_VAL=$OPTARG
|
||||||
|
if [[ ${ENV_VAL} == 'true' ]]; then
|
||||||
|
echo "Set USE_ASAN to ON"
|
||||||
USE_ASAN="ON"
|
USE_ASAN="ON"
|
||||||
BUILD_TYPE=Debug
|
BUILD_TYPE=Debug
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
h) # help
|
h) # help
|
||||||
echo "
|
echo "
|
||||||
@ -127,7 +131,7 @@ parameter:
|
|||||||
-e: build without prometheus(default: OFF)
|
-e: build without prometheus(default: OFF)
|
||||||
-s: build with CUDA arch(default:DEFAULT), for example '-gencode=compute_61,code=sm_61;-gencode=compute_75,code=sm_75'
|
-s: build with CUDA arch(default:DEFAULT), for example '-gencode=compute_61,code=sm_61;-gencode=compute_75,code=sm_75'
|
||||||
-b: build embedded milvus(default: OFF)
|
-b: build embedded milvus(default: OFF)
|
||||||
-a: build milvus with AddressSanitizer
|
-a: build milvus with AddressSanitizer(default: false)
|
||||||
-h: help
|
-h: help
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user