Skip to content

Commit 9a4a57c

Browse files
TODO: (#21)
1 parent a22703d commit 9a4a57c

File tree

9 files changed

+50
-54
lines changed

9 files changed

+50
-54
lines changed

.bazelrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ build:windows --action_env TMP=C:/Windows/Temp
5959
build:windows --action_env TEMP=C:/Windows/Temp
6060
build:windows --cxxopt="/DWIN32_LEAN_AND_MEAN"
6161

62-
# Config for when tests are running in a "slow" environment such as Valgrind or TSan
63-
build:slow-tests --copt="-DIMPROBABLE_SLOW_TEST"
64-
6562
# Valgrind config.
6663
build:valgrind-memcheck --config=linux
67-
build:valgrind-memcheck --config=slow-tests
64+
build:valgrind-memcheck --define valgrind-memcheck=true
6865
test:valgrind-memcheck --run_under=//tools/runners/sanitizers/valgrind-memcheck
6966
run:valgrind-memcheck --run_under=//tools/runners/sanitizers/valgrind-memcheck
7067

@@ -85,7 +82,6 @@ test:asan --test_env="ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-9/bin/llvm-symbolizer"
8582
test:asan --run_under=//tools/runners/sanitizers/asan
8683

8784
build:tsan --config=base-sanitizer
88-
build:tsan --config=slow-tests
8985
build:tsan --copt="-O1"
9086
build:tsan --copt="-fno-optimize-sibling-calls"
9187
build:tsan --copt="-fsanitize=thread"

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
4.2.2

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
- FilterSphere for filtering by sphere constraint (by ctbur)
1010
### Changed
1111
- Fixed imports `<climits>` -> `<limits>` (by ctbur)
12+
- Cleaned up build scripts
1213
- Fixed warnings:
13-
- "unused" function argument warnings
14+
- "unused function argument" warnings
1415
- gcc/clang warnings
1516
- MSVC warnings
1617
- reserved identifier warnings (identifiers starting with `_`)

WORKSPACE

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ http_archive(
1111
load("@bazel_skylib//lib:versions.bzl", "versions")
1212

1313
versions.check(
14-
minimum_bazel_version = "3.4.1",
15-
maximum_bazel_version = "3.4.1",
14+
minimum_bazel_version = "4.2.2",
15+
maximum_bazel_version = "4.2.2",
1616
)
1717

1818
# NOTE: We make third_party/ its own bazel workspace because it allows to run `bazel build ...` without
@@ -34,9 +34,9 @@ http_archive(
3434

3535
http_archive(
3636
name = "gbenchmark",
37-
sha256 = "3c6a165b6ecc948967a1ead710d4a181d7b0fbcaa183ef7ea84604994966221a",
38-
strip_prefix = "benchmark-1.5.0",
39-
url = "https://github.com/google/benchmark/archive/v1.5.0.tar.gz",
37+
sha256 = "dccbdab796baa1043f04982147e67bb6e118fe610da2c65f88912d73987e700c",
38+
strip_prefix = "benchmark-1.5.2",
39+
url = "https://github.com/google/benchmark/archive/v1.5.2.tar.gz",
4040
)
4141

4242
http_archive(

ci/includes/bazel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ function runBazel() {
1010
}
1111

1212
function getBazelVersion() {
13-
echo "3.4.1"
13+
echo "4.2.2"
1414
}

ci/linting/clang-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export MSYS2_ARG_CONV_EXCL="//..."
1818
function joinBy { perl -e '$s = shift @ARGV; print join($s, @ARGV);' "$@"; }
1919

2020
function clangFormatLocation() {
21-
local CLANG_FORMAT_VERSION=9.0.0
21+
local CLANG_FORMAT_VERSION=10.0.0
2222
# Use find to get the path for either clang-format (macOS / Linux) or clang-format.exe (Windows)
2323
local CLANG_FORMAT_EXE=clang-format
2424
local CLANG_FORMAT_SHIM=clang-format

tools/bazel

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,19 @@ source "${TOOLS_DIR}"/../ci/includes/bazel.sh
1212
REQUIRED_BAZEL_VERSION="$(getBazelVersion)"
1313
BAZEL_INSTALLATION_DIR="${HOME}/.bazel_installations/${REQUIRED_BAZEL_VERSION}"
1414
if isLinux; then
15-
REQUIRED_BAZEL_SHA256="1a64c807716e10c872f1618852d95f4893d81667fe6e691ef696489103c9b460"
16-
REQUIRED_BAZEL_SHA256CMD="sha256sum"
1715
DOWNLOAD_CMD="wget -q --no-clobber -O bazel"
1816
BAZEL_EXE="bazel-${REQUIRED_BAZEL_VERSION}-linux-x86_64"
1917

20-
if [[ !("$(lsb_release -cs)" =~ ^(bionic|focal)$) ]]; then
21-
echo -e "\033[0;33mWarning: You don't seem to be running Ubuntu 18.04 or 20.04, which is the supported Linux distribution. Continuing anyway, but your mileage might vary.\033[0m"
22-
fi
23-
24-
if which clang-9 1>/dev/null; then
25-
# We follow the symlink of clang-9 here to avoid a bug with the LLVM package when combined with -no-canonical-prefixes.
26-
export CC="$(readlink -f "$(which clang-9)")"
18+
if which clang-10 1>/dev/null; then
19+
# We follow the symlink of clang-10 here to avoid a bug with the LLVM package when combined with -no-canonical-prefixes.
20+
export CC="$(readlink -f "$(which clang-10)")"
2721
else
2822
echo -e "\033[0;33mWarning: You don't seem to have clang-9 correctly installed. Please check README.md to ensure your compiler is set up correctly. Continuing with whatever compiler bazel detects, your mileage might vary.\033[0m"
2923
fi
3024
elif isMacOS; then
31-
REQUIRED_BAZEL_SHA256="23ea93e5ef9f381babd7f658bbbf12d366510f0a719e816fea90bcbe9737aef2"
32-
REQUIRED_BAZEL_SHA256CMD="shasum -a 256"
3325
DOWNLOAD_CMD="wget -q --no-clobber -O bazel"
3426
BAZEL_EXE="bazel-${REQUIRED_BAZEL_VERSION}-darwin-x86_64"
3527
else
36-
REQUIRED_BAZEL_SHA256="d526f04197a1362d95f1d214d2aa51cde527fae01c5752ccea1167475c6f1c60"
37-
REQUIRED_BAZEL_SHA256CMD="sha256sum"
3828
DOWNLOAD_CMD="curl -L -s -o bazel.exe"
3929
# Windows does not have an installer but retrieves the executable directly.
4030
BAZEL_EXE="bazel-${REQUIRED_BAZEL_VERSION}-windows-x86_64.exe"
@@ -77,22 +67,6 @@ if [[ ! -d "${BAZEL_INSTALLATION_DIR}" ]]; then
7767
mkdir -p "${BAZEL_INSTALLATION_DIR}"
7868
fi
7969

80-
function _are_checksums_equal() {
81-
CHECKSUM_A=$1
82-
CHECKSUM_B=$2
83-
# Split apart the checksum from the file name by splitting the returned string by the contained
84-
# space; the checksum has the format:
85-
# xxxxxx...xxxxx <filename>
86-
CHECKSUM_A_PARTS=(${CHECKSUM_A})
87-
CHECKSUM_B_PARTS=(${CHECKSUM_B})
88-
89-
if [[ "${CHECKSUM_A_PARTS[0]}" == "${CHECKSUM_B_PARTS[0]}" ]]; then
90-
return 0 # True
91-
else
92-
return 1 # False
93-
fi
94-
}
95-
9670
# Install correct bazel version.
9771
# If we don't have a local Bazel install at this point we need to retrieve the right version from GitHub.
9872
mkdir -p "${BAZEL_INSTALLATION_DIR}/bin/tmp"
@@ -101,16 +75,6 @@ rm bazel 2>/dev/null || true # Remove bazel binary if already present in tmp dir
10175
echo "Starting download of bazel ${REQUIRED_BAZEL_VERSION}..."
10276
${DOWNLOAD_CMD} "https://github.com/bazelbuild/bazel/releases/download/${REQUIRED_BAZEL_VERSION}/${BAZEL_EXE}"
10377
echo "Download finished."
104-
echo "Testing download file integrity..."
105-
CALCULATED_CHECKSUM="$(${REQUIRED_BAZEL_SHA256CMD} bazel)"
106-
if ! _are_checksums_equal "${CALCULATED_CHECKSUM}" "${REQUIRED_BAZEL_SHA256}"; then
107-
cat <<EOM
108-
ABORT - Downloaded Bazel failed the SHA-256 hash check.
109-
ABORT - Expected: ${REQUIRED_BAZEL_SHA256} bazel
110-
ABORT - Found: ${CALCULATED_CHECKSUM}
111-
EOM
112-
exit 1
113-
fi
11478
# Mark downloaded file executable and move out of tmp directory.
11579
chmod a+x "bazel"
11680
mv bazel ..
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
valgrind --leak-check=full --error-exitcode=1 --suppressions=tools/runners/sanitizers/valgrind-memcheck/valgrind-suppressions.txt "${@}"
1+
valgrind --leak-check=full --error-exitcode=1 --num-callers=30 --suppressions=tools/runners/sanitizers/valgrind-memcheck/valgrind-suppressions.txt "${@}"

tools/runners/sanitizers/valgrind-memcheck/valgrind-suppressions.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,38 @@
1515
fun:CRYPTO_THREAD_run_once
1616
fun:OPENSSL_init_crypto
1717
}
18+
{
19+
pthread_stack_allocation
20+
Memcheck:Leak
21+
match-leak-kinds: possible
22+
...
23+
fun:allocate_stack
24+
fun:pthread_create*
25+
}
26+
{
27+
gtest_use_of_uninitialised_value
28+
Memcheck:Value8
29+
fun:_itoa_word
30+
fun:vfprintf
31+
fun:vsnprintf
32+
fun:snprintf
33+
fun:_ZN7testing*
34+
}
35+
{
36+
gtest_conditional_jump_or_move
37+
Memcheck:Cond
38+
fun:_itoa_word
39+
fun:vfprintf
40+
fun:vsnprintf
41+
fun:snprintf
42+
fun:_ZN7testing*
43+
}
44+
{
45+
gtest_conditional_jump_or_move_2
46+
Memcheck:Cond
47+
fun:vfprintf
48+
fun:vsnprintf
49+
fun:snprintf
50+
fun:_ZN7testing*
51+
}
52+

0 commit comments

Comments
 (0)