Skip to content
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

Output error text if cmake failed during triplet var detection #536

Merged

Conversation

JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented May 9, 2022

When VCPKG_FORCE_SYSTEM_BINARIES is set and cmake is not installed, the install command will stop and no specific information is printed:

PS F:\vcpkg> .\vcpkg.exe install ctemplate
Computing installation plan...

PS F:\vcpkg>

Output with --debug:

PS F:\vcpkg> .\vcpkg.exe install ctemplate --debug
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Failed to open: F:\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=0, usegitregistry=0, embeddedsha=nullopt
[DEBUG] Using builtin-ports: F:\vcpkg\ports
[DEBUG] Using installed-root: F:\vcpkg\installed
[DEBUG] Using buildtrees-root: F:\vcpkg\buildtrees
[DEBUG] Using packages-root: F:\vcpkg\packages
[DEBUG] Using scripts-root: F:\vcpkg\scripts
[DEBUG] Using vcpkg-root: F:\vcpkg
[DEBUG] Using scripts-root: F:\vcpkg\scripts
[DEBUG] Using builtin-registry: F:\vcpkg\versions
[DEBUG] Using downloads-root: F:\vcpkg\downloads
[DEBUG] Default binary cache path is: C:\Users\usr\AppData\Local\vcpkg\archives
Computing installation plan...
[DEBUG] CreateProcessW(cmake -DVCPKG_ROOT_DIR=F:/vcpkg -DPACKAGES_DIR=F:/vcpkg/packages -DBUILDTREES_DIR=F:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=F:/vcpkg/installed -DDOWNLOADS=F:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "F:\vcpkg\buildtrees\0.vcpkg_dep_info.cmake")
[DEBUG] 2156: cmd_execute_and_stream_data() returned 2 after     3427 us

[DEBUG] D:\a\_work\1\s\src\vcpkg\cmakevars.cpp(267):
[DEBUG] Time in subprocesses: 3427 us
[DEBUG] Time in parsing JSON: 50160 us
[DEBUG] Time in JSON reader: 28941 us
[DEBUG] Time in filesystem: 15995594 us
[DEBUG] Time in loading ports: 16095057 us
[DEBUG] Exiting after 16.36 s (16243766 us)

Fixed results:

PS F:\vcpkg> .\vcpkg.exe install ctemplate
Computing installation plan...
command:
cmake -DVCPKG_ROOT_DIR=F:/vcpkg -DPACKAGES_DIR=F:/vcpkg/packages -DBUILDTREES_DIR=F:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=F:/vcpkg/installed -DDOWNLOADS=F:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "F:\vcpkg\buildtrees\0.vcpkg_dep_info.cmake"
failed with the following results:


PS F:\vcpkg>

@JackBoosY
Copy link
Contributor Author

Maybe fix microsoft/vcpkg#16216.

src/vcpkg/cmakevars.cpp Outdated Show resolved Hide resolved
@autoantwort
Copy link
Contributor

Without #483 still a very misleading message.

@ras0219-msft ras0219-msft changed the title Fix output error message when executing command Output an error text if cmake failed during triplet var detection May 16, 2022
@ras0219-msft ras0219-msft changed the title Output an error text if cmake failed during triplet var detection Output error text if cmake failed during triplet var detection May 16, 2022
@ras0219-msft
Copy link
Contributor

Agreed that #483 will complete this fix, but we need both.

@ras0219-msft ras0219-msft merged commit ef052b7 into microsoft:main May 16, 2022
@JackBoosY JackBoosY deleted the dev/jack/fix-error-output-when-executing branch May 17, 2022 00:21
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.

4 participants