Skip to content

Add a host-info command - #2126

Open
Rafael Kitover (rkitover) wants to merge 1 commit into
microsoft:mainfrom
rkitover:host-info-command
Open

Rafael Kitover (rkitover) wants to merge 1 commit into
microsoft:mainfrom
rkitover:host-info-command

Conversation

@rkitover

@rkitover Rafael Kitover (rkitover) commented Sep 18, 2026 •

Copy link
Copy Markdown

Add a host-info command

Diagnosing a vcpkg problem from a bug report means asking the reporter
about their machine and configuration over several rounds. Print it all
in one place instead, in the depend-info list format.

The output covers the operating system, the glibc or musl version on
Linux, the Xcode version on macOS, Visual Studio instances with their
MSVC toolsets, the Windows SDKs, MinGW compilers on the PATH, the vcpkg
executable and root, the host triplet, the CMake variables this tool
resolves for the toolchain and for port builds, and the environment
variables that affect vcpkg.

Nothing is selected or acquired: the command only reports what is
there.

Also fix Strings::trim() returning a huge view instead of an empty one
for a string that is all whitespace.

Assisted-By: Claude Opus 5.5 noreply@anthropic.com

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved moderate findings affect diagnostic output correctness and completeness.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds vcpkg host-info to report host details and active vcpkg configuration.

Changes:

  • Adds cross-platform OS and libc detection.
  • Reports environment, toolchain, and port-build variables.
  • Registers the command and adds help localization.

Review findings:

  • Four moderate issues require correction in environment reporting, port variables, and value formatting.
  • Additional nits concern test coverage, documentation availability, and localization usage.
File Description
src/​vcpkg/​commands.host-info.cpp Implements host and configuration reporting.
src/​vcpkg/​commands.cpp Registers the command.
locales/​messages.json Adds generated English help localization.
include/​vcpkg/​commands.host-info.h Declares the command interface.
include/​vcpkg/​base/​message-data.inc.h Adds help-message declarations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vcpkg/commands.host-info.cpp Resolved
@rkitover

Copy link
Copy Markdown
Author

Here is a screenshot:

svcpkg host-info screenshot

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved credential disclosure and reporting correctness issues remain.

Review effort: Lite
Findings: 1 High severity · 2 Medium severity · 1 Low severity

Open (4)
Resolved since last review (1)

Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/commands.host-info.cpp Resolved
@rkitover
Rafael Kitover (rkitover) force-pushed the host-info-command branch 2 times, most recently from 59ce7e4 to b13acbc Compare October 4, 2026 14:18
Copilot AI lite review requested due to automatic review settings October 4, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/visualstudio.cpp Resolved
@rkitover

Copy link
Copy Markdown
Author

Billy O'Neal (@BillyONeal) Kai Pastor (@dg0yt)

I think I'm ready with this, can you take a look please?

This adds the host triplet, which can be extracted by the CMake toolchain, which was my primary purpose for making this.

Here are some screenshots:

Visual Studio:

Visual Studio screenshot

MSYS2 CLANG64 (x64-mingw-static)

MSYS2 CLANG64 screenshot

MSYS2 MINGW32 (x86-mingw-static)

MSYS2 MINGW32 screenshot

Linuux (Ubuntu WSL)

Linux Ubuntu screenshot

macOS Intel (x64-osx)

macOS Intel screenshot

macOS ARM64 (arm64-osx)

macOS ARM64 screenshot

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/vcpkg/commands.host-info.cpp Resolved
@Thomas1664

Copy link
Copy Markdown
Contributor

As copilot already pointed out, we need to be careful not to accidentally expose sensitive information in binary caching URLs. There should be existing code related to binary caching that already deals with this.

@rkitover

Copy link
Copy Markdown
Author

I am removing secrets in these environment variables in this commit:

  • VCPKG_BINARY_SOURCES
  • X_VCPKG_ASSET_SOURCES
  • HTTP_PROXY, HTTPS_PROXY
  • VCPKG_NUGET_REPOSITORY

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active moderate and critical findings remain, including failures that can block diagnostics and leak proxy or asset-source credentials.

3 open issues
1 resolved since last review

Review effort: Lite

Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/commands.host-info.cpp Resolved
Comment thread src/vcpkg/commands.cpp Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The change has unresolved correctness and security issues: it omits a relevant cache setting, can expose credentials in x-script asset sources, and fails to report the MinGW thread model for GCC and Clang.

3 open issues

Review effort: Lite

Diagnosing a vcpkg problem from a bug report means asking the reporter
about their machine and configuration over several rounds. Print it all
in one place instead, in the depend-info list format.

The output covers the operating system, the glibc or musl version on
Linux, the Xcode version on macOS, Visual Studio instances with their
MSVC toolsets, the Windows SDKs, MinGW compilers on the PATH, the vcpkg
executable and root, the host triplet, the CMake variables this tool
resolves for the toolchain and for port builds, and the environment
variables that affect vcpkg, with any credentials in them redacted.

Nothing is selected or acquired: the command only reports what is
there.

Also fix Strings::trim() returning a huge view instead of an empty one
for a string that is all whitespace.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Rafael Kitover <rkitover@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two active issues remain: a critical all-whitespace string-view bug can create an invalid oversized view, and the host-info report omits PATH details needed to explain system-tool lookup differences.

2 open issues
2 resolved since last review

Review effort: Lite

Comment thread src/vcpkg/base/strings.cpp Resolved
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