You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "sabi0 (via GitHub)" <gi...@apache.org> on 2023/12/21 19:09:37 UTC
[I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
sabi0 opened a new issue, #12961:
URL: https://github.com/apache/lucene/issues/12961
### Description
By default Git uses CR LF line breaks in checked out text files on Windows. And this causes mismatch of the checksums that were calculated for files with LF line breaks.
Either checksum calculation should be made line breaks agnostic. Or "proper" LF line breaks should be pre-enforced on Windows too, e.g. via `.gitattributes`:
```
*.java text eol=lf
*.py text eol=lf
*.g4 text eol=lf
```
```
* Where:
Script 'C:\Development\Projects\lucene\gradle\generation\regenerate.gradle' line: 187
* What went wrong:
Execution failed for task ':lucene:backward-codecs:generateForUtil84ChecksumCheck'.
> Checksums mismatch for derived resources; you might have modified a generated resource (regenerate task: generateForUtil84):
Current:
lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py=6e47288c8d05515d3b99764c976b72a7984cc643
Expected:
lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py=e3c0b1d1d9fcc9f04ae8870e40aab44133321272
Input files for this task are:
C:\Development\Projects\lucene\lucene\backward-codecs\src\java\org\apache\lucene\backward_codecs\lucene84\gen_ForUtil.py
Files generated by this task are:
C:\Development\Projects\lucene\lucene\backward-codecs\src\java\org\apache\lucene\backward_codecs\lucene84\ForUtil.java
```
### Gradle command to reproduce
`gradlew check`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866932938
I'm with you on not liking this behavior, actually.
Having a bunch of repositories converted from Subversion with a mix of line breaks from different contributors it is always a hassle from humongous diffs to what not.
Shall I submit a PR for contributing guide with a "remark for Windows users" and a "Pre-requisites" section?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866807745
In addition to the checksum problem `gradlew tidy` in a fresh clone on Windows results in 5147 modified files!
I guess forcing the LF line breaks is the best fix for both these issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866894383
At the very least the contributing guide needs to mention that one should set the config while cloning the repo: `git clone --config core.autocrlf=false https://github.com/apache/lucene`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866885528
To work with this repository the files _must_ have LF line breaks. Why not make that part of the repository itself?
And forget about describing this quirk in the contributing guide, answering issues like this, etc.
There is a `.dir-locals.el` for Emacs users. Why not `.gitattributes` for Windows users?
What harm do you see in adding those `.gitattributes` rules?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866853682
I'm sorry, but I disagree with this. I'm using Windows myself all the time but the automatic conversion of line ends is the most weird and annoying feature ever conceived. It can be turned off, please do turn it off, then clone the repository again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866890549
With `core.autocrlf` set to `false` line breaks normalization when committing new files is disabled too.
Then contributors on Windows will be pushing files with CR LF line breaks to the server?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866928747
> What harm do you see in adding those .gitattributes rules?
I don't like these conversions, that's about it. I like to get out what I put in. Consider this example if you need one (hexdump it) -
https://github.com/dweiss/tmp-crlf/blob/master/Foo.java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866912391
Apparently, `gradlew check` also requires Perl, which contributing guide fails to mention.
```
* What went wrong:
Execution failed for task ':lucene:documentation:changesToHtml'.
> A problem occurred starting process 'command 'perl''
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866918536
I won't stand in the way if others want those .gitattributes - I just expressed my opinion. Do yourself a favor and switch it off globally, really. This should be the default on Windows. I've spent countless hours trying to figure out why git checked out something that really wasn't there (at least not for anybody else on the planet) - this happens over and over again if you have automatic conversions in place.
> Then contributors on Windows will be pushing files with CR LF line breaks to the server?
At least they know that what they've checked in is the same as what they have locally, byte-to-byte. As a Windows user myself, I don't see this as a bigger harm than git replacing stuff for me automatically. And nobody can convince me otherwise, sorry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866936687
> I'm with you on not liking this behavior, actually.
I think any programmer on Windows has been through this. I don't know why git defaults are such on Windows - maybe git folks want Windows users to be miserable (as if being forced to use ntfs wasn't enough)... Again - I can be sour because I'm actually a Windows user myself (or rather - multi-system user).
> Shall I submit a PR for contributing guide with a "remark for Windows users" and a "Pre-requisites" section?
Please do and thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #12961:
URL: https://github.com/apache/lucene/issues/12961#issuecomment-1866925375
> Apparently, gradlew check also requires Perl, which contributing guide fails to mention.
Perl and python3 (in many cases, not sure whether it's required for tasks check depends on).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] `gradlew check` fails checksum validation in a fresh clone on Windows [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss closed issue #12961: `gradlew check` fails checksum validation in a fresh clone on Windows
URL: https://github.com/apache/lucene/issues/12961
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org