Skip to content

Commit 6e44ec7

Browse files
ci(windows): compile deps with MSVC for OTP-matching NIFs
exqlite failed when mingw gcc used Erlang OTP MSVC headers. Run ilammy/msvc-dev-cmd and mix deps.compile from cmd with Erlang + Elixir on PATH, matching exqlite Windows guidance. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
1 parent c8abeab commit 6e44ec7

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/binaries.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,27 @@ jobs:
328328
working-directory: assets
329329
run: npm install
330330

331+
# Elixir is installed under MSYS $HOME; MSVC deps.compile needs a cmd-accessible path (exqlite uses MSVC/cl).
332+
- name: Export Elixir bin path for MSVC deps compile
333+
shell: msys2 {0}
334+
run: echo "ELIXIR_BIN_WIN=$(cygpath -aw "$HOME/elixir/bin")" >> "$GITHUB_ENV"
335+
336+
# Erlang/OTP Windows installer is MSVC-built; NIFs must not use MSYS2 gcc against OTP headers (see exqlite guides/windows.md).
337+
- uses: ilammy/msvc-dev-cmd@v1
338+
with:
339+
arch: x64
340+
331341
- name: Compile prod dependencies (Mix only)
332342
env:
333-
MAKE: make
334-
MAKEFLAGS: -j4
335-
REBAR_TARGET_ARCH_WORDSIZE: 64
336-
REBAR_TARGET_ARCH: x86_64-w64-mingw32
337-
# Elixir 1.19+: parallel OS processes for deps (native/NIF builds); cuts wall time vs 1.16.
343+
MIX_ENV: prod
344+
# Elixir 1.19+: parallel deps compile processes (native/NIF); MSVC tools coexist with MSYS make/nmake.
338345
MIX_OS_DEPS_COMPILE_PARTITION_COUNT: "4"
339-
shell: msys2 {0}
346+
shell: cmd
340347
run: |
341-
set -euo pipefail
342-
export MIX_HOME="$GITHUB_WORKSPACE/.ci_mix_home"
343-
export HEX_HOME="$GITHUB_WORKSPACE/.ci_hex_home"
344-
export MIX_ENV=prod
348+
set "MIX_HOME=%GITHUB_WORKSPACE%\.ci_mix_home"
349+
set "HEX_HOME=%GITHUB_WORKSPACE%\.ci_hex_home"
350+
set "PATH=C:\Program Files\Erlang OTP\bin;%ELIXIR_BIN_WIN%;%PATH%"
351+
cd /d "%GITHUB_WORKSPACE%"
345352
mix deps.compile
346353
347354
- name: Save Windows deps compile cache

0 commit comments

Comments
 (0)