Print path to compiler in output (#1328)
* print compiler path * update messages.json * fix empty message * fix format * add tests and fix * update vcpkg to latest commit * fix * fix * Fix e2e test on Windows. * Change scripts SHA to not include https://github.com/microsoft/vcpkg/pull/36056 --------- Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Родитель
05f88ed2d0
Коммит
13fd7ab03f
|
@ -2,8 +2,17 @@
|
|||
|
||||
$CurrentTest = "Build Test Ports"
|
||||
|
||||
Run-Vcpkg @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports" install vcpkg-internal-e2e-test-port3
|
||||
$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports" install vcpkg-internal-e2e-test-port3
|
||||
Throw-IfFailed
|
||||
if ($output -match "Compiler found: ([^\r\n]+)") {
|
||||
$detected = $matches[1]
|
||||
if (-Not (Test-Path $detected)) {
|
||||
throw "Did not print a valid compiler path (detected $detected)"
|
||||
}
|
||||
} else {
|
||||
throw "Did not detect a compiler"
|
||||
}
|
||||
|
||||
|
||||
$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/vcpkg-internal-e2e-test-port2" install vcpkg-internal-e2e-test-port2
|
||||
Throw-IfFailed
|
||||
|
|
|
@ -866,6 +866,7 @@ DECLARE_MESSAGE(CommandFailed,
|
|||
"{command_line}\n"
|
||||
"failed with the following results:")
|
||||
DECLARE_MESSAGE(CommunityTriplets, (), "", "Community Triplets:")
|
||||
DECLARE_MESSAGE(CompilerPath, (msg::path), "", "Compiler found: {path}")
|
||||
DECLARE_MESSAGE(CompressFolderFailed, (msg::path), "", "Failed to compress folder \"{path}\":")
|
||||
DECLARE_MESSAGE(ComputingInstallPlan, (), "", "Computing installation plan...")
|
||||
DECLARE_MESSAGE(ConfigurationErrorRegistriesWithoutBaseline,
|
||||
|
|
|
@ -261,6 +261,7 @@ namespace vcpkg
|
|||
std::string id;
|
||||
std::string version;
|
||||
std::string hash;
|
||||
std::string path;
|
||||
};
|
||||
|
||||
struct AbiInfo
|
||||
|
|
|
@ -511,6 +511,8 @@
|
|||
"CommandFailed": "command:\n{command_line}\nfailed with the following results:",
|
||||
"_CommandFailed.comment": "An example of {command_line} is vcpkg install zlib.",
|
||||
"CommunityTriplets": "Community Triplets:",
|
||||
"CompilerPath": "Compiler found: {path}",
|
||||
"_CompilerPath.comment": "An example of {path} is /foo/bar.",
|
||||
"CompressFolderFailed": "Failed to compress folder \"{path}\":",
|
||||
"_CompressFolderFailed.comment": "An example of {path} is /foo/bar.",
|
||||
"ComputingInstallPlan": "Computing installation plan...",
|
||||
|
|
|
@ -678,6 +678,12 @@ namespace vcpkg
|
|||
{
|
||||
compiler_info.id = s.substr(MarkerCompilerCxxId.size()).to_string();
|
||||
}
|
||||
static constexpr StringLiteral s_path_marker = "#COMPILER_CXX_PATH#";
|
||||
if (Strings::starts_with(s, s_path_marker))
|
||||
{
|
||||
const auto compiler_cxx_path = s.substr(s_path_marker.size());
|
||||
compiler_info.path.assign(compiler_cxx_path.data(), compiler_cxx_path.size());
|
||||
}
|
||||
Debug::println(s);
|
||||
const auto old_buf_size = buf.size();
|
||||
Strings::append(buf, s, '\n');
|
||||
|
@ -702,6 +708,10 @@ namespace vcpkg
|
|||
}
|
||||
|
||||
Debug::println("Detected compiler hash for triplet ", triplet, ": ", compiler_info.hash);
|
||||
if (!compiler_info.path.empty())
|
||||
{
|
||||
msg::println(msgCompilerPath, msg::path = compiler_info.path);
|
||||
}
|
||||
return compiler_info;
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
66b4b34d99ab272fcf21f2bd12b616e371c6bb31
|
||||
002c5b065927a6142dd7858813f25a10947094d8
|
||||
|
|
Загрузка…
Ссылка в новой задаче