This can also be reproduced easily on a Linux system directly:

- Check out the Bazel source code.
- Change the line endings of `tools/genrule/genrule-setup.sh` to CRLF (e.g., using `:set ff=dos` in Vim and saving the file).
- Run it directly using Bash. It will print the same errors as shown above.
On Windows, genrule-setup.sh contains carriage returns
### Description of the problem / feature request:

On both a Linux and a Windows box, I have Bazel 0.17.2 installed. On the Linux system, the copy of `tools/genrule/genrule-setup.sh` is 858 bytes in size, whereas the copy shipped with the Windows version of Bazel is 882 bytes in size. The former uses NL, whereas the latter uses CR+NL.

Though `genrule-setup.sh` may contain CR+NL on Windows and work properly, the problem is that remote builds from Windows on a Linux cluster breaks as a result of it. Bash doesn't seem to like executing such files.

### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

1. Create a [Buildbarn](https://github.com/EdSchouten/bazel-buildbarn) setup running on a pile of Linux servers.
2. Install Bazel on a Windows system.
3. Perform a build of a `genrule()` target against the Buildbarn setup, using flags along the lines of `--host_cpu=k8 --cpu=k8`.
4. Notice that targets will throw the following warnings during execution:

```
external/bazel_tools/tools/genrule/genrule-setup.sh: line 2: $'\r': command not found
external/bazel_tools/tools/genrule/genrule-setup.sh: line 16: $'\r': command not found
: invalid optionools/tools/genrule/genrule-setup.sh: line 18: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
external/bazel_tools/tools/genrule/genrule-setup.sh: line 19: $'\r': command not found
: invalid optionools/tools/genrule/genrule-setup.sh: line 21: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
external/bazel_tools/tools/genrule/genrule-setup.sh: line 22: $'\r': command not found
: invalid option nametools/genrule/genrule-setup.sh: line 24: set: pipefail
```

### What operating system are you running Bazel on?

Windows 10 1803.

### What's the output of `bazel info release`?

release 0.17.2

Installed it using Chocolatey.

###  Have you found anything relevant by searching the web?

No.

### Any other information, logs, or outputs that you want to share?

Maybe the artifacts that are shipped with Bazel and are used as input files should be marked as binary, so they are byte-for-byte identical between platforms?
.gitattributes
.gitattributes
diff --git a/.gitattributes b/.gitattributes
index c0f7b6a44d1b9c..35e4e72eeb31a1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,6 @@
 *.bzl linguist-language=Python
 BUILD linguist-language=Python
 site/* linguist-documentation
+
+# Files that should not use CRLF line endings, even on Windows.
+tools/genrule/genrule-setup.sh -text
