tests: include compat.h directly in the converted tests - #1440
Merged
Merged
Conversation
Follow-up to the per-test _putenv_s cleanup: the nine converted files call setenv()/unsetenv() directly but relied on compat.h arriving transitively (via st.h / route_trace.h). Include it explicitly so a future reorder of the engine headers cannot silently break these Windows C tests. No functional change: by the time these direct includes are reached the COMPAT_H guard is already set, so preprocessing is identical apart from the updated diagnostic line numbers. Signed-off-by: texasich <101962694+texasich@users.noreply.github.com>
trigger2k20
pushed a commit
to trigger2k20/colibri
that referenced
this pull request
Sep 13, 2026
dev went red on `Windows UCRT64` / `make check` right after JustVugg#1390 landed: tests/test_qwen36_tier_fill_wait.c:42:5: error: implicit declaration of function 'setenv'; did you mean 'getenv'? MinGW has no setenv. The tests that include an engine .c inherit compat.h through it, but this one includes qwen36_tier.c, which does not pull it in, so the declaration was never there. Linux never noticed because glibc has setenv, and modern GCC turns an implicit declaration into an error rather than a warning, so the Windows leg is where it surfaced. Same shape as JustVugg#1440, which added the include to the six tests that already had it. Reproduced and fixed against mingw-w64 with the Makefile's own Windows flags plus -Werror=implicit-function-declaration, then every other gated test was cross-compiled the same way: this file is the only one affected. The three that still fail that sweep (test_uring, test_deepseek_v4, test_v4_ownership) are in TEST_EXCLUDE and are not built on the Windows leg at all. compat.h joins the rule's prerequisites too, so editing the shim relinks the test instead of leaving a stale one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Direct follow-up to #1432, as raised in review: the nine converted test sources call
setenv()/unsetenv()but relied oncompat.harriving transitively (throughst.hfor the engine tests, throughroute_trace.hfortest_route_trace). They now include../compat.hdirectly, so a future reorder of the engine headers cannot silently drop the shims from these Windows C tests.No functional change: each direct include sits after the file's primary include, and the
COMPAT_Hguard is already set by then, so preprocessing is unchanged apart from shifted diagnostic line numbers. One adjacent comment intest_route_trace.cis updated to match ("...and compat.h..."), and the two tier tests place the include where their siblingtest_qwen36_tier_int8.calready does.Validation
make -C c check(see notes)make -C c cuda-test(not applicable, no CUDA changes)Notes (isolated Linux sandbox, GCC 15.3.0):
test_qwen36_ctx,test_qwen36_dense_batch,test_qwen36_tier_int8_decode,test_qwen36_tier_int8_engine,test_route_trace,test_stops,bench_qwen36_dense_batch.test_inkling_shared_batchandbench_inkling_shared_batchkeep their pre-existing results, identical to unmodifieddevin this sandbox (bf16 scalar-vs-batch bit-exactness;int4-g64: 24077 values differ, worst=4.76837e-07).c/tests/test_makefile_deps.pypasses (2 tests).Compatibility