Skip to content

Commit 7240652

Browse files
GraDeaashvardanian
andauthored
Make: Build JavaScript Windows x64 prebuilds (#774)
The `build_javascript` job exported `CC=gcc`/`CXX=g++` for every OS. On Windows `node-gyp` ignores both and builds with MSVC, but NumKong's ISA probe reads the compiler from `$CC` while still emitting MSVC flag syntax, so it shells out to `gcc /c /arch:AVX2 ... /nologo`. Every probe fails, the failures are swallowed, and `nk_probes.h` lands with all 39 `NK_TARGET_*` set to zero. The addon still builds and passes the test suite -- dynamic dispatch just has no kernels to choose from -- so the result is a scalar-only binary shipped to every Windows npm user. Scope the variables to the Linux step and let the probe fall back to `cl.exe`, which enables Haswell and Skylake. Co-authored-by: Evgeniy Peshkov <2716874+GraDea@users.noreply.github.com> Co-authored-by: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>
1 parent 9c0ed29 commit 7240652

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -813,19 +813,9 @@ jobs:
813813
strategy:
814814
fail-fast: false
815815
matrix:
816-
arch: [x64, x86]
817-
# Windows pre-build is not working
818-
# - windows-latest
819-
os: [macos-14, ubuntu-24.04]
820-
exclude:
821-
- arch: x86
822-
os: macos-14
823-
- arch: x86
824-
os: ubuntu-24.04
816+
arch: [x64]
817+
os: [macos-14, ubuntu-24.04, windows-2022]
825818
runs-on: ${{ matrix.os }}
826-
env:
827-
CC: gcc
828-
CXX: g++
829819

830820
steps:
831821
- name: Checkout the latest code
@@ -852,7 +842,16 @@ jobs:
852842
run: |
853843
npm install --ignore-scripts
854844
- run: npm run prebuild-single
855-
if: matrix.os != 'macos-14'
845+
env:
846+
CC: gcc
847+
CXX: g++
848+
if: matrix.os == 'ubuntu-24.04'
849+
# Leave CC/CXX unset on Windows. node-gyp builds with MSVC regardless,
850+
# but NumKong's ISA probe takes the compiler from $CC while still
851+
# passing MSVC flag syntax, so a `gcc` here fails every probe and
852+
# silently yields a scalar-only binary with no SIMD kernels.
853+
- run: npm run prebuild-single
854+
if: matrix.os == 'windows-2022'
856855
- run: npm run prebuild-darwin-x64+arm64
857856
env:
858857
CC: clang

0 commit comments

Comments
 (0)