MSVC nested fixed-array pointer Cgen fixture forces incompatible -os linux

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c

Research direction

The failing check is test_fixed_array_pointer_field_does_not_heap_promote_value_receiver in vlib/v/gen/c/fixed_array_pointer_field_escape_test.v near line 37, which runs the compiler with -gc none -os linux -arch amd64. The candidate fix selects -os windows only on Windows and keeps the Coordinator__is_closed and memdup assertions unchanged. Done means the test passes on the native Windows MSVC shard and Linux behaviour is unchanged.

Written by the indexing model from the issue text.

Description

Executed historical master Windows target-selection regression (R379)

Failing SHA 11ecc52b8aa249eacd57f9c20d1922c858c35a3f, actual completed Windows MSVC shard 3 https://github.com/vlang/v/actions/runs/44968804254/job/137050984818 on 2026-11-22 03:20:24 UTC: 442 unrelated tests pass/164 skipped. vlib/v/gen/c/fixed_array_pointer_field_escape_test.v:37 test_fixed_array_pointer_field_does_not_heap_promote_value_receiver fails compiled.exit_code == 0, native compiler says MSVC requires a Windows target; cannot compile target 'linux'. This is a nested fixture target selection error, not a malformed generated C expression or real compiler ABI limitation of the tested pointer field.

The test (blob f8305cac6afe2ca357f007de6a7f90ad34f938aa, byte-identical on failing SHA and current master 4d924f389f2aa0105f610126b8df4743b33fc0a3) forces -gc none -os linux -arch amd64 -o output.c input.v even when running the Windows shared V3 compiler selected by V3_TEST_UNIT_SHARED_V3. The generated-C body assertions are explicitly Coordinator__is_closed present and memdup/temporary fixed-array promotions absent. A narrowly scoped candidate is select -os windows on Windows only, preserve -os linux on other platforms, with all original body assertions unchanged; native patched run is required because target-specific C output can differ.

Next: run original test against native Windows MSVC/GCC/TCC V3, verify source output C file and all original assertions; compare unchanged Linux/Clang behavior, V self, format, relevant Cgen tests. Do not simply skip on Windows or suppress the target driver diagnostic.

Status: unresolved / still applicable, fix candidate statically identified, not validated.

[!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.