diff options
Diffstat (limited to 'toolsrc/src')
| -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 |
3 files changed, 14 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); } 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(); |
