[PATCH] D61496: Fixed tests where grep was not matching the linefeed

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 06:36:02 PDT 2019


aganea added a comment.

In D61496#1489523 <https://reviews.llvm.org/D61496#1489523>, @probinson wrote:

> Checked-in files should not have CRLF endings, in general (there are a very few exceptions, and these aren't among them).
>  If the checked-in files have LF endings but your tool checks them out with CRLF then that is a problem with your config, or with the tool.
>  Adding dos2unix to the RUN lines is the wrong fix, either way.


Yeah I've realized that :) This is caused by svn on Windows which sets `svn:eol-style=native` by default, which causes local files to be saved in the "native" format, which is CRLF on Windows (even though in upstream they are LF) When files are commited, normally svn should convert them back to LF (or at least that's the contract <http://svnbook.red-bean.com/en/1.7/svn.advanced.props.file-portability.html> for `svn:eol-style=native`).

  native
  This causes the file to contain the EOL markers that are native to the operating system on which Subversion was run. In other words, if a user on a Windows machine checks out a working copy that contains a file with an svn:eol-style property set to native, that file will contain CRLF EOL markers. A Unix user checking out a working copy that contains the same file will see LF EOL markers in his copy of the file.
  
  Note that Subversion will actually store the file in the repository using normalized LF EOL markers regardless of the operating system. This is basically transparent to the user, though.

I'm using the MINGW32 bash to run the tests/`check-all` because it comes with all the Unix tools (grep, sed, ...) that Windows doesn't have.
The bug here is that the GNU grep only matches LF, not CRLF.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61496/new/

https://reviews.llvm.org/D61496





More information about the cfe-commits mailing list