diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-13 16:22:02 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-15 18:06:06 -0800 |
| commit | 6824cc9264d245ebd1302c27eb714250c5f7ec13 (patch) | |
| tree | 0c906ded3e50eaab02166a409db6454a113dc476 /toolsrc | |
| parent | 6e25bcf7cb1efd6de55f97aa978acd24d90af476 (diff) | |
| download | vcpkg-6824cc9264d245ebd1302c27eb714250c5f7ec13.tar.gz vcpkg-6824cc9264d245ebd1302c27eb714250c5f7ec13.zip | |
Extract create_user_troubleshooting_message(). CI doesn't call it, interactive commands do
Diffstat (limited to 'toolsrc')
| -rw-r--r-- | toolsrc/include/vcpkg_Commands.h | 1 | ||||
| -rw-r--r-- | toolsrc/src/commands_build.cpp | 20 | ||||
| -rw-r--r-- | toolsrc/src/commands_build_external.cpp | 1 | ||||
| -rw-r--r-- | toolsrc/src/commands_install.cpp | 1 |
4 files changed, 15 insertions, 8 deletions
diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 1dbc9c375..1e8b3b9df 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -23,6 +23,7 @@ namespace vcpkg::Commands const std::string& to_string(const BuildResult build_result); std::string create_error_message(const BuildResult build_result, const std::string& package_id); + std::string create_user_troubleshooting_message(const package_spec& spec); BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index afc814451..750350a4a 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -56,14 +56,6 @@ namespace vcpkg::Commands::Build if (return_code != 0) { - System::println(System::color::error, "Error: building package %s failed", spec.toString()); - System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" - "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" - " Package: %s\n" - " Vcpkg version: %s\n" - "\n" - "Additionally, attach any relevant sections from the log files above." - , spec.toString(), Info::version()); TrackProperty("error", "build failed"); TrackProperty("build_error", spec.toString()); return BuildResult::BUILD_FAILED; @@ -108,6 +100,17 @@ namespace vcpkg::Commands::Build return Strings::format("Error: Building package %s failed with: %s", package_id, Build::to_string(build_result)); } + std::string create_user_troubleshooting_message(const package_spec& spec) + { + return Strings::format("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" + "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" + " Package: %s\n" + " Vcpkg version: %s\n" + "\n" + "Additionally, attach any relevant sections from the log files above." + , spec.toString(), Info::version()); + } + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); @@ -165,6 +168,7 @@ namespace vcpkg::Commands::Build if (result != BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, spec.toString())); + System::println(Build::create_user_troubleshooting_message(spec)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 42b649dc3..fbda74f3f 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -27,6 +27,7 @@ namespace vcpkg::Commands::BuildExternal if (result != Build::BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, spec->toString())); + System::println(Build::create_user_troubleshooting_message(*spec)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 76b9e36e4..af068a4fb 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -218,6 +218,7 @@ namespace vcpkg::Commands::Install if (result != Build::BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, action.spec.toString())); + System::println(Build::create_user_troubleshooting_message(action.spec)); exit(EXIT_FAILURE); } const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); |
