Page MenuHomePhabricator

Fix clang Lexer Windows line-ending bug
Needs ReviewPublic

Authored by caoz on Dec 11 2017, 11:29 AM.

Details

Reviewers
rnk
Summary

Add Windows line-ending support when parsing Perforce conflict marker.

This fixes 2 tests for Bug 35187 (https://bugs.llvm.org/show_bug.cgi?id=35187).

Diff Detail

Event Timeline

caoz created this revision.Dec 11 2017, 11:29 AM
zturner added inline comments.
test/lit.cfg.py
52–57

Since the user has sed already, why wouldn't they have the actual tool dos2unix and unix2dos?

caoz added inline comments.Dec 11 2017, 11:57 AM
test/lit.cfg.py
52–57

Thanks Zachary. dos2unix and unix2dos aren't installed by default on Linux/Mac. However, if the user can be assumed to have them, I can remove these substitutions.

belleyb added inline comments.Dec 11 2017, 12:24 PM
test/lit.cfg.py
52–57

@zturner According to https://llvm.org/docs/GettingStarted.html#software, we shouldn't be relying on dos2unix nor unix2dos to be present on a build machine.

Note that the $'string' syntax (ANSI-C quotes) is a bash extension. According to the page mentioned above, the LLVM builds should only be relying on having a Bourne shell (sh). But, are there still any *nix system out there where /bin/sh isn't a link for \bin\bash ? I.e. Is relying on bash+sed fine here ?

A fully portable solution would be to write python scripts for dos2unix.py and unix2dos.py. That way, one would not be relying on build tools that LLVM isn't already using.

Any advice on how to proceed ?