From c4d074772786e1f779303f0c62b6703a277644b1 Mon Sep 17 00:00:00 2001 From: Kures <14836932+Kures@users.noreply.github.com> Date: Fri, 8 May 2026 00:32:06 +0300 Subject: [PATCH 1/2] fix(build): pin shell scripts to LF endings to unblock Docker builds on Windows clones Without .gitattributes, git checking out the repository on Windows auto-converts shell scripts to CRLF. Inside the alpine builder image, bash chokes on the trailing CR and aborts the build with errors like: /tmp/install-zig.sh: line 2: set: pipefail : invalid option name This is a clean reproducer: 1. Clone on Windows with default git autocrlf 2. docker compose up --build 3. Stage [builder 4/9] fails before zig is even installed. Fix: add .gitattributes pinning *.sh, *.bash, Dockerfile to eol=lf. Future clones are immune regardless of core.autocrlf setting. No code changes. The same scripts work as before on Linux/macOS where LF was already the local form. Note for existing Windows clones: tracked files won't auto-renormalize on pull. After pulling this fix, run git rm --cached -r . git checkout . (or simpler: re-clone) to convert your working tree to LF. --- .gitattributes | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ae3ff5f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,13 @@ +# Ensure shell scripts and Dockerfiles are LF on every platform. +# Without this, git on Windows checks them out with CRLF and Docker +# builds (alpine bash) fail with errors like: +# /tmp/install-zig.sh: line 2: set: pipefail: invalid option name +# because the trailing \r corrupts shell built-in option parsing. + +*.sh text eol=lf +*.bash text eol=lf +Dockerfile text eol=lf +*.dockerfile text eol=lf + +# Default: let git auto-detect text vs binary +* text=auto From 7508700243ff5a80912b43e9ad1eaac2c6cd4494 Mon Sep 17 00:00:00 2001 From: Igor Somov Date: Wed, 13 May 2026 09:17:13 -0300 Subject: [PATCH 2/2] fix(build): keep LF attributes explicit --- .gitattributes | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index ae3ff5f..2f53224 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,13 @@ +# Default: let git auto-detect text vs binary +* text=auto + # Ensure shell scripts and Dockerfiles are LF on every platform. # Without this, git on Windows checks them out with CRLF and Docker # builds (alpine bash) fail with errors like: # /tmp/install-zig.sh: line 2: set: pipefail: invalid option name # because the trailing \r corrupts shell built-in option parsing. -*.sh text eol=lf -*.bash text eol=lf -Dockerfile text eol=lf +*.sh text eol=lf +*.bash text eol=lf +Dockerfile text eol=lf *.dockerfile text eol=lf - -# Default: let git auto-detect text vs binary -* text=auto