[libc++] [test] Recommit the unsetting of LC_COLLATE in the builder script.

This re-reverts one piece of 1b88557332,
reapplying one piece of D101437 (but not the "service"-queue piece of it).

It turns out that the behavior of `grep [^ -~]`, or even `grep [A-Z]`,
depends on locale, specifically `LC_COLLATE`. So we want to make sure
we're not in any weird locale, no matter what machine we're running on.
Yes, "en_US.UTF-8" counts as weird!
https://stackoverflow.com/questions/67320156/misbehavior-of-gnu-grep-when-grepping-for-ignores-spaces
https://stackoverflow.com/questions/6799872/how-to-make-grep-a-z-independent-of-locale
This commit is contained in:
Arthur O'Dwyer 2021-04-30 14:43:33 -04:00
parent 54aad63659
commit c92cdb4878
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,9 @@
set -ex
set -o pipefail
unset LANG
unset LC_ALL
unset LC_COLLATE
PROGNAME="$(basename "${0}")"
@ -146,6 +149,7 @@ check-generated-output)
# Check if the diffs are empty, fail otherwise.
! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
# Reject patches that introduce non-ASCII characters or hard tabs.
# Depends on LC_COLLATE set at the top of this script.
! grep -rn '[^ -~]' libcxx/include/ || false
# Check that no dependency cycles have been introduced.
python3 libcxx/utils/graph_header_deps.py >/dev/null