From c518a89aeb22d1987e1f141d07cbabf8b9897fb0 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Thu, 16 May 2024 14:47:42 -0400 Subject: [PATCH 01/12] add some links to learn --- include/vcpkg/base/message-data.inc.h | 5 ----- include/vcpkg/documentation.h | 20 ++++++++++++++------ src/vcpkg/commands.add-version.cpp | 25 +++++++++++++++++-------- src/vcpkg/commands.add.cpp | 4 ++-- src/vcpkg/commands.build.cpp | 2 +- src/vcpkg/commands.find.cpp | 3 ++- src/vcpkg/commands.remove.cpp | 3 ++- 7 files changed, 38 insertions(+), 24 deletions(-) diff --git a/include/vcpkg/base/message-data.inc.h b/include/vcpkg/base/message-data.inc.h index d563a7fc94..a592d22c01 100644 --- a/include/vcpkg/base/message-data.inc.h +++ b/include/vcpkg/base/message-data.inc.h @@ -14,10 +14,6 @@ DECLARE_MESSAGE(AString, (), "", "a string") DECLARE_MESSAGE(ADateVersionString, (), "", "a date version string") DECLARE_MESSAGE(AddArtifactOnlyOne, (msg::command_line), "", "'{command_line}' can only add one artifact at a time.") DECLARE_MESSAGE(AddCommandFirstArg, (), "", "The first parameter to add must be 'artifact' or 'port'.") -DECLARE_MESSAGE(AddFirstArgument, - (msg::command_line), - "", - "The first argument to '{command_line}' must be 'artifact' or 'port'.") DECLARE_MESSAGE(AddingCompletionEntry, (msg::path), "", "Adding vcpkg completion entry to {path}.") DECLARE_MESSAGE(AdditionalPackagesToExport, (), @@ -45,7 +41,6 @@ DECLARE_MESSAGE(AddVersionArtifactsOnly, "--version is artifacts only and can't be used with vcpkg add port") DECLARE_MESSAGE(AddVersionAddedVersionToFile, (msg::version, msg::path), "", "added version {version} to {path}") DECLARE_MESSAGE(AddVersionCommitChangesReminder, (), "", "Did you remember to commit your changes?") -DECLARE_MESSAGE(AddVersionCommitResultReminder, (), "", "Don't forget to commit the result!") DECLARE_MESSAGE(AddVersionDetectLocalChangesError, (), "", diff --git a/include/vcpkg/documentation.h b/include/vcpkg/documentation.h index adeeeb62d8..c18019f10d 100644 --- a/include/vcpkg/documentation.h +++ b/include/vcpkg/documentation.h @@ -6,12 +6,20 @@ namespace vcpkg { namespace docs { - static constexpr StringLiteral registries_url = "https://learn.microsoft.com/vcpkg/users/registries"; - static constexpr StringLiteral manifests_url = "https://learn.microsoft.com/vcpkg/users/manifests"; - static constexpr StringLiteral assetcaching_url = "https://learn.microsoft.com/vcpkg/users/assetcaching"; - static constexpr StringLiteral binarycaching_url = "https://learn.microsoft.com/vcpkg/users/binarycaching"; - static constexpr StringLiteral versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning"; + static constexpr StringLiteral registries_url = "https://learn.microsoft.com/vcpkg/users/registries?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral manifests_url = "https://learn.microsoft.com/vcpkg/users/manifests?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral assetcaching_url = "https://learn.microsoft.com/vcpkg/users/assetcaching?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral binarycaching_url = "https://learn.microsoft.com/vcpkg/users/binarycaching?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral version_schemes = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli#version-schemes"; static constexpr StringLiteral vcpkg_visual_studio_path_url = - "https://learn.microsoft.com/vcpkg/users/triplets#VCPKG_VISUAL_STUDIO_PATH"; + "https://learn.microsoft.com/vcpkg/users/triplets?WT.mc_id=vcpkg_inproduct_cli#VCPKG_VISUAL_STUDIO_PATH"; + static constexpr StringLiteral troubleshoot_build_failures_url = "https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral add_command_url = "https://learn.microsoft.com/vcpkg/commands/add?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral add_command_recurse_opt_url = "https://learn.microsoft.com/vcpkg/commands/remove?WT.mc_id=vcpkg_inproduct_cli#--recurse"; + static constexpr StringLiteral add_version_command_url = "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral add_version_command_overwrite_version_opt_url = "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--overwrite-version"; + static constexpr StringLiteral radd_version_command_all_opt_url = "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--all"; + static constexpr StringLiteral format_manifest_command_url = "https://learn.microsoft.com/vcpkg/commands/format-manifest?WT.mc_id=vcpkg_inproduct_cli"; } } diff --git a/src/vcpkg/commands.add-version.cpp b/src/vcpkg/commands.add-version.cpp index a68b257264..8e840d9fac 100644 --- a/src/vcpkg/commands.add-version.cpp +++ b/src/vcpkg/commands.add-version.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -73,20 +74,20 @@ namespace if (DateVersion::try_parse(version.version.text)) { Checks::msg_exit_with_message(VCPKG_LINE_INFO, - msgAddVersionSuggestNewVersionScheme, + msg::format(msgAddVersionSuggestNewVersionScheme, msg::new_scheme = VERSION_DATE, msg::old_scheme = VERSION_STRING, msg::package_name = port_name, - msg::option = OPTION_SKIP_VERSION_FORMAT_CHECK); + msg::option = OPTION_SKIP_VERSION_FORMAT_CHECK).append_raw("\n").append(msgSeeURL, msg::url = docs::version_schemes)); } if (DotVersion::try_parse_relaxed(version.version.text)) { Checks::msg_exit_with_message(VCPKG_LINE_INFO, - msgAddVersionSuggestNewVersionScheme, + msg::format(msgAddVersionSuggestNewVersionScheme, msg::new_scheme = VERSION_RELAXED, msg::old_scheme = VERSION_STRING, msg::package_name = port_name, - msg::option = OPTION_SKIP_VERSION_FORMAT_CHECK); + msg::option = OPTION_SKIP_VERSION_FORMAT_CHECK).append_raw("\n").append(msgSeeURL, msg::url = docs::version_schemes)); } } } @@ -254,6 +255,8 @@ namespace .append(msgAddVersionCommitChangesReminder) .append_raw("\n***") .append(msgAddVersionNoFilesUpdated) + .append_raw("\n***") + .append(msgSeeURL, msg::url = docs::add_version_command_url) .append_raw("***")); if (keep_going) return UpdateResult::NotUpdated; Checks::exit_fail(VCPKG_LINE_INFO); @@ -279,6 +282,8 @@ namespace .append(msgAddVersionUpdateVersionReminder) .append_raw('\n') .append(msgAddVersionOverwriteOptionSuggestion, msg::option = OPTION_OVERWRITE_VERSION) + .append_raw('\n') + .append(msgSeeURL, msg::url = docs::add_version_command_overwrite_version_opt_url) .append_raw("\n***") .append(msgAddVersionNoFilesUpdated) .append_raw("***")); @@ -363,9 +368,9 @@ namespace vcpkg { Checks::msg_check_exit(VCPKG_LINE_INFO, add_all, - msgAddVersionUseOptionAll, + msg::format(msgAddVersionUseOptionAll, msg::command_name = "x-add-version", - msg::option = OPTION_ALL); + msg::option = OPTION_ALL).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)) { @@ -433,8 +438,10 @@ namespace vcpkg .append_raw('\n') .append(msgAddVersionFormatPortSuggestion, msg::command_line = command_line) .append_raw('\n') - .append(msgAddVersionCommitResultReminder) - .append_raw('\n')); + .append(msgSeeURL, msg::url = docs::format_manifest_command_url) + .append(msgAddVersionCommitChangesReminder) + .append_raw('\n') + .append(msgSeeURL, msg::url = docs::add_version_command_url)); Checks::check_exit(VCPKG_LINE_INFO, !add_all); continue; } @@ -456,6 +463,8 @@ namespace vcpkg .append(msgAddVersionCommitChangesReminder) .append_raw("\n***") .append(msgAddVersionNoFilesUpdated) + .append_raw("\n***") + .append(msgSeeURL, msg::url = docs::add_version_command_url) .append_raw("***")); if (add_all) continue; Checks::exit_fail(VCPKG_LINE_INFO); diff --git a/src/vcpkg/commands.add.cpp b/src/vcpkg/commands.add.cpp index c37a7db3b0..85dc2b8021 100644 --- a/src/vcpkg/commands.add.cpp +++ b/src/vcpkg/commands.add.cpp @@ -69,7 +69,7 @@ namespace vcpkg if (!manifest) { Checks::msg_exit_with_message( - VCPKG_LINE_INFO, msgAddPortRequiresManifest, msg::command_line = "vcpkg add port"); + VCPKG_LINE_INFO, msg::format(msgAddPortRequiresManifest, msg::command_line = "vcpkg add port").append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); } if (Util::Maps::contains(parsed.settings, OPTION_VERSION)) @@ -164,6 +164,6 @@ namespace vcpkg Checks::exit_success(VCPKG_LINE_INFO); } - Checks::msg_exit_with_message(VCPKG_LINE_INFO, msgAddFirstArgument, msg::command_line = "vcpkg add"); + Checks::msg_exit_with_message(VCPKG_LINE_INFO, msg::format(msgAddCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); } } diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp index 8eac2887f1..636380862a 100644 --- a/src/vcpkg/commands.build.cpp +++ b/src/vcpkg/commands.build.cpp @@ -1485,7 +1485,7 @@ namespace vcpkg } } - return res; + return res.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/commands.find.cpp b/src/vcpkg/commands.find.cpp index 7bc6bc5e4d..a5c6d34364 100644 --- a/src/vcpkg/commands.find.cpp +++ b/src/vcpkg/commands.find.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -286,6 +287,6 @@ namespace vcpkg perform_find_port_and_exit(paths, full_description, enable_json, filter, paths.overlay_ports); } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msgAddCommandFirstArg); + Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgAddCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); } } // namespace vcpkg diff --git a/src/vcpkg/commands.remove.cpp b/src/vcpkg/commands.remove.cpp index 9e489dfd35..c6a0e0c7d6 100644 --- a/src/vcpkg/commands.remove.cpp +++ b/src/vcpkg/commands.remove.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -250,7 +251,7 @@ namespace vcpkg if (!is_recursive) { - msg::println_warning(msgAddRecurseOption); + msg::println_warning(msg::format(msgAddRecurseOption).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_recurse_opt_url)); Checks::exit_fail(VCPKG_LINE_INFO); } } From d668b0299241c33396af27a743f89fd70a67bee9 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Thu, 16 May 2024 14:50:34 -0400 Subject: [PATCH 02/12] ensure SeeURL is using documentation.h --- include/vcpkg/documentation.h | 1 + src/vcpkg/commands.help.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/vcpkg/documentation.h b/include/vcpkg/documentation.h index c18019f10d..5c589e1e68 100644 --- a/include/vcpkg/documentation.h +++ b/include/vcpkg/documentation.h @@ -12,6 +12,7 @@ namespace vcpkg static constexpr StringLiteral binarycaching_url = "https://learn.microsoft.com/vcpkg/users/binarycaching?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral version_schemes = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli#version-schemes"; + static constexpr StringLiteral triplets_url = "https://learn.microsoft.com/vcpkg/users/triplets?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral vcpkg_visual_studio_path_url = "https://learn.microsoft.com/vcpkg/users/triplets?WT.mc_id=vcpkg_inproduct_cli#VCPKG_VISUAL_STUDIO_PATH"; static constexpr StringLiteral troubleshoot_build_failures_url = "https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli"; diff --git a/src/vcpkg/commands.help.cpp b/src/vcpkg/commands.help.cpp index 743d13bc0d..152ea7659e 100644 --- a/src/vcpkg/commands.help.cpp +++ b/src/vcpkg/commands.help.cpp @@ -145,7 +145,7 @@ namespace vcpkg } } - result.append(msgSeeURL, msg::url = "https://learn.microsoft.com/vcpkg/users/triplets"); + result.append(msgSeeURL, msg::url = docs::triplets_url); result.append_raw('\n'); msg::print(result); } From fb0ec0c1f7ea7057a76976e550f282f33054ef63 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Fri, 17 May 2024 10:58:06 -0400 Subject: [PATCH 03/12] fix unit tests --- include/vcpkg/documentation.h | 1 + src/vcpkg-test/dependencies.cpp | 9 +++++---- src/vcpkg-test/input.cpp | 8 ++++---- src/vcpkg-test/manifests.cpp | 25 +++++++++++++------------ src/vcpkg-test/registries.cpp | 13 +++++++------ src/vcpkg-test/specifier.cpp | 3 ++- 6 files changed, 32 insertions(+), 27 deletions(-) diff --git a/include/vcpkg/documentation.h b/include/vcpkg/documentation.h index b28c9121af..c07e38c50d 100644 --- a/include/vcpkg/documentation.h +++ b/include/vcpkg/documentation.h @@ -8,6 +8,7 @@ namespace vcpkg { static constexpr StringLiteral registries_url = "https://learn.microsoft.com/vcpkg/users/registries?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral manifests_url = "https://learn.microsoft.com/vcpkg/users/manifests?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral vcpkg_json_ref_name = "https://learn.microsoft.com/vcpkg/reference/vcpkg-json?WT.mc_id=vcpkg_inproduct_cli#name"; static constexpr StringLiteral assetcaching_url = "https://learn.microsoft.com/vcpkg/users/assetcaching?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral binarycaching_url = "https://learn.microsoft.com/vcpkg/users/binarycaching?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli"; diff --git a/src/vcpkg-test/dependencies.cpp b/src/vcpkg-test/dependencies.cpp index 97c573306f..f734afa65d 100644 --- a/src/vcpkg-test/dependencies.cpp +++ b/src/vcpkg-test/dependencies.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -478,7 +479,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "2with\"quotes" } ] -See `vcpkg help versioning` or https://learn.microsoft.com/vcpkg/users/versioning for more information.)"); +See `vcpkg help versioning` or )"+ docs::versioning_url + R"( for more information.)"); } TEST_CASE ("version install string port version", "[versionplan]") @@ -1117,7 +1118,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "1.0.0" } ] -See `vcpkg help versioning` or https://learn.microsoft.com/vcpkg/users/versioning for more information.)"); +See `vcpkg help versioning` or )" + docs::versioning_url + R"( for more information.)"); } SECTION ("higher baseline") { @@ -1148,7 +1149,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "1.0.2" } ] -See `vcpkg help versioning` or https://learn.microsoft.com/vcpkg/users/versioning for more information.)"); +See `vcpkg help versioning` or )" + docs::versioning_url + R"( for more information.)"); } } @@ -1241,7 +1242,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "1" } ] -See `vcpkg help versioning` or https://learn.microsoft.com/vcpkg/users/versioning for more information.)"); +See `vcpkg help versioning` or )" + docs::versioning_url + R"( for more information.)"); } SECTION ("lower baseline") { diff --git a/src/vcpkg-test/input.cpp b/src/vcpkg-test/input.cpp index 177d978902..9c91c45a94 100644 --- a/src/vcpkg-test/input.cpp +++ b/src/vcpkg-test/input.cpp @@ -1,5 +1,6 @@ #include +#include #include #include @@ -99,8 +100,7 @@ Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows -See https://learn.microsoft.com/vcpkg/users/triplets for more information. -)")); +See )" + docs::triplets_url + R"( for more information.)")); } TEST_CASE ("check_and_get_package_spec validates the triplet", "[input][check_and_get_package_spec]") @@ -125,7 +125,7 @@ Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows -See https://learn.microsoft.com/vcpkg/users/triplets for more information. +See )" + docs::triplets_url + R"( for more information. )")); } @@ -192,7 +192,7 @@ Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows -See https://learn.microsoft.com/vcpkg/users/triplets for more information. +See )" + docs::triplets_url + R"( for more information. )")); } diff --git a/src/vcpkg-test/manifests.cpp b/src/vcpkg-test/manifests.cpp index a9d94b2ae7..0e81db306c 100644 --- a/src/vcpkg-test/manifests.cpp +++ b/src/vcpkg-test/manifests.cpp @@ -4,6 +4,7 @@ #include +#include #include #include @@ -1418,8 +1419,8 @@ TEST_CASE ("default-feature-empty errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.default-features[0] (a feature name): \"\" is not a valid feature name. Feature " - "names must be lowercase alphanumeric+hypens and not reserved (see " - "https://learn.microsoft.com/vcpkg/users/manifests for more information)."); + "names must be lowercase alphanumeric+hypens and not reserved (see " + + docs::manifests_url + " for more information)."); } TEST_CASE ("default-feature-empty-object errors", "[manifests]") @@ -1431,8 +1432,8 @@ TEST_CASE ("default-feature-empty-object errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.default-features[0].name (a feature name): \"\" is not a valid feature name. " - "Feature names must be lowercase alphanumeric+hypens and not reserved (see " - "https://learn.microsoft.com/vcpkg/users/manifests for more information)."); + "Feature names must be lowercase alphanumeric+hypens and not reserved (see " + + docs::manifests_url + " for more information)."); } TEST_CASE ("dependency-name-empty errors", "[manifests]") @@ -1444,8 +1445,8 @@ TEST_CASE ("dependency-name-empty errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0] (a package name): \"\" is not a valid package name. Package " - "names must be lowercase alphanumeric+hypens and not reserved (see " - "https://learn.microsoft.com/vcpkg/users/manifests for more information)."); + "names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + + " for more information)."); } TEST_CASE ("dependency-name-empty-object errors", "[manifests]") @@ -1457,8 +1458,8 @@ TEST_CASE ("dependency-name-empty-object errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0].name (a package name): \"\" is not a valid package name. " - "Package names must be lowercase alphanumeric+hypens and not reserved (see " - "https://learn.microsoft.com/vcpkg/users/manifests for more information)."); + "Package names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + + " for more information)."); } TEST_CASE ("dependency-feature-name-core errors", "[manifests]") @@ -1544,8 +1545,8 @@ TEST_CASE ("dependency-feature-name-empty errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0].features[0] (a feature name): \"\" is not a valid feature name. " - "Feature names must be lowercase alphanumeric+hypens and not reserved (see " - "https://learn.microsoft.com/vcpkg/users/manifests for more information)."); + "Feature names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + + " for more information)."); } TEST_CASE ("dependency-feature-name-empty-object errors", "[manifests]") @@ -1562,6 +1563,6 @@ TEST_CASE ("dependency-feature-name-empty-object errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0].features[0].name (a feature name): \"\" is not a valid feature " - "name. Feature names must be lowercase alphanumeric+hypens and not reserved (see " - "https://learn.microsoft.com/vcpkg/users/manifests for more information)."); + "name. Feature names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + + " for more information)."); } diff --git a/src/vcpkg-test/registries.cpp b/src/vcpkg-test/registries.cpp index 095c6d0bf8..ecb10fa790 100644 --- a/src/vcpkg-test/registries.cpp +++ b/src/vcpkg-test/registries.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -421,16 +422,16 @@ TEST_CASE ("registries report pattern errors", "[registries]") REQUIRE(errors.size() == 3); CHECK(errors[0] == "test: error: $.registries[0].packages[1] (a package pattern): \"\" is not a valid package " "pattern. Package patterns must " - "use only one wildcard character (*) and it must be the last character in the pattern (see " - "https://learn.microsoft.com/vcpkg/users/registries for more information)."); + "use only one wildcard character (*) and it must be the last character in the pattern (see " + docs::registries_url + + " for more information)."); CHECK(errors[1] == "test: error: $.registries[0].packages[2] (a package pattern): \"a*a\" is not a valid package " "pattern. Package patterns " - "must use only one wildcard character (*) and it must be the last character in the pattern (see " - "https://learn.microsoft.com/vcpkg/users/registries for more information)."); + "must use only one wildcard character (*) and it must be the last character in the pattern (see " + docs::registries_url + + " for more information)."); CHECK(errors[2] == "test: error: $.registries[0].packages[3] (a package pattern): \"*a\" is not a valid package " "pattern. Package patterns " - "must use only one wildcard character (*) and it must be the last character in the pattern (see " - "https://learn.microsoft.com/vcpkg/users/registries for more information)."); + "must use only one wildcard character (*) and it must be the last character in the pattern (see " + docs::registries_url + + " for more information)."); } TEST_CASE ("registries ignored patterns warning", "[registries]") diff --git a/src/vcpkg-test/specifier.cpp b/src/vcpkg-test/specifier.cpp index 3575baa03e..08488deae2 100644 --- a/src/vcpkg-test/specifier.cpp +++ b/src/vcpkg-test/specifier.cpp @@ -2,6 +2,7 @@ #include +#include #include using namespace vcpkg; @@ -118,7 +119,7 @@ TEST_CASE ("specifier parsing", "[specifier]") REQUIRE( s.error() == LocalizedString::from_raw( - R"(error: expected the end of input parsing a package name; this usually means the indicated character is not allowed to be in a port name. Port names are all lowercase alphanumeric+hypens and not reserved (see https://learn.microsoft.com/vcpkg/reference/vcpkg-json#name for more information). + R"(error: expected the end of input parsing a package name; this usually means the indicated character is not allowed to be in a port name. Port names are all lowercase alphanumeric+hypens and not reserved (see )" + docs::vcpkg_json_ref_name + R"( for more information). on expression: zlib# ^)")); } From 4491a534e3fda3c6f25fca7f276f81c1110d3901 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Fri, 17 May 2024 11:14:58 -0400 Subject: [PATCH 04/12] fix unit test in input.cpp --- src/vcpkg-test/input.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vcpkg-test/input.cpp b/src/vcpkg-test/input.cpp index 9c91c45a94..e50422dbe4 100644 --- a/src/vcpkg-test/input.cpp +++ b/src/vcpkg-test/input.cpp @@ -187,13 +187,14 @@ TEST_CASE ("check_and_get_full_package_spec validates the triplet", "[input][che maybe_spec = check_and_get_full_package_spec("zlib[core]:x86-windows", Triplet::from_canonical_name("x64-windows"), db); REQUIRE(!maybe_spec.has_value()); - REQUIRE(maybe_spec.error() == LocalizedString::from_raw(R"(error: Invalid triplet: x86-windows + std::string expected_error = R"(error: Invalid triplet: x86-windows Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows -See )" + docs::triplets_url + R"( for more information. -)")); +See )" + std::string(vcpkg::docs::triplets_url) + R"( for more information. +)"; + REQUIRE(maybe_spec.error() == expected_error); } TEST_CASE ("check_and_get_full_package_spec forbids malformed", "[input][check_and_get_full_package_spec]") From c9f07602870317ec5347cf4a0aa929c90d794446 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Fri, 17 May 2024 11:22:15 -0400 Subject: [PATCH 05/12] oops missed a few --- src/vcpkg-test/input.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vcpkg-test/input.cpp b/src/vcpkg-test/input.cpp index e50422dbe4..62f72b0ca9 100644 --- a/src/vcpkg-test/input.cpp +++ b/src/vcpkg-test/input.cpp @@ -95,12 +95,13 @@ TEST_CASE ("check_triplet validates", "[input][check_triplet]") REQUIRE(maybe_check.has_value()); maybe_check = check_triplet("x86-windows", db); REQUIRE(!maybe_check.has_value()); - REQUIRE(maybe_check.error() == LocalizedString::from_raw(R"(error: Invalid triplet: x86-windows + std::string expected_error = R"(error: Invalid triplet: x86-windows Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows -See )" + docs::triplets_url + R"( for more information.)")); +See )" + docs::triplets_url + R"( for more information.)"; + REQUIRE(maybe_check.error() == expected_error); } TEST_CASE ("check_and_get_package_spec validates the triplet", "[input][check_and_get_package_spec]") @@ -120,13 +121,14 @@ TEST_CASE ("check_and_get_package_spec validates the triplet", "[input][check_an maybe_spec = check_and_get_package_spec("zlib:x86-windows", Triplet::from_canonical_name("x64-windows"), db); REQUIRE(!maybe_spec.has_value()); - REQUIRE(maybe_spec.error() == LocalizedString::from_raw(R"(error: Invalid triplet: x86-windows + std::string expected_error = R"(error: Invalid triplet: x86-windows Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows See )" + docs::triplets_url + R"( for more information. -)")); +)"; + REQUIRE(maybe_spec.error() == expected_error); } TEST_CASE ("check_and_get_package_spec forbids malformed", "[input][check_and_get_package_spec]") @@ -192,7 +194,7 @@ Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows -See )" + std::string(vcpkg::docs::triplets_url) + R"( for more information. +See )" + docs::triplets_url + R"( for more information. )"; REQUIRE(maybe_spec.error() == expected_error); } From fc327c8ea542fbdffd667a2fd6eebb8fde8c99d5 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Fri, 17 May 2024 11:30:11 -0400 Subject: [PATCH 06/12] try again.. --- src/vcpkg-test/input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vcpkg-test/input.cpp b/src/vcpkg-test/input.cpp index 62f72b0ca9..07071c3758 100644 --- a/src/vcpkg-test/input.cpp +++ b/src/vcpkg-test/input.cpp @@ -100,7 +100,8 @@ Built-in Triplets: Community Triplets: Overlay Triplets from "x64-windows.cmake": x64-windows -See )" + docs::triplets_url + R"( for more information.)"; +See )" + docs::triplets_url + R"( for more information. +)"; REQUIRE(maybe_check.error() == expected_error); } From c257a84c4dff1de37b493179131e5e8b76d9817c Mon Sep 17 00:00:00 2001 From: Javier Matos Denizac Date: Fri, 17 May 2024 15:33:49 +0000 Subject: [PATCH 07/12] Format and regenerate messages --- include/vcpkg/documentation.h | 48 ++++++++++++++++++++---------- locales/messages.json | 3 -- src/vcpkg-test/dependencies.cpp | 14 +++++---- src/vcpkg-test/manifests.cpp | 22 +++++++------- src/vcpkg-test/registries.cpp | 24 ++++++++------- src/vcpkg-test/specifier.cpp | 3 +- src/vcpkg/commands.add-version.cpp | 22 +++++++++----- src/vcpkg/commands.add.cpp | 9 ++++-- src/vcpkg/commands.find.cpp | 4 ++- src/vcpkg/commands.remove.cpp | 4 ++- 10 files changed, 94 insertions(+), 59 deletions(-) diff --git a/include/vcpkg/documentation.h b/include/vcpkg/documentation.h index c07e38c50d..7eb70d480e 100644 --- a/include/vcpkg/documentation.h +++ b/include/vcpkg/documentation.h @@ -6,23 +6,39 @@ namespace vcpkg { namespace docs { - static constexpr StringLiteral registries_url = "https://learn.microsoft.com/vcpkg/users/registries?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral manifests_url = "https://learn.microsoft.com/vcpkg/users/manifests?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral vcpkg_json_ref_name = "https://learn.microsoft.com/vcpkg/reference/vcpkg-json?WT.mc_id=vcpkg_inproduct_cli#name"; - static constexpr StringLiteral assetcaching_url = "https://learn.microsoft.com/vcpkg/users/assetcaching?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral binarycaching_url = "https://learn.microsoft.com/vcpkg/users/binarycaching?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral version_schemes = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli#version-schemes"; - static constexpr StringLiteral triplets_url = "https://learn.microsoft.com/vcpkg/users/triplets?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral registries_url = + "https://learn.microsoft.com/vcpkg/users/registries?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral manifests_url = + "https://learn.microsoft.com/vcpkg/users/manifests?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral vcpkg_json_ref_name = + "https://learn.microsoft.com/vcpkg/reference/vcpkg-json?WT.mc_id=vcpkg_inproduct_cli#name"; + static constexpr StringLiteral assetcaching_url = + "https://learn.microsoft.com/vcpkg/users/assetcaching?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral binarycaching_url = + "https://learn.microsoft.com/vcpkg/users/binarycaching?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral versioning_url = + "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral version_schemes = + "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli#version-schemes"; + static constexpr StringLiteral triplets_url = + "https://learn.microsoft.com/vcpkg/users/triplets?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral vcpkg_visual_studio_path_url = "https://learn.microsoft.com/vcpkg/users/triplets?WT.mc_id=vcpkg_inproduct_cli#VCPKG_VISUAL_STUDIO_PATH"; - inline constexpr StringLiteral package_name_url = "https://learn.microsoft.com/vcpkg/reference/vcpkg-json?WT.mc_id=vcpkg_inproduct_cli#name"; - static constexpr StringLiteral troubleshoot_build_failures_url = "https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral add_command_url = "https://learn.microsoft.com/vcpkg/commands/add?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral add_command_recurse_opt_url = "https://learn.microsoft.com/vcpkg/commands/remove?WT.mc_id=vcpkg_inproduct_cli#--recurse"; - static constexpr StringLiteral add_version_command_url = "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral add_version_command_overwrite_version_opt_url = "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--overwrite-version"; - static constexpr StringLiteral radd_version_command_all_opt_url = "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--all"; - static constexpr StringLiteral format_manifest_command_url = "https://learn.microsoft.com/vcpkg/commands/format-manifest?WT.mc_id=vcpkg_inproduct_cli"; + inline constexpr StringLiteral package_name_url = + "https://learn.microsoft.com/vcpkg/reference/vcpkg-json?WT.mc_id=vcpkg_inproduct_cli#name"; + static constexpr StringLiteral troubleshoot_build_failures_url = + "https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral add_command_url = + "https://learn.microsoft.com/vcpkg/commands/add?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral add_command_recurse_opt_url = + "https://learn.microsoft.com/vcpkg/commands/remove?WT.mc_id=vcpkg_inproduct_cli#--recurse"; + static constexpr StringLiteral add_version_command_url = + "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral add_version_command_overwrite_version_opt_url = + "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--overwrite-version"; + static constexpr StringLiteral radd_version_command_all_opt_url = + "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--all"; + static constexpr StringLiteral format_manifest_command_url = + "https://learn.microsoft.com/vcpkg/commands/format-manifest?WT.mc_id=vcpkg_inproduct_cli"; } } diff --git a/locales/messages.json b/locales/messages.json index 0d82c56f8a..db11125fef 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -48,8 +48,6 @@ "AddArtifactOnlyOne": "'{command_line}' can only add one artifact at a time.", "_AddArtifactOnlyOne.comment": "An example of {command_line} is vcpkg install zlib.", "AddCommandFirstArg": "The first parameter to add must be 'artifact' or 'port'.", - "AddFirstArgument": "The first argument to '{command_line}' must be 'artifact' or 'port'.", - "_AddFirstArgument.comment": "An example of {command_line} is vcpkg install zlib.", "AddPortRequiresManifest": "'{command_line}' requires an active manifest file.", "_AddPortRequiresManifest.comment": "An example of {command_line} is vcpkg install zlib.", "AddPortSucceeded": "Succeeded in adding ports to vcpkg.json file.", @@ -61,7 +59,6 @@ "AddVersionArtifactsOnly": "--version is artifacts only and can't be used with vcpkg add port", "_AddVersionArtifactsOnly.comment": "'--version', and 'vcpkg add port' are command lines that must not be localized", "AddVersionCommitChangesReminder": "Did you remember to commit your changes?", - "AddVersionCommitResultReminder": "Don't forget to commit the result!", "AddVersionDetectLocalChangesError": "skipping detection of local changes due to unexpected format in git status output", "AddVersionFileNotFound": "couldn't find required file {path}", "_AddVersionFileNotFound.comment": "An example of {path} is /foo/bar.", diff --git a/src/vcpkg-test/dependencies.cpp b/src/vcpkg-test/dependencies.cpp index f734afa65d..0522ebc563 100644 --- a/src/vcpkg-test/dependencies.cpp +++ b/src/vcpkg-test/dependencies.cpp @@ -3,8 +3,8 @@ #include #include -#include #include +#include #include #include #include @@ -479,7 +479,8 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "2with\"quotes" } ] -See `vcpkg help versioning` or )"+ docs::versioning_url + R"( for more information.)"); +See `vcpkg help versioning` or )" + + docs::versioning_url + R"( for more information.)"); } TEST_CASE ("version install string port version", "[versionplan]") @@ -1118,7 +1119,8 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "1.0.0" } ] -See `vcpkg help versioning` or )" + docs::versioning_url + R"( for more information.)"); +See `vcpkg help versioning` or )" + + docs::versioning_url + R"( for more information.)"); } SECTION ("higher baseline") { @@ -1149,7 +1151,8 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "1.0.2" } ] -See `vcpkg help versioning` or )" + docs::versioning_url + R"( for more information.)"); +See `vcpkg help versioning` or )" + + docs::versioning_url + R"( for more information.)"); } } @@ -1242,7 +1245,8 @@ This can be resolved by adding an explicit override to the preferred version. Fo "version": "1" } ] -See `vcpkg help versioning` or )" + docs::versioning_url + R"( for more information.)"); +See `vcpkg help versioning` or )" + + docs::versioning_url + R"( for more information.)"); } SECTION ("lower baseline") { diff --git a/src/vcpkg-test/manifests.cpp b/src/vcpkg-test/manifests.cpp index 0e81db306c..b144968e52 100644 --- a/src/vcpkg-test/manifests.cpp +++ b/src/vcpkg-test/manifests.cpp @@ -1420,7 +1420,7 @@ TEST_CASE ("default-feature-empty errors", "[manifests]") REQUIRE(m_pgh.error().data() == ": error: $.default-features[0] (a feature name): \"\" is not a valid feature name. Feature " "names must be lowercase alphanumeric+hypens and not reserved (see " + - docs::manifests_url + " for more information)."); + docs::manifests_url + " for more information)."); } TEST_CASE ("default-feature-empty-object errors", "[manifests]") @@ -1432,8 +1432,8 @@ TEST_CASE ("default-feature-empty-object errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.default-features[0].name (a feature name): \"\" is not a valid feature name. " - "Feature names must be lowercase alphanumeric+hypens and not reserved (see " + - docs::manifests_url + " for more information)."); + "Feature names must be lowercase alphanumeric+hypens and not reserved (see " + + docs::manifests_url + " for more information)."); } TEST_CASE ("dependency-name-empty errors", "[manifests]") @@ -1445,8 +1445,8 @@ TEST_CASE ("dependency-name-empty errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0] (a package name): \"\" is not a valid package name. Package " - "names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + - " for more information)."); + "names must be lowercase alphanumeric+hypens and not reserved (see " + + docs::manifests_url + " for more information)."); } TEST_CASE ("dependency-name-empty-object errors", "[manifests]") @@ -1458,8 +1458,8 @@ TEST_CASE ("dependency-name-empty-object errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0].name (a package name): \"\" is not a valid package name. " - "Package names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + - " for more information)."); + "Package names must be lowercase alphanumeric+hypens and not reserved (see " + + docs::manifests_url + " for more information)."); } TEST_CASE ("dependency-feature-name-core errors", "[manifests]") @@ -1545,8 +1545,8 @@ TEST_CASE ("dependency-feature-name-empty errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0].features[0] (a feature name): \"\" is not a valid feature name. " - "Feature names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + - " for more information)."); + "Feature names must be lowercase alphanumeric+hypens and not reserved (see " + + docs::manifests_url + " for more information)."); } TEST_CASE ("dependency-feature-name-empty-object errors", "[manifests]") @@ -1563,6 +1563,6 @@ TEST_CASE ("dependency-feature-name-empty-object errors", "[manifests]") REQUIRE(!m_pgh.has_value()); REQUIRE(m_pgh.error().data() == ": error: $.dependencies[0].features[0].name (a feature name): \"\" is not a valid feature " - "name. Feature names must be lowercase alphanumeric+hypens and not reserved (see " + docs::manifests_url + - " for more information)."); + "name. Feature names must be lowercase alphanumeric+hypens and not reserved (see " + + docs::manifests_url + " for more information)."); } diff --git a/src/vcpkg-test/registries.cpp b/src/vcpkg-test/registries.cpp index ecb10fa790..d8052f45b3 100644 --- a/src/vcpkg-test/registries.cpp +++ b/src/vcpkg-test/registries.cpp @@ -3,8 +3,8 @@ #include #include -#include #include +#include #include using namespace vcpkg; @@ -422,16 +422,18 @@ TEST_CASE ("registries report pattern errors", "[registries]") REQUIRE(errors.size() == 3); CHECK(errors[0] == "test: error: $.registries[0].packages[1] (a package pattern): \"\" is not a valid package " "pattern. Package patterns must " - "use only one wildcard character (*) and it must be the last character in the pattern (see " + docs::registries_url + - " for more information)."); - CHECK(errors[1] == "test: error: $.registries[0].packages[2] (a package pattern): \"a*a\" is not a valid package " - "pattern. Package patterns " - "must use only one wildcard character (*) and it must be the last character in the pattern (see " + docs::registries_url + - " for more information)."); - CHECK(errors[2] == "test: error: $.registries[0].packages[3] (a package pattern): \"*a\" is not a valid package " - "pattern. Package patterns " - "must use only one wildcard character (*) and it must be the last character in the pattern (see " + docs::registries_url + - " for more information)."); + "use only one wildcard character (*) and it must be the last character in the pattern (see " + + docs::registries_url + " for more information)."); + CHECK(errors[1] == + "test: error: $.registries[0].packages[2] (a package pattern): \"a*a\" is not a valid package " + "pattern. Package patterns " + "must use only one wildcard character (*) and it must be the last character in the pattern (see " + + docs::registries_url + " for more information)."); + CHECK(errors[2] == + "test: error: $.registries[0].packages[3] (a package pattern): \"*a\" is not a valid package " + "pattern. Package patterns " + "must use only one wildcard character (*) and it must be the last character in the pattern (see " + + docs::registries_url + " for more information)."); } TEST_CASE ("registries ignored patterns warning", "[registries]") diff --git a/src/vcpkg-test/specifier.cpp b/src/vcpkg-test/specifier.cpp index 08488deae2..9eb9bce6df 100644 --- a/src/vcpkg-test/specifier.cpp +++ b/src/vcpkg-test/specifier.cpp @@ -119,7 +119,8 @@ TEST_CASE ("specifier parsing", "[specifier]") REQUIRE( s.error() == LocalizedString::from_raw( - R"(error: expected the end of input parsing a package name; this usually means the indicated character is not allowed to be in a port name. Port names are all lowercase alphanumeric+hypens and not reserved (see )" + docs::vcpkg_json_ref_name + R"( for more information). + R"(error: expected the end of input parsing a package name; this usually means the indicated character is not allowed to be in a port name. Port names are all lowercase alphanumeric+hypens and not reserved (see )" + + docs::vcpkg_json_ref_name + R"( for more information). on expression: zlib# ^)")); } diff --git a/src/vcpkg/commands.add-version.cpp b/src/vcpkg/commands.add-version.cpp index a75975d086..29b8c68d11 100644 --- a/src/vcpkg/commands.add-version.cpp +++ b/src/vcpkg/commands.add-version.cpp @@ -64,12 +64,18 @@ namespace if (DateVersion::try_parse(version.version.text)) { Checks::msg_exit_with_message( - VCPKG_LINE_INFO, msg::format(msgAddVersionSuggestVersionDate, msg::package_name = port_name).append_raw("\n").append(msgSeeURL, msg::url = docs::version_schemes)); + VCPKG_LINE_INFO, + msg::format(msgAddVersionSuggestVersionDate, msg::package_name = port_name) + .append_raw("\n") + .append(msgSeeURL, msg::url = docs::version_schemes)); } if (DotVersion::try_parse_relaxed(version.version.text)) { Checks::msg_exit_with_message( - VCPKG_LINE_INFO, msg::format(msgAddVersionSuggestVersionRelaxed, msg::package_name = port_name).append_raw("\n").append(msgSeeURL, msg::url = docs::version_schemes)); + VCPKG_LINE_INFO, + msg::format(msgAddVersionSuggestVersionRelaxed, msg::package_name = port_name) + .append_raw("\n") + .append(msgSeeURL, msg::url = docs::version_schemes)); } } } @@ -347,12 +353,12 @@ namespace vcpkg } else { - Checks::msg_check_exit(VCPKG_LINE_INFO, - add_all, - msg::format(msgAddVersionUseOptionAll, - msg::command_name = "x-add-version", - msg::option = SwitchAll).append_raw("\n").append(msgSeeURL, msg::url = docs::add_version_command_url)); - + Checks::msg_check_exit( + VCPKG_LINE_INFO, + add_all, + msg::format(msgAddVersionUseOptionAll, msg::command_name = "x-add-version", msg::option = SwitchAll) + .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.add.cpp b/src/vcpkg/commands.add.cpp index f0be78497d..a1530933fb 100644 --- a/src/vcpkg/commands.add.cpp +++ b/src/vcpkg/commands.add.cpp @@ -69,7 +69,10 @@ namespace vcpkg if (!manifest) { Checks::msg_exit_with_message( - VCPKG_LINE_INFO, msg::format(msgAddPortRequiresManifest, msg::command_line = "vcpkg add port").append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); + VCPKG_LINE_INFO, + msg::format(msgAddPortRequiresManifest, msg::command_line = "vcpkg add port") + .append_raw('\n') + .append(msgSeeURL, msg::url = docs::add_command_url)); } if (Util::Maps::contains(parsed.settings, SwitchVersion)) @@ -159,6 +162,8 @@ namespace vcpkg Checks::exit_success(VCPKG_LINE_INFO); } - Checks::msg_exit_with_message(VCPKG_LINE_INFO, msg::format(msgAddCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); + Checks::msg_exit_with_message( + VCPKG_LINE_INFO, + msg::format(msgAddCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); } } diff --git a/src/vcpkg/commands.find.cpp b/src/vcpkg/commands.find.cpp index 5cab25b4c6..1cc6f6ed3c 100644 --- a/src/vcpkg/commands.find.cpp +++ b/src/vcpkg/commands.find.cpp @@ -286,6 +286,8 @@ namespace vcpkg perform_find_port_and_exit(paths, full_description, enable_json, filter, paths.overlay_ports); } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgAddCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); + Checks::msg_exit_with_error( + VCPKG_LINE_INFO, + msg::format(msgAddCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); } } // namespace vcpkg diff --git a/src/vcpkg/commands.remove.cpp b/src/vcpkg/commands.remove.cpp index 4c9d5829f2..625776fb26 100644 --- a/src/vcpkg/commands.remove.cpp +++ b/src/vcpkg/commands.remove.cpp @@ -240,7 +240,9 @@ namespace vcpkg if (!is_recursive) { - msg::println_warning(msg::format(msgAddRecurseOption).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_recurse_opt_url)); + msg::println_warning(msg::format(msgAddRecurseOption) + .append_raw('\n') + .append(msgSeeURL, msg::url = docs::add_command_recurse_opt_url)); Checks::exit_fail(VCPKG_LINE_INFO); } } From 30e0d85a4745918bbf74a2695678de1616ca47e5 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 19 Jun 2024 13:56:47 -0400 Subject: [PATCH 08/12] fix find command link --- .vscode/settings.json | 3 ++- include/vcpkg/base/message-data.inc.h | 1 + src/vcpkg/commands.find.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f1da23c28e..60fa0d6111 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -98,6 +98,7 @@ "cinttypes": "cpp", "typeindex": "cpp", "typeinfo": "cpp", - "variant": "cpp" + "variant": "cpp", + "__bit_reference": "cpp" } } diff --git a/include/vcpkg/base/message-data.inc.h b/include/vcpkg/base/message-data.inc.h index 81207bf207..72d9aee9bc 100644 --- a/include/vcpkg/base/message-data.inc.h +++ b/include/vcpkg/base/message-data.inc.h @@ -1287,6 +1287,7 @@ DECLARE_MESSAGE(FileSeekFailed, "", "Failed to seek to position {byte_offset} in {path}.") DECLARE_MESSAGE(FilesExported, (msg::path), "", "Files exported at: {path}") +DECLARE_MESSAGE(FindCommandFirstArg, (), "'find', 'artifact', and 'port' are vcpkg specific terms and should not be translated.", "The first argument to 'find' must be 'artifact' or 'port' .") DECLARE_MESSAGE(FishCompletion, (msg::path), "", "vcpkg fish completion is already added at \"{path}\".") DECLARE_MESSAGE(FloatingPointConstTooBig, (msg::count), "", "Floating point constant too big: {count}") DECLARE_MESSAGE(FollowingPackagesMissingControl, diff --git a/src/vcpkg/commands.find.cpp b/src/vcpkg/commands.find.cpp index 1cc6f6ed3c..0799f72536 100644 --- a/src/vcpkg/commands.find.cpp +++ b/src/vcpkg/commands.find.cpp @@ -288,6 +288,6 @@ namespace vcpkg Checks::msg_exit_with_error( VCPKG_LINE_INFO, - msg::format(msgAddCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); + msg::format(msgFindCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); } } // namespace vcpkg From 1c8cb460f3d38cddf659f46d206e8ea46dee6dba Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 19 Jun 2024 15:30:32 -0400 Subject: [PATCH 09/12] add some links to troubleshoot guide --- include/vcpkg/documentation.h | 4 ++++ src/vcpkg/binarycaching.cpp | 12 ++++++------ src/vcpkg/dependencies.cpp | 2 +- src/vcpkg/registries.cpp | 1 + src/vcpkg/vcpkgpaths.cpp | 9 +++++---- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/include/vcpkg/documentation.h b/include/vcpkg/documentation.h index 7eb70d480e..bc23d4686f 100644 --- a/include/vcpkg/documentation.h +++ b/include/vcpkg/documentation.h @@ -16,6 +16,8 @@ namespace vcpkg "https://learn.microsoft.com/vcpkg/users/assetcaching?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral binarycaching_url = "https://learn.microsoft.com/vcpkg/users/binarycaching?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral binarycaching_gha_url = + "https://learn.microsoft.com/vcpkg/users/binarycaching?WT.mc_id=vcpkg_inproduct_cli#gha"; static constexpr StringLiteral versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning?WT.mc_id=vcpkg_inproduct_cli"; static constexpr StringLiteral version_schemes = @@ -40,5 +42,7 @@ namespace vcpkg "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--all"; static constexpr StringLiteral format_manifest_command_url = "https://learn.microsoft.com/vcpkg/commands/format-manifest?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral troubleshoot_binary_cache_url = "https://learn.microsoft.com/vcpkg/users/binarycaching-troubleshooting?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral troubleshoot_versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning-troubleshooting?WT.mc_id=vcpkg_inproduct_cli"; } } diff --git a/src/vcpkg/binarycaching.cpp b/src/vcpkg/binarycaching.cpp index ab1b2b2420..b1965e595d 100644 --- a/src/vcpkg/binarycaching.cpp +++ b/src/vcpkg/binarycaching.cpp @@ -592,7 +592,7 @@ namespace msg_sink.println(Color::warning, msgFailedVendorAuthentication, msg::vendor = "NuGet", - msg::url = docs::binarycaching_url); + msg::url = docs::troubleshoot_binary_cache_url); } else if (res.output.find("for example \"-ApiKey AzureDevOps\"") != std::string::npos) { @@ -751,7 +751,7 @@ namespace if (!m_cmd.push(msg_sink, nupkg_path, nuget_sources_arg({&write_src, 1}))) { msg_sink.println( - Color::error, msgPushingVendorFailed, msg::vendor = "NuGet", msg::path = write_src); + Color::error, msg::format(msgPushingVendorFailed, msg::vendor = "NuGet", msg::path = write_src).append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); } else { @@ -767,7 +767,7 @@ namespace if (!m_cmd.push(msg_sink, nupkg_path, nuget_configfile_arg(write_cfg))) { msg_sink.println( - Color::error, msgPushingVendorFailed, msg::vendor = "NuGet config", msg::path = write_cfg); + Color::error, msg::format(msgPushingVendorFailed, msg::vendor = "NuGet config", msg::path = write_cfg).append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); } else { @@ -1055,7 +1055,7 @@ namespace else { msg_sink.println_warning(res.error()); - } + } } return upload_count; } @@ -1911,9 +1911,9 @@ namespace vcpkg { if (!args.actions_cache_url.has_value() || !args.actions_runtime_token.has_value()) return msg::format_error(msgGHAParametersMissing, - msg::url = "https://learn.microsoft.com/vcpkg/users/binarycaching#gha"); + msg::url = docs::binarycaching_gha_url); } - + if (!s.archives_to_read.empty() || !s.url_templates_to_get.empty() || !s.gcs_read_prefixes.empty() || !s.aws_read_prefixes.empty() || !s.cos_read_prefixes.empty() || s.gha_read) { diff --git a/src/vcpkg/dependencies.cpp b/src/vcpkg/dependencies.cpp index add2b6d182..ed5dc92f2e 100644 --- a/src/vcpkg/dependencies.cpp +++ b/src/vcpkg/dependencies.cpp @@ -1777,7 +1777,7 @@ namespace vcpkg serialize_dependency_override(example_array, DependencyOverride{on.name(), baseline.version}); doc.append_raw(Json::stringify_object_member(OVERRIDES, example_array, Json::JsonStyle::with_spaces(2), 1)); - doc.append(msgVersionIncomparable4, msg::url = docs::versioning_url); + doc.append(msgVersionIncomparable4, msg::url = docs::troubleshoot_versioning_url); return doc; } diff --git a/src/vcpkg/registries.cpp b/src/vcpkg/registries.cpp index 2ab0267639..3a53b3a6a3 100644 --- a/src/vcpkg/registries.cpp +++ b/src/vcpkg/registries.cpp @@ -1098,6 +1098,7 @@ namespace } error_msg.append(msgVersionIncomparable4, msg::url = docs::versioning_url); + 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 7d48e87932..67b25baeb0 100644 --- a/src/vcpkg/vcpkgpaths.cpp +++ b/src/vcpkg/vcpkgpaths.cpp @@ -792,7 +792,7 @@ namespace vcpkg return *i; } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msgVcpkgDisallowedClassicMode); + Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode).append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } const Path& VcpkgPaths::buildtrees() const @@ -802,7 +802,7 @@ namespace vcpkg return *i; } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msgVcpkgDisallowedClassicMode); + Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode).append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } const Path& VcpkgPaths::packages() const @@ -812,7 +812,7 @@ namespace vcpkg return *i; } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msgVcpkgDisallowedClassicMode); + Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode).append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } Path VcpkgPaths::baselines_output() const { return buildtrees() / "versioning_" / "baselines"; } @@ -1202,7 +1202,8 @@ namespace vcpkg msg::path = git_config.git_dir); } - error.append_raw('\n').append(std::move(maybe_git_read_tree_output).error()); + error.append_raw('\n').append(std::move(maybe_git_read_tree_output).error()); + error.append(msgSeeURL, msg::url = docs::troubleshoot_versioning_url); return error; } From b634bf9ddd675c3749e3bcd4433194366734b7fc Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 19 Jun 2024 15:55:20 -0400 Subject: [PATCH 10/12] fix unit test --- src/vcpkg-test/dependencies.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vcpkg-test/dependencies.cpp b/src/vcpkg-test/dependencies.cpp index 0522ebc563..4a5e3457e1 100644 --- a/src/vcpkg-test/dependencies.cpp +++ b/src/vcpkg-test/dependencies.cpp @@ -480,7 +480,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo } ] See `vcpkg help versioning` or )" + - docs::versioning_url + R"( for more information.)"); + docs::troubleshoot_versioning_url + R"( for more information.)"); } TEST_CASE ("version install string port version", "[versionplan]") @@ -1120,7 +1120,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo } ] See `vcpkg help versioning` or )" + - docs::versioning_url + R"( for more information.)"); + docs::troubleshoot_versioning_url + R"( for more information.)"); } SECTION ("higher baseline") { @@ -1152,7 +1152,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo } ] See `vcpkg help versioning` or )" + - docs::versioning_url + R"( for more information.)"); + docs::troubleshoot_versioning_url + R"( for more information.)"); } } @@ -1246,7 +1246,7 @@ This can be resolved by adding an explicit override to the preferred version. Fo } ] See `vcpkg help versioning` or )" + - docs::versioning_url + R"( for more information.)"); + docs::troubleshoot_versioning_url + R"( for more information.)"); } SECTION ("lower baseline") { From 0c938bf47a765610d6ac35dad53b9670c067cf81 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 19 Jun 2024 17:35:25 -0400 Subject: [PATCH 11/12] generate message --- locales/messages.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locales/messages.json b/locales/messages.json index db11125fef..4a1fe2a39a 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -787,6 +787,8 @@ "FilesContainAbsolutePath2": "Absolute paths were found in the following files:", "FilesExported": "Files exported at: {path}", "_FilesExported.comment": "An example of {path} is /foo/bar.", + "FindCommandFirstArg": "The first argument to 'find' must be 'artifact' or 'port' .", + "_FindCommandFirstArg.comment": "'find', 'artifact', and 'port' are vcpkg specific terms and should not be translated.", "FindVersionArtifactsOnly": "--version can't be used with vcpkg search or vcpkg find port", "_FindVersionArtifactsOnly.comment": "'--version', 'vcpkg search', and 'vcpkg find port' are command lines that must not be localized", "FishCompletion": "vcpkg fish completion is already added at \"{path}\".", From 1b00a4d9a871cb41ddf1f4c201716b6f84588486 Mon Sep 17 00:00:00 2001 From: Javier Matos Denizac Date: Wed, 19 Jun 2024 21:54:22 +0000 Subject: [PATCH 12/12] Format and regenerate messages --- include/vcpkg/base/message-data.inc.h | 5 ++++- include/vcpkg/documentation.h | 6 ++++-- locales/messages.json | 4 ++-- src/vcpkg/binarycaching.cpp | 16 +++++++++------- src/vcpkg/commands.find.cpp | 2 +- src/vcpkg/vcpkgpaths.cpp | 14 ++++++++++---- 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/include/vcpkg/base/message-data.inc.h b/include/vcpkg/base/message-data.inc.h index 46e99b193a..9c8b127e8f 100644 --- a/include/vcpkg/base/message-data.inc.h +++ b/include/vcpkg/base/message-data.inc.h @@ -1321,7 +1321,10 @@ DECLARE_MESSAGE(FileSeekFailed, "", "Failed to seek to position {byte_offset} in {path}.") DECLARE_MESSAGE(FilesExported, (msg::path), "", "Files exported at: {path}") -DECLARE_MESSAGE(FindCommandFirstArg, (), "'find', 'artifact', and 'port' are vcpkg specific terms and should not be translated.", "The first argument to 'find' must be 'artifact' or 'port' .") +DECLARE_MESSAGE(FindCommandFirstArg, + (), + "'find', 'artifact', and 'port' are vcpkg specific terms and should not be translated.", + "The first argument to 'find' must be 'artifact' or 'port' .") DECLARE_MESSAGE(FishCompletion, (msg::path), "", "vcpkg fish completion is already added at \"{path}\".") DECLARE_MESSAGE(FloatingPointConstTooBig, (msg::count), "", "Floating point constant too big: {count}") DECLARE_MESSAGE(FollowingPackagesMissingControl, diff --git a/include/vcpkg/documentation.h b/include/vcpkg/documentation.h index bc23d4686f..3b174f9768 100644 --- a/include/vcpkg/documentation.h +++ b/include/vcpkg/documentation.h @@ -42,7 +42,9 @@ namespace vcpkg "https://learn.microsoft.com/vcpkg/commands/add-version?WT.mc_id=vcpkg_inproduct_cli#--all"; static constexpr StringLiteral format_manifest_command_url = "https://learn.microsoft.com/vcpkg/commands/format-manifest?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral troubleshoot_binary_cache_url = "https://learn.microsoft.com/vcpkg/users/binarycaching-troubleshooting?WT.mc_id=vcpkg_inproduct_cli"; - static constexpr StringLiteral troubleshoot_versioning_url = "https://learn.microsoft.com/vcpkg/users/versioning-troubleshooting?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral troubleshoot_binary_cache_url = + "https://learn.microsoft.com/vcpkg/users/binarycaching-troubleshooting?WT.mc_id=vcpkg_inproduct_cli"; + static constexpr StringLiteral troubleshoot_versioning_url = + "https://learn.microsoft.com/vcpkg/users/versioning-troubleshooting?WT.mc_id=vcpkg_inproduct_cli"; } } diff --git a/locales/messages.json b/locales/messages.json index afb5a06292..85fa2885e2 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -792,10 +792,10 @@ "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.", - "FindCommandFirstArg": "The first argument to 'find' must be 'artifact' or 'port' .", - "_FindCommandFirstArg.comment": "'find', 'artifact', and 'port' are vcpkg specific terms and should not be translated.", "FilesRelativeToTheBuildDirectoryHere": "the files are relative to the build directory here", "FilesRelativeToThePackageDirectoryHere": "the files are relative to ${{CURRENT_PACKAGES_DIR}} here", + "FindCommandFirstArg": "The first argument to 'find' must be 'artifact' or 'port' .", + "_FindCommandFirstArg.comment": "'find', 'artifact', and 'port' are vcpkg specific terms and should not be translated.", "FindVersionArtifactsOnly": "--version can't be used with vcpkg search or vcpkg find port", "_FindVersionArtifactsOnly.comment": "'--version', 'vcpkg search', and 'vcpkg find port' are command lines that must not be localized", "FishCompletion": "vcpkg fish completion is already added at \"{path}\".", diff --git a/src/vcpkg/binarycaching.cpp b/src/vcpkg/binarycaching.cpp index 743166eaaa..d4f78af37e 100644 --- a/src/vcpkg/binarycaching.cpp +++ b/src/vcpkg/binarycaching.cpp @@ -750,8 +750,9 @@ namespace msgUploadingBinariesToVendor, msg::spec = spec, msg::vendor = "NuGet", msg::path = write_src); if (!m_cmd.push(msg_sink, nupkg_path, nuget_sources_arg({&write_src, 1}))) { - msg_sink.println( - Color::error, msg::format(msgPushingVendorFailed, msg::vendor = "NuGet", msg::path = write_src).append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); + msg_sink.println(Color::error, + msg::format(msgPushingVendorFailed, msg::vendor = "NuGet", msg::path = write_src) + .append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); } else { @@ -767,7 +768,9 @@ namespace if (!m_cmd.push(msg_sink, nupkg_path, nuget_configfile_arg(write_cfg))) { msg_sink.println( - Color::error, msg::format(msgPushingVendorFailed, msg::vendor = "NuGet config", msg::path = write_cfg).append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); + Color::error, + msg::format(msgPushingVendorFailed, msg::vendor = "NuGet config", msg::path = write_cfg) + .append(msgSeeURL, msg::url = docs::troubleshoot_binary_cache_url)); } else { @@ -1082,7 +1085,7 @@ namespace else { msg_sink.println_warning(res.error()); - } + } } return upload_count; } @@ -1972,10 +1975,9 @@ namespace vcpkg if (s.gha_read || s.gha_write) { if (!args.actions_cache_url.has_value() || !args.actions_runtime_token.has_value()) - return msg::format_error(msgGHAParametersMissing, - msg::url = docs::binarycaching_gha_url); + return msg::format_error(msgGHAParametersMissing, msg::url = docs::binarycaching_gha_url); } - + if (!s.archives_to_read.empty() || !s.url_templates_to_get.empty() || !s.gcs_read_prefixes.empty() || !s.aws_read_prefixes.empty() || !s.cos_read_prefixes.empty() || s.gha_read) { diff --git a/src/vcpkg/commands.find.cpp b/src/vcpkg/commands.find.cpp index 0799f72536..e6a15328b2 100644 --- a/src/vcpkg/commands.find.cpp +++ b/src/vcpkg/commands.find.cpp @@ -288,6 +288,6 @@ namespace vcpkg Checks::msg_exit_with_error( VCPKG_LINE_INFO, - msg::format(msgFindCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); + msg::format(msgFindCommandFirstArg).append_raw('\n').append(msgSeeURL, msg::url = docs::add_command_url)); } } // namespace vcpkg diff --git a/src/vcpkg/vcpkgpaths.cpp b/src/vcpkg/vcpkgpaths.cpp index 67b25baeb0..9e3af072a6 100644 --- a/src/vcpkg/vcpkgpaths.cpp +++ b/src/vcpkg/vcpkgpaths.cpp @@ -792,7 +792,9 @@ namespace vcpkg return *i; } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode).append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); + Checks::msg_exit_with_error(VCPKG_LINE_INFO, + msg::format(msgVcpkgDisallowedClassicMode) + .append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } const Path& VcpkgPaths::buildtrees() const @@ -802,7 +804,9 @@ namespace vcpkg return *i; } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode).append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); + Checks::msg_exit_with_error(VCPKG_LINE_INFO, + msg::format(msgVcpkgDisallowedClassicMode) + .append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } const Path& VcpkgPaths::packages() const @@ -812,7 +816,9 @@ namespace vcpkg return *i; } - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msg::format(msgVcpkgDisallowedClassicMode).append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); + Checks::msg_exit_with_error(VCPKG_LINE_INFO, + msg::format(msgVcpkgDisallowedClassicMode) + .append(msgSeeURL, msg::url = docs::troubleshoot_build_failures_url)); } Path VcpkgPaths::baselines_output() const { return buildtrees() / "versioning_" / "baselines"; } @@ -1202,7 +1208,7 @@ namespace vcpkg msg::path = git_config.git_dir); } - error.append_raw('\n').append(std::move(maybe_git_read_tree_output).error()); + error.append_raw('\n').append(std::move(maybe_git_read_tree_output).error()); error.append(msgSeeURL, msg::url = docs::troubleshoot_versioning_url); return error; }