.gitattributes: turn off CRLF for Makefile.am #1344

Merged
merged 1 commit into from Mar 27, 2017

Projects

None yet

3 participants

@MarcelRaad
Member

Otherwise, buildconf in a Windows checkout fails with:

.ibtoolize: error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with ACLOCAL_AMFLAGS=-I m4

@MarcelRaad, thanks for your PR! By analyzing the history of the files in this pull request, we identified @billhoffman and @gknauf to be potential reviewers.

Owner
jay commented Mar 21, 2017

? I use windows checkouts all the time with CRLF translation and I've never seen that

Member

It happened for me on two machines where I had cloned the git repository in Windows and then ran buildconf from the Ubuntu bash that you can get with Windows 10.

Owner
jay commented Mar 22, 2017

hm. Well I'd think if you're using Ubuntu to work on a local curl repo that's using CRLF translation you're going to run into problems. This probably isn't what you want to hear but maybe you should turn it off, reset the repo to just LF?

git config --local core.autocrlf input
git config --local core.eol lf
git rm -f --cached -r .
git clean -xdf
git reset --hard

I think turning it off for just this one file you'll run into more problems. But let's say we shut CRLF translation off for all *.am, is there any negative downside to that other than some editors won't work? Does any autotools require CRLF line endings that you know of?

With just this file changed are you able to build curl and then run the tests successfully?

Member
MarcelRaad commented Mar 22, 2017 edited

This probably isn't what you want to hear but maybe you should turn it off, reset the repo to just LF?

Thanks, I didn't know this was possible for an existing checkout. Although it might be a bit inconvenient as I'm developing on Windows and running the tests on Linux, so I'd have to switch between line endings regularly.

I think turning it off for just this one file you'll run into more problems. But let's say we shut CRLF translation off for all *.am, is there any negative downside to that other than some editors won't work? Does any autotools require CRLF line endings that you know of?

With just this file changed are you able to build curl and then run the tests successfully?

It doesn't make a difference if Makefile.am or *.am is used. Both ways, I'm able to build and run the tests fine with a 98% success rate. But you're right, *.am would be better as it's consistent with the other entries in .gitattributes, so I've just changed to using that.

Member
MarcelRaad commented Mar 25, 2017 edited

@jay

But let's say we shut CRLF translation off for all *.am, is there any negative downside to that other than some editors won't work? Does any autotools require CRLF line endings that you know of?

With just this file changed are you able to build curl and then run the tests successfully?

I haven't found any downsides to forcing LF for *.am files and everything works for me on Linux as well as Windows (MSYS2) with CRLF translation.
There are 5 tests failing with CRLF translation that don't fail when using only LF: 1022 1023 1135 1221 1222.
1135 fails also under Windows, the others only under Linux.
If there are no objections, I'll push this commit and look at those 5 tests later.

@MarcelRaad MarcelRaad .gitattributes: turn off CRLF for *.am
If Makefile.am uses CRLF, buildconf in a Windows checkout fails with:
".ibtoolize: error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with
ACLOCAL_AMFLAGS=-I m4"
2c3af5b
@MarcelRaad MarcelRaad merged commit 2c3af5b into curl:master Mar 27, 2017

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jay
Owner
jay commented on 2c3af5b Mar 27, 2017

Should be fine. In the future please append to your upstream commit message the related discussion with a Ref:/Bug:/Closes line for example

.gitattributes: turn off CRLF for *.am

If Makefile.am uses CRLF, buildconf in a Windows checkout fails with:
".ibtoolize: error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with
ACLOCAL_AMFLAGS=-I m4"

Closes https://github.com/curl/curl/pull/1344

Thanks

Member

@jay Oops, sorry! Thanks for the reminder.

@MarcelRaad MarcelRaad deleted the MarcelRaad:makefile_lf branch Mar 29, 2017
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 15, 2017
@MarcelRaad MarcelRaad .gitattributes: force shell scripts to LF
Bash on Linux errors out on CR characters.
This makes tests 1221 and 1222 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
6bfb989
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 15, 2017
@MarcelRaad MarcelRaad configure.ac: ignore CR after version numbers
Ignore everything after the version numbers in LIBCURL_VERSION and
LIBCURL_VERSION_NUM to ged rid of the extra CR character.
This makes tests 1022 and 1023 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
02140c8
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 15, 2017
@MarcelRaad MarcelRaad .gitattributes: force shell scripts to LF
Bash on Linux errors out on CR characters.
This makes tests 1221 and 1222 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
5653a27
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 15, 2017
@MarcelRaad MarcelRaad configure.ac: ignore CR after version numbers
Ignore everything after the version numbers in LIBCURL_VERSION and
LIBCURL_VERSION_NUM to ged rid of the extra CR character.
This makes tests 1022 and 1023 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
73f3f3e
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 16, 2017
@MarcelRaad MarcelRaad .gitattributes: force shell scripts to LF
Bash on Linux errors out on CR characters.
This makes tests 1221 and 1222 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
fbec0a0
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 16, 2017
@MarcelRaad MarcelRaad configure.ac: ignore CR after version numbers
Ignore everything after the version numbers in LIBCURL_VERSION and
LIBCURL_VERSION_NUM to ged rid of the extra CR character.
This makes tests 1022 and 1023 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
1760dd8
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 16, 2017
@MarcelRaad MarcelRaad extern-scan.pl: strip trailing CR
This makes test 1135 pass with CRLF checkouts.

Ref: curl#1344 (comment)
43ebae9
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 17, 2017
@MarcelRaad MarcelRaad .gitattributes: force shell scripts to LF
Bash on Linux errors out on CR characters.
This makes tests 1221 and 1222 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
Closes curl#1422
a0576e2
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 17, 2017
@MarcelRaad MarcelRaad configure.ac: ignore CR after version numbers
Ignore everything after the version numbers in LIBCURL_VERSION and
LIBCURL_VERSION_NUM to ged rid of the extra CR character.
This makes tests 1022 and 1023 pass on Linux with a CRLF checkout.

Ref: curl#1344 (comment)
Closes curl#1422
5cefe20
@MarcelRaad MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Apr 17, 2017
@MarcelRaad MarcelRaad extern-scan.pl: strip trailing CR
This makes test 1135 pass with CRLF checkouts.

Ref: curl#1344 (comment)
Closes curl#1422
c25aba1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment