Skip to content

Commit

Permalink
ci/coverage: revise regex for extracting clang and LLVM versions (env…
Browse files Browse the repository at this point in the history
…oyproxy#32509)

ci/coverage: make regex for extracting clang and LLVM versions more strict

The regular expressions currently used to extract clang and LLVM versions in
`run_envoy_bazel_coverage.sh` can include spurious non-version characters
which can result in an accidental mismatch.

This change revises the expressions assuming that clang and LLVM versions
will always match `[0-9.]*`, the characters expected in semantic versioning,
which should be a reasonable assumption.

Signed-off-by: Eric Chung <[email protected]>
  • Loading branch information
cinchurge authored Feb 22, 2024
1 parent 5b674b5 commit 5d4dccb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/run_envoy_bazel_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -e -o pipefail

LLVM_VERSION=${LLVM_VERSION:-"14.0.0"}
CLANG_VERSION=$(clang --version | grep version | sed -e 's/\ *clang version \(.*\)\ */\1/')
LLVM_COV_VERSION=$(llvm-cov --version | grep version | sed -e 's/\ *LLVM version \(.*\)/\1/')
CLANG_VERSION=$(clang --version | grep version | sed -e 's/\ *clang version \([0-9.]*\).*/\1/')
LLVM_COV_VERSION=$(llvm-cov --version | grep version | sed -e 's/\ *LLVM version \([0-9.]*\).*/\1/')
LLVM_PROFDATA_VERSION=$(llvm-profdata show --version | grep version | sed -e 's/\ *LLVM version \(.*\)/\1/')

if [ "${CLANG_VERSION}" != "${LLVM_VERSION}" ]
Expand Down

0 comments on commit 5d4dccb

Please sign in to comment.