From 45f60b56de1d91291b487c82de7a76e19473b60b Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 11 Jun 2025 16:54:25 +0200 Subject: [PATCH] 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 --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index cd9921d963..22ad2cc2a3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,3 +7,4 @@ # EOF # ``` Dockerfile text eol=lf +*.sh text eol=lf