Open peakschris opened 1 month ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
@brandjon @tetromino @comius @hvadehra @c-mita gentle ping, would it be possible for someone to review this? I have a chain of PRs to rulesets dependent on this one to improve windows support.
@peakschris Did you see this message? This may not be reviewed and merged. I will bring this up at the next Community for Bazel technical steering committee meeting which is scheduled for Tuesday, July 9.
In my work on windows quality in rulesets, a frequent issue I am finding is that diff_tests are failing due to differences in line endings -- either due to differences in the 'expected' values, or cross-platform differences in generators (e.g. buildifier always writes LF, whilst skydoc writes LF or CRLF depending on platform).
We can't expect rule authors to work around these differences, because in practice they do not have good access to windows dev hardware.
The goal of this PR is to make diff_test slightly less brittle and ignore line endings by default. An
ignore_line_endings
flag is provided to switch this behavior.This flag is supported by the
diff
command on unix. On windows, it requires thetr.exe
command that is part of most bash installs including msys2. Iftr.exe
cannot be found theignore_line_endings
flag is silently ignored and set to False.This PR allows us to enable the 1 disabled test 'stardoc_with_diff_test' on windows CI, and also fixes many test failures in dependent rulesets such as rules_starlib and rules_bazel_integration_test