From c64915242c225b1fcb8beeba9f9cf415b75e1d5d Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Tue, 23 Jul 2024 20:01:56 -0700 Subject: [PATCH] Fix several console output nitpicks. * In https://github.com/microsoft/vcpkg-tool/pull/1455 I missed making absolute lowercase. * In https://github.com/microsoft/vcpkg-tool/pull/1408 a lot of whitespace was missed leading to output like error: building vtk:x64-linux failed with: BUILD_FAILEDSee https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information. --- .../end-to-end-tests-dir/post-build-checks.ps1 | 8 ++++---- include/vcpkg/base/message-data.inc.h | 2 +- locales/messages.json | 2 +- src/vcpkg/binarycaching.cpp | 2 ++ src/vcpkg/commands.add-version.cpp | 8 ++++---- src/vcpkg/commands.build.cpp | 2 +- src/vcpkg/registries.cpp | 2 +- src/vcpkg/vcpkgpaths.cpp | 3 +++ 8 files changed, 17 insertions(+), 12 deletions(-) diff --git a/azure-pipelines/end-to-end-tests-dir/post-build-checks.ps1 b/azure-pipelines/end-to-end-tests-dir/post-build-checks.ps1 index 2bf19f8b28..2ae56da212 100644 --- a/azure-pipelines/end-to-end-tests-dir/post-build-checks.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/post-build-checks.ps1 @@ -948,7 +948,7 @@ note: $($buildtreesRoot) "@ # downloads directory here $expectedFooter = @" -$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)include$($NativeSlash)vcpkg-policy-absolute-paths.h: note: Absolute paths found here +$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)include$($NativeSlash)vcpkg-policy-absolute-paths.h: note: absolute paths found here "@ foreach ($bad_dir in @('build-dir', 'downloads', 'installed-root', 'package-dir')) { @@ -964,9 +964,9 @@ foreach ($bad_dir in @('build-dir', 'downloads', 'installed-root', 'package-dir' $expectedFooter = @" $($PortfilePath): note: Adding a call to ``vcpkg_fixup_pkgconfig()`` may fix absolute paths in .pc files -$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)include$($NativeSlash)vcpkg-policy-absolute-paths.h: note: Absolute paths found here -$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)share$($NativeSlash)pkgconfig$($NativeSlash)vcpkg-policy-absolute-paths.pc: note: Absolute paths found here -$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)tools$($NativeSlash)vcpkg-policy-absolute-paths$($NativeSlash)bin$($NativeSlash)port-config.sh: note: Absolute paths found here +$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)include$($NativeSlash)vcpkg-policy-absolute-paths.h: note: absolute paths found here +$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)share$($NativeSlash)pkgconfig$($NativeSlash)vcpkg-policy-absolute-paths.pc: note: absolute paths found here +$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet)$($NativeSlash)tools$($NativeSlash)vcpkg-policy-absolute-paths$($NativeSlash)bin$($NativeSlash)port-config.sh: note: absolute paths found here "@ foreach ($bad_dir in @('build-dir', 'downloads', 'installed-root', 'package-dir')) { diff --git a/include/vcpkg/base/message-data.inc.h b/include/vcpkg/base/message-data.inc.h index ddfcb6ca36..ba588a3469 100644 --- a/include/vcpkg/base/message-data.inc.h +++ b/include/vcpkg/base/message-data.inc.h @@ -1287,7 +1287,7 @@ DECLARE_MESSAGE(FilesContainAbsolutePath1, "followed by a list of found files.", "There should be no absolute paths, such as the following, in an installed package. To suppress this " "message, add set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)") -DECLARE_MESSAGE(FilesContainAbsolutePath2, (), "", "Absolute paths found here") +DECLARE_MESSAGE(FilesContainAbsolutePath2, (), "", "absolute paths found here") DECLARE_MESSAGE(FilesContainAbsolutePathPkgconfigNote, (), "", diff --git a/locales/messages.json b/locales/messages.json index c113bf1f52..4139c7d9c1 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -778,7 +778,7 @@ "_FileSeekFailed.comment": "An example of {path} is /foo/bar. An example of {byte_offset} is 42.", "FilesContainAbsolutePath1": "There should be no absolute paths, such as the following, in an installed package. To suppress this message, add set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)", "_FilesContainAbsolutePath1.comment": "This message is printed before a list of found absolute paths, followed by FilesContainAbsolutePath2, followed by a list of found files.", - "FilesContainAbsolutePath2": "Absolute paths found here", + "FilesContainAbsolutePath2": "absolute paths found here", "FilesContainAbsolutePathPkgconfigNote": "Adding a call to `vcpkg_fixup_pkgconfig()` may fix absolute paths in .pc files", "FilesExported": "Files exported at: {path}", "_FilesExported.comment": "An example of {path} is /foo/bar.", diff --git a/src/vcpkg/binarycaching.cpp b/src/vcpkg/binarycaching.cpp index 42c02afa39..347c8242f5 100644 --- a/src/vcpkg/binarycaching.cpp +++ b/src/vcpkg/binarycaching.cpp @@ -752,6 +752,7 @@ namespace { msg_sink.println(Color::error, msg::format(msgPushingVendorFailed, msg::vendor = "NuGet", msg::path = write_src) + .append_raw('\n') .append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); } else @@ -770,6 +771,7 @@ namespace msg_sink.println( Color::error, msg::format(msgPushingVendorFailed, msg::vendor = "NuGet config", msg::path = write_cfg) + .append_raw('\n') .append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); } else diff --git a/src/vcpkg/commands.add-version.cpp b/src/vcpkg/commands.add-version.cpp index 43ca22306f..7c57ac2b97 100644 --- a/src/vcpkg/commands.add-version.cpp +++ b/src/vcpkg/commands.add-version.cpp @@ -233,11 +233,11 @@ namespace .append_raw(git_tree) .append_raw("\n-- ") .append(msgAddVersionCommitChangesReminder) - .append_raw("\n***") + .append_raw("\n*** ") .append(msgAddVersionNoFilesUpdated) - .append_raw("\n***") + .append_raw("\n*** ") .append(msgSeeURL, msg::url = docs::add_version_command_url) - .append_raw("***")); + .append_raw("\n***")); if (keep_going) return UpdateResult::NotUpdated; Checks::exit_fail(VCPKG_LINE_INFO); } @@ -349,7 +349,7 @@ namespace vcpkg VCPKG_LINE_INFO, add_all, msg::format(msgAddVersionUseOptionAll, msg::command_name = "x-add-version", msg::option = SwitchAll) - .append_raw("\n") + .append_raw('\n') .append(msgSeeURL, msg::url = docs::add_version_command_url)); for (auto&& port_dir : fs.get_directories_non_recursive(paths.builtin_ports_directory(), VCPKG_LINE_INFO)) diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp index e82b8bef70..a0a5c3fbad 100644 --- a/src/vcpkg/commands.build.cpp +++ b/src/vcpkg/commands.build.cpp @@ -1535,7 +1535,7 @@ namespace vcpkg } } - return res.append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url); + return res.append_raw('\n').append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url); } void append_log(const Path& path, const std::string& log, size_t max_log_length, std::string& out) diff --git a/src/vcpkg/registries.cpp b/src/vcpkg/registries.cpp index b3dbc9f168..b9321a558e 100644 --- a/src/vcpkg/registries.cpp +++ b/src/vcpkg/registries.cpp @@ -1052,7 +1052,7 @@ namespace error_msg.append_indent().append_raw(version.to_string()).append_raw('\n'); } - error_msg.append(msgVersionIncomparable4, msg::url = docs::versioning_url); + error_msg.append(msgVersionIncomparable4, msg::url = docs::versioning_url).append_raw('\n'); error_msg.append(msgSeeURL, msg::url = docs::troubleshoot_versioning_url); return error_msg; } diff --git a/src/vcpkg/vcpkgpaths.cpp b/src/vcpkg/vcpkgpaths.cpp index 900b92b838..77e107f5ce 100644 --- a/src/vcpkg/vcpkgpaths.cpp +++ b/src/vcpkg/vcpkgpaths.cpp @@ -799,6 +799,7 @@ namespace vcpkg Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode) + .append_raw('\n') .append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } @@ -811,6 +812,7 @@ namespace vcpkg Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode) + .append_raw('\n') .append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } @@ -823,6 +825,7 @@ namespace vcpkg Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode) + .append_raw('\n') .append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); }