Repository navigation
Add a host-info command - #2126
Rafael Kitover (rkitover) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
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.
da3bcf6 to
e0086e9
Compare
59ce7e4 to
b13acbc
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The reviewed findings include credential disclosure and incomplete or inaccurate diagnostic reporting.
Review effort: Lite
Findings: 1
Open (8)
Redact credentials from diagnostic environment values Compiler thread models are omitted from verbose queries · New Preserve PATH order when reporting discovered compilers · New Include PATH in the environment report · New SortedVector drops same-version Visual Studio installations · New Include VCPKG_BINARY_CACHE_COMPRESSION_LEVEL in host info MinGW GCC probe fails without preprocess input Document host-info command before exposing it
|
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:MSYS2 CLANG64 (
|
b13acbc to
c79bad2
Compare
c79bad2 to
7e4d498
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the credential redaction flaw and complete the host-information reporting and ATL/MFC detection.
Review effort: Lite
Findings: 1
Open (1)
Resolved since last review (8)
Redact credentials from diagnostic environment values SortedVector drops same-version Visual Studio installations Include PATH in the environment report Preserve PATH order when reporting discovered compilers Compiler thread models are omitted from verbose queries Include VCPKG_BINARY_CACHE_COMPRESSION_LEVEL in host info MinGW GCC probe fails without preprocess input Document host-info command before exposing it
|
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. |
|
I am removing secrets in these environment variables in this commit:
|
7e4d498 to
5f721da
Compare
5f721da to
e05658d
Compare
There was a problem hiding this comment.
🔵 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>
e05658d to
0604269
Compare
There was a problem hiding this comment.
🟡 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










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