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/src/commands_build.cpp | |
| 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/src/commands_build.cpp')
| -rw-r--r-- | toolsrc/src/commands_build.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
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); } |
