maint(common): use LF line endings for scripts

On Windows files are usually checked out with CRLF line endings.
However, the Docker image is Linux and thus expects LF line endings.
This causes conflicts with the scripts and so trying to build in docker
trips over the shebang line that contains CR - see #14153.
https://stackoverflow.com/a/14610574 suggests a workaround, however that
doesn't work because it converts the script on the fly and removes CR and
then reads the script from the command line. This causes the loss of the
script name and thus causes different failures. Even with that solved
it would likely still not work because of the sourced  include scripts
would still contain CRLF line endings.

The only solution seems to be to check out the script files with LF
line endings which also seems to work when building directly on Windows.
See https://blog.programster.org/fixing-docker-volume-windows-line-endings-on-bash-scripts.

Fixes: #14153
Test-bot: skip
This commit is contained in:
Eberhard Beilharz 2025-06-11 16:54:25 +02:00
parent 57a9583093
commit 45f60b56de
No known key found for this signature in database
GPG key ID: E9140597606020D3

1
.gitattributes vendored
View file

@ -7,3 +7,4 @@
# EOF
# ```
Dockerfile text eol=lf
*.sh text eol=lf