Skip to content

Fix Windows pkgconfig resolution and MSVC flag translation#26631

Merged
medvednikov merged 1 commit into
vlang:masterfrom
quaesitor-scientiam:fix/msvc-pkgconfig-windows
Feb 20, 2026
Merged

Fix Windows pkgconfig resolution and MSVC flag translation#26631
medvednikov merged 1 commit into
vlang:masterfrom
quaesitor-scientiam:fix/msvc-pkgconfig-windows

Conversation

@quaesitor-scientiam

Copy link
Copy Markdown
Contributor

Summary

  • Initialize pcfiledir when parsing .pc files so ${pcfiledir} resolves correctly on Windows/vcpkg.
  • Translate gcc‑style pkgconfig tokens (-I/-L/-l, including quoted groups) into MSVC flags in the MSVC build path.
  • Update pkgconfig tests to include pcfiledir.

Why

V’s internal pkgconfig didn’t set pcfiledir, so ${pcfiledir} expanded to empty and vcpkg paths collapsed to S:\include/S:\lib. This broke MSVC builds (missing ft2build.h) and leaked -L/-l tokens into MSVC. The fix aligns internal pkgconfig behavior with standard pkg-config and makes MSVC robust to gcc-style flag output.

Testing

  • vnew.exe -silent vlib\v\pkgconfig\pkgconfig_test.v
  • Full run: vnew.exe -silent test vlib\v\ → 14 failed, 1973 passed, 24 skipped, 2011 total
    • Fixed 1 failure: vlib\v\pkgconfig\pkgconfig_test.v
    • Remaining 13 failures are sqlite-related (environment dependency)

@quaesitor-scientiam

Copy link
Copy Markdown
Contributor Author

Fixes #26628

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae486f19f5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread vlib/v/builder/msvc_windows.v Outdated
Comment thread vlib/v/builder/msvc_windows.v Outdated
@medvednikov medvednikov merged commit 343f94c into vlang:master Feb 20, 2026
88 of 89 checks passed
@quaesitor-scientiam quaesitor-scientiam deleted the fix/msvc-pkgconfig-windows branch March 3, 2026 16:53
cestef pushed a commit to cestef/v that referenced this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants