Skip to content

Commit 51e0a99

Browse files
authored
[test-release.sh] Fix sed encoding issues on macOS (#105989)
When using bsd sed that ships with macOS on the object files for comparison, every command would error with ``` sed: RE error: illegal byte sequence ``` This was potentially fixed for an older version in 6c52b02 but even the commands in the example there still have this error. You can repro this with any binary: ``` $ sed s/a/b/ /bin/ls >/dev/null sed: RE error: illegal byte sequence ``` Where LC_CTYPE appears to no longer solve the issue: ``` $ LC_CTYPE=C sed s/a/b/ /bin/ls >/dev/null sed: RE error: illegal byte sequence ``` But this change with LC_ALL does: ``` $ LC_ALL=C sed s/a/b/ /bin/ls >/dev/null; echo $? 0 ``` It seems like the difference here is that if you have LC_ALL set to something else, LC_CTYPE does not override it. More info: https://stackoverflow.com/a/23584470/902968
1 parent 6f04e65 commit 51e0a99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/release/test-release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ for Flavor in $Flavors ; do
755755
# case there are build paths in the debug info. Do the same sub-
756756
# stitution on both files in case the string occurrs naturally.
757757
if ! cmp -s \
758-
<(env LC_CTYPE=C sed -e 's,Phase1,Phase2,g' -e 's,Phase2,Phase3,g' $p2) \
759-
<(env LC_CTYPE=C sed -e 's,Phase1,Phase2,g' -e 's,Phase2,Phase3,g' $p3) \
758+
<(env LC_ALL=C sed -e 's,Phase1,Phase2,g' -e 's,Phase2,Phase3,g' $p2) \
759+
<(env LC_ALL=C sed -e 's,Phase1,Phase2,g' -e 's,Phase2,Phase3,g' $p3) \
760760
16 16; then
761761
echo "file `basename $p2` differs between phase 2 and phase 3"
762762
fi

0 commit comments

Comments
 (0)