ci: disable Windows core.autocrlf so nimble checksums match nimble.lock

Windows Git defaults to core.autocrlf=true. When nimble clones dependency
packages into nimbledeps/, the LF→CRLF conversion changes the SHA1 of the
source tree relative to the Linux-computed checksums in nimble.lock.
nimble then treats every cached package as invalid and re-downloads on each
invocation; in PR #3919 the re-download of bearssl_pkey_decoder during
`nimble wakunode2` hung until the 6h job timeout.

Set core.autocrlf=false / core.eol=lf globally before checkout so every
package nimble clones keeps LF endings and matches the Linux SHA1s. This
also obsoletes the targeted sed patch for the nim checksum, which is
removed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Ivan FB 2026-05-30 09:47:52 +02:00
parent 5bc1ad63a7
commit e83e773f87
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270

View File

@ -24,6 +24,20 @@ jobs:
MSYSTEM: MINGW64
steps:
- name: Configure Git to keep LF line endings
# Windows Git defaults to core.autocrlf=true, which converts LF→CRLF when
# nimble clones dependency packages into nimbledeps/. The CRLF conversion
# changes the SHA1 of the package source tree relative to the
# Linux-computed checksums stored in nimble.lock, so nimble decides the
# local copy is invalid and re-downloads on every subsequent invocation
# — and these retries can hang indefinitely on Windows runners.
# Disabling autocrlf globally makes nimble's child git clones produce
# the same tree (and SHA1) as on Linux.
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v4
@ -80,14 +94,6 @@ jobs:
cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
- name: Patch nimble.lock for Windows nim checksum
# nimble.exe uses Windows Git (core.autocrlf=true by default), which converts LF→CRLF
# on checkout. This changes the SHA1 of the nim package source tree relative to the
# Linux-computed checksum stored in nimble.lock. Patch the lock file with the
# Windows-computed checksum before nimble reads it.
run: |
sed -i 's/68bb85cbfb1832ce4db43943911b046c3af3caab/a092a045d3a427d127a5334a6e59c76faff54686/g' nimble.lock
- name: Install nimble deps
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
run: |