Windows generated C global-byte standalone GCC link misses v_builtin_windows_stream and exception helper

Open
#32,730 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c
Domain
compilers

Research direction

Start at vlib/v/gen/c/byte_identifier_test.v:48, which generates scalar.c and links it directly with MinGW GCC. Trace where v_builtin_windows_stream and v_set_unhandled_exception_filter are declared and defined in V's Windows native link inputs, then compare the standalone GCC link against V's normal native link. Done means the generated C links on Windows without hiding the errors, and the fixture's global-variable and callback runtime assertions still execute.

Written by the indexing model from the issue text.

Description

Executed master Windows generated-C standalone-link failure (R381)

Failing SHA 11ecc52b8aa249eacd57f9c20d1922c858c35a3f; MSVC shard 4 actual completed job 137050984832 finished 2026-11-22 03:43:58 UTC after 420 passed, 168 skipped and one failing vlib/v/gen/c/byte_identifier_test.v:48 test_byte_global_object_and_callback_compile_and_run. Fixture blob 2b6f4bae1130cd7ab5269a7b07881ef16df40f30 is byte-identical at failing SHA and current master 4d924f389f2aa0105f610126b8df4743b33fc0a3.

The fixture V3-generates scalar.c with -new-compiler -d no_segfault_handler -gc none -enable-globals -cc gcc -o scalar.c, then intentionally links generated C directly with MinGW GCC (gcc -std=gnu11 -municode -o scalar scalar.c -lm -lpthread), rather than invoking V's normal native linker. Native link completed with multiple undefined v_builtin_windows_stream references and undefined v_set_unhandled_exception_filter; macro INFINITE was also redefined (warning, not primary root). This is not the R337 wrong MSVC-target Clang selection (the test selects compatible GCC), nor a GitHub timeout, nor the R360 duplicate UCRT mock. Generated body and original global variable/closure assertions did not execute.

Relevant question: these Windows native helpers may be owned by V's ordinary Windows native object inputs rather than generated standalone C; the test explicitly bypasses those inputs. Trace generated C uses, declared definitions and V link inputs for v_builtin_windows_stream/v_set_unhandled_exception_filter; compare Windows GCC standalone C link versus V link and Linux C control. Repair by supplying correct native helper object/prototypes or appropriate hermetic C-only fixture ownership while preserving real global and callback runtime checks, not by hiding linker errors or skipping Windows. Test body unchanged current, no matching validated fix identified.

Status R381 unresolved/still applicable. Native Windows build/fmt/original corrected integration unavailable locally. Exact first/last observed 2026-11-22 03:43:58 UTC, Windows MSVC-sharded runner invoking GCC nested link.

[!NOTE]
You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Dominant language
V
Stars
38.1k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
682

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vlang/v

All issues in vlang/v

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.