Pull request: all: add race build mode
Squashed commit of the following: commit 37ca2962b0c7ee870d07aee5043edcdeb2b2c2ad Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Apr 2 13:27:32 2021 +0300 all: run tests with race enabled commit 20af1abb95f65c8fa46f6e00172ab8f54a785285 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Apr 2 13:14:36 2021 +0300 all: add race build mode
This commit is contained in:
@@ -91,10 +91,22 @@ else
|
||||
readonly out_flags=''
|
||||
fi
|
||||
|
||||
# Don't use cgo. Use modules.
|
||||
export CGO_ENABLED='0' GO111MODULE='on'
|
||||
# Allow users to enable the race detector. Unfortunately, that means
|
||||
# that CGo must be enabled.
|
||||
readonly race="${RACE:-0}"
|
||||
if [ "$race" = '0' ]
|
||||
then
|
||||
readonly cgo_enabled='0'
|
||||
readonly race_flags=''
|
||||
else
|
||||
readonly cgo_enabled='1'
|
||||
readonly race_flags='--race'
|
||||
fi
|
||||
|
||||
readonly build_flags="${BUILD_FLAGS:-$out_flags $par_flags\
|
||||
export CGO_ENABLED="$cgo_enabled"
|
||||
export GO111MODULE='on'
|
||||
|
||||
readonly build_flags="${BUILD_FLAGS:-$race_flags $out_flags $par_flags\
|
||||
$v_flags $x_flags}"
|
||||
|
||||
# Don't use quotes with flag variables to get word splitting.
|
||||
|
||||
Reference in New Issue
Block a user