-
Notifications
You must be signed in to change notification settings - Fork 5
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
Checking on windows with configure.ac
script will always result in error due to CRLF issues
#19
Comments
The default GitHub configuration uses CRLF line endings on Windows, see e.g. actions/checkout#135 You can probably work around this by adding a |
Yes, indeed this does the job, but should the developer always have to have that concern just for auto checking? Can't we just add before the checkout action by default a step for:
Would that hurt anything else? |
Possibly. But it is a little weird that this has come up now, I have never heard of this being an issue, and these (similar) workflows are used by thousands of repos. OK, most don't have a |
Looking inside some packages like sf, they do use the .gitattributes to avoid that: https://github.com/r-spatial/sf/blob/main/.gitattributes. |
I've edited my actions yaml to include I doubt that including this step will harm anything else as all it does is configure git to not modify the line endings when checking out code from repositories. Actually, in my opinion this is even more consistent, because this will allow to test if indeed the developer commit by mistake any files with offending line endings. As it is now using the default windows git behavior the package checkings for line endings is useless and misleading, because it is actually testing |
For the record, I was also getting a warning specifically for - name: Fix line-endings
if: runner.os == 'Windows'
run: dos2unix configure.ac Prevents the warning and may be less likely to affect anything else than changing the git config. (In terms of this project, probably replace I do not know why this is specific to |
I'm also running into this now... Still not sure how to resolve it. I have a GHA that looks for files with CR that works locally, but fails on GHA because the line endings are converted by the actions/checkout step. Probably there's a smarter way to go about this, but sharing as another affected use case. |
I think the best fix for this is indeed a |
Makes sense... my hangup is that we also keep a bunch of CSV (etc) files around for testing purposes, I don't want to mess around with their line endings lest we end up testing the wrong thing. I'm also confused because we already have https://github.com/Rdatatable/data.table/blob/master/.gitattributes |
This does work, however the But as I said I still consider this as a bad behavior of the checking process, as it is checking the default |
I meant people and services that check out your repo on Windows, and then run You can fix this in Or you'll have to ask everybody else to fix it for you, e.g. here at According to actions/checkout#226 (comment) we would need something like
for the general case, which is actually not that great, because it also converts CRLF files to LF (I think, but fixme), which might not be what you want. It would definitely break at least one repo of mine. |
Even though I already made sure that I submitted the
configure.ac
with LF only line endings (bygit ls-files --eol
, see attached image) this will still be converted due to incorrect configuration within the git's checking process and result inR CMD check
warnings which will lead to error.See my repository job: https://github.com/caiohamamura/gdalBindings-r/actions/runs/9275022762/job/25518759238. Every other machines are passing gracefully.
The text was updated successfully, but these errors were encountered: