mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-06-14 09:59:26 +00:00
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>
132 lines
3.8 KiB
YAML
132 lines
3.8 KiB
YAML
name: ci / build-windows
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
branch:
|
|
required: true
|
|
type: string
|
|
|
|
env:
|
|
NPROC: 4
|
|
NIM_VERSION: '2.2.4'
|
|
NIMBLE_VERSION: '0.22.3'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
|
|
defaults:
|
|
run:
|
|
shell: msys2 {0}
|
|
|
|
env:
|
|
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
|
|
|
|
- name: Setup MSYS2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
update: true
|
|
install: >-
|
|
git
|
|
base-devel
|
|
mingw-w64-x86_64-toolchain
|
|
make
|
|
cmake
|
|
upx
|
|
unzip
|
|
mingw-w64-x86_64-rust
|
|
mingw-w64-x86_64-postgresql
|
|
mingw-w64-x86_64-gcc
|
|
mingw-w64-x86_64-gcc-libs
|
|
mingw-w64-x86_64-libwinpthread-git
|
|
mingw-w64-x86_64-zlib
|
|
mingw-w64-x86_64-openssl
|
|
mingw-w64-x86_64-python
|
|
mingw-w64-x86_64-cmake
|
|
mingw-w64-x86_64-llvm
|
|
mingw-w64-x86_64-clang
|
|
mingw-w64-x86_64-nasm
|
|
|
|
- name: Manually install nasm
|
|
run: |
|
|
bash scripts/install_nasm_in_windows.sh
|
|
source $HOME/.bashrc
|
|
|
|
- name: Add UPX to PATH
|
|
run: |
|
|
echo "/usr/bin:$PATH" >> $GITHUB_PATH
|
|
echo "/mingw64/bin:$PATH" >> $GITHUB_PATH
|
|
echo "/usr/lib:$PATH" >> $GITHUB_PATH
|
|
echo "/mingw64/lib:$PATH" >> $GITHUB_PATH
|
|
|
|
- name: Verify dependencies
|
|
run: |
|
|
which upx gcc g++ make cmake cargo rustc python nasm
|
|
|
|
- name: Install Nim ${{ env.NIM_VERSION }}
|
|
uses: jiro4989/setup-nim-action@v2
|
|
with:
|
|
nim-version: ${{ env.NIM_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Nimble ${{ env.NIMBLE_VERSION }}
|
|
run: |
|
|
export PATH="$GITHUB_WORKSPACE/.nim_runtime/bin:$PATH"
|
|
cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y
|
|
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install nimble deps
|
|
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
|
|
run: |
|
|
export PATH="$GITHUB_WORKSPACE/.nim_runtime/bin:$HOME/.nimble/bin:$PATH"
|
|
nimble setup --localdeps -y
|
|
make rebuild-nat-libs-nimbledeps CC=gcc
|
|
make rebuild-bearssl-nimbledeps CC=gcc
|
|
touch nimbledeps/.nimble-setup
|
|
|
|
- name: Creating tmp directory
|
|
run: mkdir -p tmp
|
|
|
|
- name: Building wakunode2.exe
|
|
run: |
|
|
export PATH="$GITHUB_WORKSPACE/.nim_runtime/bin:$HOME/.nimble/bin:$PATH"
|
|
make wakunode2 V=3 -j${{ env.NPROC }}
|
|
|
|
- name: Building libwaku.dll
|
|
run: |
|
|
export PATH="$GITHUB_WORKSPACE/.nim_runtime/bin:$HOME/.nimble/bin:$PATH"
|
|
make libwaku STATIC=0 V=1 -j
|
|
|
|
- name: Check Executable
|
|
run: |
|
|
if [ -f "./build/wakunode2.exe" ]; then
|
|
echo "wakunode2.exe build successful"
|
|
else
|
|
echo "Build failed: wakunode2.exe not found"
|
|
exit 1
|
|
fi
|
|
if [ -f "./build/libwaku.dll" ]; then
|
|
echo "libwaku.dll build successful"
|
|
else
|
|
echo "Build failed: libwaku.dll not found"
|
|
exit 1
|
|
fi |