Skip to content

Commit 6c52b02

Browse files
committed
test-release.sh: Ignore LC_CTYPE in sed invocation on Darwin
Here, sed is used to prepare object files for comparison via cmp. On my Darwin 15.4.0 machine, LC_CTYPE is set to UTF-8 (by default, I believe). Under these circumstances, anything sed is made to read will be treated as UTF-8, prompting it to signal an error if it is not, like so: % sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $? sed: RE error: illegal byte sequence 1 % To make sed work as expected, I need to set LC_CTYPE to C: % env LC_CTYPE=C sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $? 0 % Without this change, sed will exit with an error for every single file that it compares between phase 2 and phase 3, thereby making it look as if the differences were far larger than they are. Patch by Elias Pipping! Differential Revision: http://reviews.llvm.org/D16548 llvm-svn: 258891
1 parent 763545c commit 6c52b02

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/utils/release/test-release.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,9 @@ for Flavor in $Flavors ; do
541541
# Substitute 'Phase2' for 'Phase3' in the Phase 2 object file in
542542
# case there are build paths in the debug info. On some systems,
543543
# sed adds a newline to the output, so pass $p3 through sed too.
544-
if ! cmp -s <(sed -e 's,Phase2,Phase3,g' $p2) <(sed -e '' $p3) \
545-
16 16 ; then
544+
if ! cmp -s \
545+
<(env LC_CTYPE=C sed -e 's,Phase2,Phase3,g' $p2) \
546+
<(env LC_CTYPE=C sed -e '' $p3) 16 16; then
546547
echo "file `basename $p2` differs between phase 2 and phase 3"
547548
fi
548549
done

0 commit comments

Comments
 (0)