Skip to content

main does not compile under MSVC since #641, and check-windows-portability.py runs in no CI job, hook, or preflight #646

Description

@localai-bot

What

main (cefacd2d0, #641) fails scripts/check-windows-portability.py:

ERROR: src/vllm/multimodal/video_engine.cpp:21: unguarded POSIX include/call reaches Windows
ERROR: src/vllm/multimodal/video_engine.cpp:59: unguarded POSIX include/call reaches Windows
ERROR: src/vllm/multimodal/video_engine.cpp:64: unguarded POSIX include/call reaches Windows
EXIT=1

:21 is #include <sys/stat.h>; :59 and :64 are struct stat + ::stat inside
IsDir() / Exists(). The load-bearing part is S_ISDIR, which MSVC does not
define at all — MSVC does ship <sys/stat.h> and _stat, so the include alone
would survive; S_ISDIR does not.

CMakeLists.txt:919 puts the file in the main source list with no WIN32
guard
, so it compiles into everything that links the library — including
server, which is on both Windows lanes' target lists.

This is a live regression, and the timings show it

Branch base windows-msvc-cpu duration
#624, #636 pre-#641 fail ~22 min — reached the test run, died in test_openai_api_server.exe (#584)
#642, #643 cefacd2d0 fail ~1 min

A one-minute failure is a compile failure. Before #641 the lanes built for 22
minutes and got as far as executing tests. They no longer build at all.

Why nothing caught it

check-windows-portability.py runs nowhere. It is not in
.github/workflows/, not in .githooks/, and not in scripts/agent-preflight.sh:

$ grep -n 'check-windows-portability' .github/workflows/*.yml .githooks/* scripts/agent-preflight.sh
(no output)

So the checker is correct, current, and orphaned. A contributor running the full
local gate sees green; CI never runs it; and the MSVC lanes that would have caught
it were already red from #584, so a new red there reads as "the known Windows
failure" rather than "this PR stopped Windows compiling". #584 masked #603 the
same way — three defects deep on one lane now.

Scope

Two separable pieces:

  1. Fix the break — guard the POSIX calls in video_engine.cpp, or provide the
    _WIN32 path. The repo already has both idioms (_putenv_s in
    tests/vllm/test_gguf.cpp:85), so this is a small change.
  2. Wire the checker in — put check-windows-portability.py into
    agent-preflight.sh and/or a CI job, so an orphaned gate stops being a gate
    nobody runs. This changes what the gate enforces in practice, so per AGENTS.md
    it wants a red-before/green-after demonstration: cefacd2d0 is the red.

(2) is the one that matters. A checker that no automation runs is indistinguishable
from a deleted checker, and this one had been correct the whole time.

Found while reviewing #642/#643, whose Windows reds turned out not to be the
known #584/#603 pair at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions