-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the cmake's output for vcpkg_get_dep_info() #290
Conversation
Set CLICOLOR=0 to force cmake to output "plain" text (without ANSI escape codes)
It looks inconsistent to unset one variable and to set the other to '0'. I still think that the right fix is to not use console output for the cmake output which is meant to be parsed, but write a regular file instead. This would allow cmake to use color as desired by the user for other output. |
Semi-duplicate of #261 but there dg0yt tried to write a test to repro the problem and could not |
I guess the test for CLICOLOR didn't work because vcpkg CI is not really a terminal. CLICOLOR_FORCE makes cmake ignore the terminal property. So the problem is valid, and this PR is a possible solution. |
Constructing a repro should be straightforward. The following conditions can trigger the issue:
The last step will trigger cmake configure, which would invoke the vcpkg installation, which should hit the issue.
I agree, it does seem a bit inconsistent, although the source of inconsistency is external - that's the logic that CMake implements: Arguably, there are some better fixes: redirect cmake output to a file instead of a pipe (like @dg0yt suggested) or set the Ultimately, the fix proposed here is simple and safe and would eliminate a jarring behavior when vcpkg manifests are used on Linux. It doesn't prevent a more elaborate fix in the future. |
Should explain the logic behind CLICOLOR and CLICOLOR_FORCE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM, thanks! |
Set
CLICOLOR=0
to force cmake to output "plain" text (without ANSI escape codes)(see Terminal.c)
On Linux (and likely on other non-Windows platforms), CMake may "colorize" the output depending on the terminal type. This creates problems when
vcpkg
attempts to parse the output from CMake (ex)This PR would fix microsoft/vcpkg#20430