Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Disable Git's autocrlf feature to fix Windows build failures #3881

Merged
merged 5 commits into from
Apr 21, 2021

Conversation

slarse
Copy link
Collaborator

@slarse slarse commented Apr 16, 2021

Many of the build failures on Windows are due to core.autocrlf begin active in Git, which on that platform automatically converts the line endings in all files to CRLF on checkout and back to LF on check-in. This causes all tests with hard-coded LF line endings to fail.

Why would we want hard-coded LF line endings in tests? Well, for example, in the sniper printer tests, we want to make sure that the sniper printer uses the line endings contained in the source file, regardless of platform. Thus, if there are LF line endings in the input, there should be LF line endings in the output, which simply cannot be tested if Git automatically converts these line endings.

This PR fixes 40 test failures on Windows, leaving 18 failures and 3 errors. Most of the remaining failures seem to be related to incorrect use of hard-coded line endings.

@slarse
Copy link
Collaborator Author

slarse commented Apr 16, 2021

Apparently, this wasn't the entire solution, but there are significantly fewer test failures now than before (down to ~20 from ~60). Notably, none of the sniper printer tests fail now!

@slarse
Copy link
Collaborator Author

slarse commented Apr 19, 2021

Suddenly Travis checks have started running again. @monperrus did they get back to you about the free project thing? GHA is working very well for us, so I don't see much value in putting in the effort of going back to Travis at the moment.

Anyway, ignore failures on Travis for the moment.

@slarse slarse changed the title wip: chore: Disable Git's autocrlf feature to fix Windows build failures review: chore: Disable Git's autocrlf feature to fix Windows build failures Apr 19, 2021
@monperrus
Copy link
Collaborator

@monperrus did they get back to you about the free project thing?

Yes, quoting their answer coming 4 months after our request (sig):

Please accept our sincere apologies for any inconvenience caused due to delays in processing your open-source credit request while we made improvements to the platform. Open source has always been and always will be at the core of what Travis CI stands for. After reviewing your open source qualifications, I am pleased to notify you that 25k credits were added to your account allowing you to resume running OSS builds.

@monperrus
Copy link
Collaborator

GHA is working very well for us

Agree.

@slarse slarse closed this Apr 21, 2021
@slarse slarse reopened this Apr 21, 2021
@slarse slarse changed the title review: chore: Disable Git's autocrlf feature to fix Windows build failures wip: chore: Disable Git's autocrlf feature to fix Windows build failures Apr 21, 2021
@slarse
Copy link
Collaborator Author

slarse commented Apr 21, 2021

GHA currently having trouble, we'll have to just wait a bit: https://www.githubstatus.com/incidents/cj7gzzj30411

@slarse slarse closed this Apr 21, 2021
@slarse slarse reopened this Apr 21, 2021
@monperrus
Copy link
Collaborator

neat!

@slarse slarse changed the title wip: chore: Disable Git's autocrlf feature to fix Windows build failures review: chore: Disable Git's autocrlf feature to fix Windows build failures Apr 21, 2021
@slarse
Copy link
Collaborator Author

slarse commented Apr 21, 2021

Now ready for review again. Fixes most of the Windows build errors.

The remaining failures are also mostly problems with line endings, but are probably due to incorrect usage. For example, if we pretty-print (non-sniper) an element, we should expect CRLF line endings on Windows. Fixing those is outside the scope of this PR.

@monperrus monperrus changed the title review: chore: Disable Git's autocrlf feature to fix Windows build failures chore: Disable Git's autocrlf feature to fix Windows build failures Apr 21, 2021
@monperrus monperrus merged commit 9571a47 into INRIA:master Apr 21, 2021
@monperrus
Copy link
Collaborator

Thanks a lot @slarse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants