From 0c70a0e64b30f39f7605f1dd6dd5ba644a7c70c2 Mon Sep 17 00:00:00 2001 From: Javier Matos Denizac Date: Thu, 7 Jul 2022 13:38:15 -0700 Subject: [PATCH] Localization redesign (#615) * - Localization of strings in binarycaching.cpp - Sorted Declared/Registered messages in alphabetical order. * - Response to PR comments. Removed HelpTableFormat message. The HelpTableFormatter needs to be updated to require LocalizedString as input. I intend to do this work in a separate PR. * Removed repetitive message * Update locales/messages.en.json Co-authored-by: Victor Romero * Update src/vcpkg/binarycaching.cpp Co-authored-by: Victor Romero * Update src/vcpkg/binarycaching.cpp Co-authored-by: Victor Romero * Update src/vcpkg/binarycaching.cpp Co-authored-by: Victor Romero * Update src/vcpkg/binarycaching.cpp Co-authored-by: Victor Romero * Update src/vcpkg/binarycaching.cpp Co-authored-by: Victor Romero * Moving declared messages to messages.h and registering in messages.cpp. * Add message to ReplaceSecretsError * Moved localized messages from commands.generate-messages.cpp to messages.h/cpp * Moved localized messages from commands.update-baseline.cpp to messages.h/cpp * Moved localized messsages from commands.version.cpp to messages.h/cpp * Moved localized messages from configuration.cpp to messages.h/cpp * Moved localized messages from configure-environment.cpp to messages.h/cpp * Moved localized messages from dependencies.cpp and install.cpp to message.h/cpp * Moved localized messages from paragraphs.cpp and sourceparagraph.cpp to messages.h/cpp * Moved localized messages from versions.versions.cpp, visualstudio.cpp, and vcpkg.cpp to messages.h/cpp * Moved localized messages from files.cpp, git.cpp, hash.cpp, vcpkgpaths.cpp, checks.cpp, and downloads.cpp to messages.h/cpp * Moved localized messages from system.cpp, strings.cpp, system.process.cpp, cmakevars.cpp, commands.ci.cpp, install.cpp, packagespec.cpp, portfileprovider.cpp, registries.cpp, tools.cpp, and main.cpp to messages.h/cpp * Sort registered messages * Sorted declared messages. * Grammar fixes * Update documentation * Moved localized messages from binarycaching.cpp to messages.h/cpp * Sort message declarations * Sort messages * Typo Fix * update json * resolve conflict * Add missing namespace * Remove DECLARE_AND_REGISTER_MESSAGE since it will no longer be used. * - Added DECLARE_AND_REGISTER_MESSAGE - Fuzz help messages need to be unlocalized. This change will occur in another print - Moved localized messages from messages.h/cpp to main.cpp - Messages need to be unlocalized. Co-authored-by: Javier Matos Co-authored-by: Victor Romero --- docs/localization.md | 17 +- include/vcpkg/base/messages.h | 815 +++++++++++++++++++- locales/messages.en.json | 7 +- locales/messages.json | 8 +- src/vcpkg-fuzz/main.cpp | 17 +- src/vcpkg.cpp | 20 - src/vcpkg/archives.cpp | 14 - src/vcpkg/base/checks.cpp | 8 - src/vcpkg/base/downloads.cpp | 22 - src/vcpkg/base/files.cpp | 5 - src/vcpkg/base/git.cpp | 10 - src/vcpkg/base/hash.cpp | 6 - src/vcpkg/base/json.cpp | 11 - src/vcpkg/base/messages.cpp | 241 +++++- src/vcpkg/base/parse.cpp | 18 - src/vcpkg/base/strings.cpp | 8 - src/vcpkg/base/system.cpp | 20 - src/vcpkg/base/system.process.cpp | 13 - src/vcpkg/binarycaching.cpp | 135 ---- src/vcpkg/build.cpp | 173 ----- src/vcpkg/ci-baseline.cpp | 27 - src/vcpkg/cmakevars.cpp | 7 - src/vcpkg/commands.add-version.cpp | 87 --- src/vcpkg/commands.add.cpp | 21 - src/vcpkg/commands.ci.cpp | 12 - src/vcpkg/commands.edit.cpp | 41 +- src/vcpkg/commands.generate-message-map.cpp | 52 -- src/vcpkg/commands.update-baseline.cpp | 30 - src/vcpkg/commands.version.cpp | 7 - src/vcpkg/configuration.cpp | 9 - src/vcpkg/configure-environment.cpp | 14 - src/vcpkg/dependencies.cpp | 6 - src/vcpkg/install.cpp | 64 -- src/vcpkg/packagespec.cpp | 3 - src/vcpkg/paragraphs.cpp | 22 - src/vcpkg/portfileprovider.cpp | 7 - src/vcpkg/registries.cpp | 17 - src/vcpkg/sourceparagraph.cpp | 81 -- src/vcpkg/tools.cpp | 48 -- src/vcpkg/vcpkgpaths.cpp | 34 - src/vcpkg/versions.cpp | 23 - src/vcpkg/visualstudio.cpp | 12 - 42 files changed, 1089 insertions(+), 1103 deletions(-) diff --git a/docs/localization.md b/docs/localization.md index c1a044147..5bfdb00a2 100644 --- a/docs/localization.md +++ b/docs/localization.md @@ -8,13 +8,14 @@ and `locales/messages.json` -- everything else will be generated and modified by ## Declaring a Message The process of writing a user-visible message starts with declaring it. -Most user-facing messages can be declared and registered at the same time in a source file with: +Most user-facing messages can be declared in [`messages.h`] and registered in [`messages.cpp`]: -```cxx -DECLARE_AND_REGISTER_MESSAGE(, , , ); +```messages.h +DECLARE_MESSAGE(, , , ); +``` +```messages.cpp +REGISTER_MESSAGE(); ``` - -for example, in [`sourceparagraph.cpp`]. If you need to declare a message in a header file (for example, if a templated function uses it), @@ -104,11 +105,11 @@ namespace }; // note that we add additional context in the comment here - DECLARE_AND_REGISTER_MESSAGE(World, (), "We will say hello to 'world' if no name is given", "world"); + DECLARE_MESSAGE(World, (), "We will say hello to 'world' if no name is given", "world"); // here, `{value}` is a placeholder that doesn't have example text, so we need to give it ourselves - DECLARE_AND_REGISTER_MESSAGE(Hello, (msg::value), "example for {value} is 'world'", "Hello, {value}!"); + DECLARE_MESSAGE(Hello, (msg::value), "example for {value} is 'world'", "Hello, {value}!"); // here, `{triplet}` _already has_ example text, so it's fine to not give a comment - DECLARE_AND_REGISTER_MESSAGE(MyTripletIs, (msg::triplet), "", "My triplet is {triplet}."); + DECLARE_MESSAGE(MyTripletIs, (msg::triplet), "", "My triplet is {triplet}."); } namespace vcpkg::Commands diff --git a/include/vcpkg/base/messages.h b/include/vcpkg/base/messages.h index 97fd701b1..b046fc8ec 100644 --- a/include/vcpkg/base/messages.h +++ b/include/vcpkg/base/messages.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include @@ -290,11 +290,13 @@ namespace vcpkg::msg static constexpr ::vcpkg::StringLiteral default_format_string = __VA_ARGS__; \ static const ::size_t index; \ } msg##NAME VCPKG_UNUSED = {} + #define REGISTER_MESSAGE(NAME) \ const ::size_t NAME##_msg_t::index = ::vcpkg::msg::detail::startup_register_message( \ NAME##_msg_t::name, \ NAME##_msg_t::default_format_string, \ ::vcpkg::msg::detail::get_examples_for_args(NAME##_msg_t::extra_comment, NAME##_msg_t{})) + #define DECLARE_AND_REGISTER_MESSAGE(NAME, ARGS, COMMENT, ...) \ DECLARE_MESSAGE(NAME, ARGS, COMMENT, __VA_ARGS__); \ REGISTER_MESSAGE(NAME) @@ -398,4 +400,815 @@ namespace vcpkg extern MessageSink& null_sink; extern MessageSink& stdout_sink; extern MessageSink& stderr_sink; + + DECLARE_MESSAGE(AddArtifactOnlyOne, + (msg::command_line), + "", + "'{command_line}' can only add one artifact at a time."); + DECLARE_MESSAGE(AddFirstArgument, + (msg::command_line), + "", + "The first argument to '{command_line}' must be 'artifact' or 'port'."); + DECLARE_MESSAGE(AddPortRequiresManifest, + (msg::command_line), + "", + "'{command_line}' requires an active manifest file."); + DECLARE_MESSAGE(AddPortSucceded, (), "", "Succeeded in adding ports to vcpkg.json file."); + DECLARE_MESSAGE(AddTripletExpressionNotAllowed, + (msg::package_name, msg::triplet), + "", + "triplet expressions are not allowed here. You may want to change " + "`{package_name}:{triplet}` to `{package_name}` instead."); + 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, + (), + "", + "skipping detection of local changes due to unexpected format in git status output"); + DECLARE_MESSAGE(AddVersionFileNotFound, (msg::path), "", "couldn't find required file {path}"); + DECLARE_MESSAGE(AddVersionFormatPortSuggestion, (msg::command_line), "", "Run `{command_line}` to format the file"); + DECLARE_MESSAGE(AddVersionIgnoringOptionAll, + (msg::option), + "The -- before {option} must be preserved as they're part of the help message for the user.", + "ignoring --{option} since a port name argument was provided"); + DECLARE_MESSAGE(AddVersionLoadPortFailed, (msg::package_name), "", "can't load port {package_name}"); + DECLARE_MESSAGE(AddVersionNewFile, (), "", "(new file)"); + DECLARE_MESSAGE(AddVersionNewShaIs, (msg::value), "{value} is a 40-digit hexadecimal SHA", "new SHA: {value}"); + DECLARE_MESSAGE(AddVersionNoFilesUpdated, (), "", "No files were updated"); + DECLARE_MESSAGE(AddVersionNoFilesUpdatedForPort, + (msg::package_name), + "", + "No files were updated for {package_name}"); + DECLARE_MESSAGE(AddVersionNoGitSha, (msg::package_name), "", "can't obtain SHA for port {package_name}"); + DECLARE_MESSAGE(AddVersionOldShaIs, (msg::value), "{value} is a 40-digit hexadecimal SHA", "old SHA: {value}"); + DECLARE_MESSAGE(AddVersionOverwriteOptionSuggestion, + (msg::option), + "The -- before {option} must be preserved as they're part of the help message for the user.", + "Use --{option} to bypass this check"); + DECLARE_MESSAGE(AddVersionPortDoesNotExist, (msg::package_name), "", "{package_name} does not exist"); + DECLARE_MESSAGE(AddVersionPortFilesShaChanged, + (msg::package_name), + "", + "checked-in files for {package_name} have changed but the version was not updated"); + DECLARE_MESSAGE(AddVersionPortFilesShaUnchanged, + (msg::package_name, msg::version), + "", + "checked-in files for {package_name} are unchanged from version {version}"); + DECLARE_MESSAGE(AddVersionPortHasImproperFormat, + (msg::package_name), + "", + "{package_name} is not properly formatted"); + DECLARE_MESSAGE(AddVersionSuggestNewVersionScheme, + (msg::new_scheme, msg::old_scheme, msg::package_name, msg::option), + "The -- before {option} must be preserved as they're part of the help message for the user.", + "Use the version scheme \"{new_scheme}\" instead of \"{old_scheme}\" in port " + "\"{package_name}\".\nUse --{option} to disable this check."); + DECLARE_MESSAGE(AddVersionUnableToParseVersionsFile, (msg::path), "", "unable to parse versions file {path}"); + DECLARE_MESSAGE(AddVersionUncommittedChanges, + (msg::package_name), + "", + "there are uncommitted changes for {package_name}"); + DECLARE_MESSAGE(AddVersionUpdateVersionReminder, (), "", "Did you remember to update the version or port version?"); + DECLARE_MESSAGE(AddVersionUseOptionAll, + (msg::command_name, msg::option), + "The -- before {option} must be preserved as they're part of the help message for the user.", + "{command_name} with no arguments requires passing --{option} to update all port versions at once"); + DECLARE_MESSAGE(AddVersionVersionAlreadyInFile, + (msg::version, msg::path), + "", + "version {version} is already in {path}"); + DECLARE_MESSAGE(AddVersionVersionIs, (msg::version), "", "version: {version}"); + DECLARE_MESSAGE(AllFormatArgsRawArgument, + (msg::value), + "example of {value} is 'foo {} bar'", + "format string \"{value}\" contains a raw format argument"); + DECLARE_MESSAGE(AllFormatArgsUnbalancedBraces, + (msg::value), + "example of {value} is 'foo bar {'", + "unbalanced brace in format string \"{value}\""); + DECLARE_MESSAGE(AlreadyInstalled, (msg::spec), "", "{spec} is already installed"); + DECLARE_MESSAGE(AlreadyInstalledNotHead, + (msg::spec), + "'HEAD' means the most recent version of source code", + "{spec} is already installed -- not building from HEAD"); + DECLARE_MESSAGE(AnotherInstallationInProgress, + (), + "", + "Another installation is in progress on the machine, sleeping 6s before retrying."); + DECLARE_MESSAGE(AttemptingToFetchPackagesFromVendor, + (msg::count, msg::vendor), + "", + "Attempting to fetch {count} package(s) from {vendor}"); + DECLARE_MESSAGE(AuthenticationMayRequireManualAction, + (msg::vendor), + "", + "One or more {vendor} credential providers requested manual action. Add the binary source " + "'interactive' to allow interactivity."); + DECLARE_MESSAGE(AutoSettingEnvVar, + (msg::env_var, msg::url), + "An example of env_var is \"HTTP(S)_PROXY\"" + "'--' at the beginning must be preserved", + "-- Automatically setting {env_var} environment variables to \"{url}\"."); + DECLARE_MESSAGE(BuildAlreadyInstalled, + (msg::spec), + "", + "{spec} is already installed; please remove {spec} before attempting to build it."); + DECLARE_MESSAGE(BuildDependenciesMissing, + (), + "", + "The build command requires all dependencies to be already installed.\nThe following " + "dependencies are missing:"); + DECLARE_MESSAGE(BuildingFromHead, + (msg::spec), + "'HEAD' means the most recent version of source code", + "Building {spec} from HEAD..."); + DECLARE_MESSAGE(BuildingPackage, (msg::spec), "", "Building {spec}..."); + DECLARE_MESSAGE(BuildingPackageFailed, + (msg::spec, msg::build_result), + "", + "building {spec} failed with: {build_result}"); + DECLARE_MESSAGE(BuildingPackageFailedDueToMissingDeps, + (), + "Printed after BuildingPackageFailed, and followed by a list of dependencies that were missing.", + "due to the following missing dependencies:"); + DECLARE_MESSAGE(BuildResultBuildFailed, + (), + "Printed after the name of an installed entity to indicate that it failed to build.", + "BUILD_FAILED"); + DECLARE_MESSAGE( + BuildResultCacheMissing, + (), + "Printed after the name of an installed entity to indicate that it was not present in the binary cache when " + "the user has requested that things may only be installed from the cache rather than built.", + "CACHE_MISSING"); + DECLARE_MESSAGE(BuildResultCascadeDueToMissingDependencies, + (), + "Printed after the name of an installed entity to indicate that it could not attempt " + "to be installed because one of its transitive dependencies failed to install.", + "CASCADED_DUE_TO_MISSING_DEPENDENCIES"); + DECLARE_MESSAGE(BuildResultDownloaded, + (), + "Printed after the name of an installed entity to indicate that it was successfully " + "downloaded but no build or install was requested.", + "DOWNLOADED"); + DECLARE_MESSAGE(BuildResultExcluded, + (), + "Printed after the name of an installed entity to indicate that the user explicitly " + "requested it not be installed.", + "EXCLUDED"); + DECLARE_MESSAGE( + BuildResultFileConflicts, + (), + "Printed after the name of an installed entity to indicate that it conflicts with something already installed", + "FILE_CONFLICTS"); + DECLARE_MESSAGE(BuildResultPostBuildChecksFailed, + (), + "Printed after the name of an installed entity to indicate that it built " + "successfully, but that it failed post build checks.", + "POST_BUILD_CHECKS_FAILED"); + DECLARE_MESSAGE(BuildResultRemoved, + (), + "Printed after the name of an uninstalled entity to indicate that it was successfully uninstalled.", + "REMOVED"); + DECLARE_MESSAGE( + BuildResultSucceeded, + (), + "Printed after the name of an installed entity to indicate that it was built and installed successfully.", + "SUCCEEDED"); + DECLARE_MESSAGE(BuildResultSummaryHeader, + (msg::triplet), + "Displayed before a list of a summary installation results.", + "SUMMARY FOR {triplet}"); + DECLARE_MESSAGE(BuildResultSummaryLine, + (msg::build_result, msg::count), + "Displayed to show a count of results of a build_result in a summary.", + "{build_result}: {count}"); + DECLARE_MESSAGE(BuildTroubleshootingMessage1, + (), + "First part of build troubleshooting message, printed before the URI to look for existing bugs.", + "Please ensure you're using the latest port files with `git pull` and `vcpkg " + "update`.\nThen check for known issues at:"); + DECLARE_MESSAGE(BuildTroubleshootingMessage2, + (), + "Second part of build troubleshooting message, printed after the URI to look for " + "existing bugs but before the URI to file one.", + "You can submit a new issue at:"); + DECLARE_MESSAGE( + BuildTroubleshootingMessage3, + (msg::package_name), + "Third part of build troubleshooting message, printed after the URI to file a bug but " + "before version information about vcpkg itself.", + "Include '[{package_name}] Build error' in your bug report title, the following version information in your " + "bug description, and attach any relevant failure logs from above."); + DECLARE_MESSAGE(BuildTroubleshootingMessage4, + (msg::path), + "Fourth optional part of build troubleshooting message, printed after the version" + "information about vcpkg itself.", + "You can also use the prefilled template from {path}."); + DECLARE_MESSAGE(ChecksFailedCheck, (), "", "vcpkg has crashed; no additional details are available."); + DECLARE_MESSAGE(ChecksUnreachableCode, (), "", "unreachable code was reached"); + DECLARE_MESSAGE(ChecksUpdateVcpkg, (), "", "updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure."); + DECLARE_MESSAGE(CiBaselineAllowUnexpectedPassingRequiresBaseline, + (), + "", + "--allow-unexpected-passing can only be used if a baseline is provided via --ci-baseline."); + DECLARE_MESSAGE(CiBaselineDisallowedCascade, + (msg::spec, msg::path), + "", + "REGRESSION: {spec} cascaded, but it is required to pass. ({path})."); + DECLARE_MESSAGE(CiBaselineRegression, + (msg::spec, msg::build_result, msg::path), + "", + "REGRESSION: {spec} failed with {build_result}. If expected, add {spec}=fail to {path}."); + DECLARE_MESSAGE(CiBaselineRegressionHeader, + (), + "Printed before a series of CiBaselineRegression and/or CiBaselineUnexpectedPass messages.", + "REGRESSIONS:"); + DECLARE_MESSAGE(CiBaselineUnexpectedPass, + (msg::spec, msg::path), + "", + "PASSING, REMOVE FROM FAIL LIST: {spec} ({path})."); + DECLARE_MESSAGE(CmakeTargetsExcluded, (msg::count), "", "note: {count} additional targets are not displayed."); + DECLARE_MESSAGE(CMakeTargetsUsage, + (msg::package_name), + "'targets' are a CMake and Makefile concept", + "{package_name} provides CMake targets:"); + DECLARE_MESSAGE( + CMakeTargetsUsageHeuristicMessage, + (), + "Displayed after CMakeTargetsUsage; the # must be kept at the beginning so that the message remains a comment.", + "# this is heuristically generated, and may not be correct"); + DECLARE_MESSAGE(CommandFailed, + (msg::command_line), + "", + "command:\n" + "{command_line}\n" + "failed with the following results:"); + DECLARE_MESSAGE(CompressFolderFailed, (msg::path), "", "Failed to compress folder '{path}':"); + DECLARE_MESSAGE(CouldNotDeduceNugetIdAndVersion, + (msg::path), + "", + "Could not deduce nuget id and version from filename: {path}"); + DECLARE_MESSAGE(CurlReportedUnexpectedResults, + (msg::command_line, msg::actual), + "{command_line} is the command line to call curl.exe, {actual} is the console output " + "of curl.exe locale-invariant download results.", + "curl has reported unexpected results to vcpkg and vcpkg cannot continue.\n" + "Please review the following text for sensitive information and open an issue on the " + "Microsoft/vcpkg GitHub to help fix this problem!\n" + "cmd: {command_line}\n" + "=== curl output ===\n" + "{actual}\n" + "=== end curl output ==="); + DECLARE_MESSAGE(DefaultPathToBinaries, + (msg::path), + "", + "Based on your system settings, the default path to store binaries is \n '{path}'. This consults " + "%LOCALAPPDATA%/%APPDATA% on Windows and $XDG_CACHE_HOME or $HOME on other platforms."); + DECLARE_MESSAGE(DetectCompilerHash, (msg::triplet), "", "Detecting compiler hash for triplet \"{triplet}\"..."); + DECLARE_MESSAGE(DownloadAvailable, + (msg::env_var), + "", + "A downloadable copy of this tool is available and can be used by unsetting {env_var}."); + DECLARE_MESSAGE(DownloadedSources, (msg::spec), "", "Downloaded sources for {spec}"); + DECLARE_MESSAGE(DownloadingVcpkgCeBundle, (msg::version), "", "Downloading vcpkg-ce bundle {version}..."); + DECLARE_MESSAGE(DownloadingVcpkgCeBundleLatest, + (), + "This message is normally displayed only in development.", + "Downloading latest vcpkg-ce bundle..."); + DECLARE_MESSAGE(EmptyLicenseExpression, (), "", "SPDX license expression was empty."); + DECLARE_MESSAGE(EnvStrFailedToExtract, (), "", "could not expand the environment string:"); + DECLARE_MESSAGE(ErrorDetectingCompilerInfo, + (msg::path), + "", + "while detecting compiler information:\nThe log file content at \"{path}\" is:"); + DECLARE_MESSAGE(ErrorIndividualPackagesUnsupported, + (), + "", + "In manifest mode, `vcpkg install` does not support individual package arguments.\nTo install " + "additional " + "packages, edit vcpkg.json and then run `vcpkg install` without any package arguments."); + DECLARE_MESSAGE(ErrorInvalidClassicModeOption, + (msg::option), + "", + "The option --{option} is not supported in classic mode and no manifest was found."); + DECLARE_MESSAGE(ErrorInvalidManifestModeOption, + (msg::option), + "", + "The option --{option} is not supported in manifest mode."); + DECLARE_MESSAGE( + ErrorMessageMustUsePrintError, + (msg::value), + "{value} is is a localized message name like ErrorMessageMustUsePrintError", + "The message named {value} starts with error:, it must be changed to prepend ErrorMessage in code instead."); + DECLARE_MESSAGE( + ErrorMissingVcpkgRoot, + (), + "", + "Could not detect vcpkg-root. If you are trying to use a copy of vcpkg that you've built, you must " + "define the VCPKG_ROOT environment variable to point to a cloned copy of https://github.com/Microsoft/vcpkg."); + DECLARE_MESSAGE(ErrorNoVSInstance, + (msg::triplet), + "", + "in triplet {triplet}: Unable to find a valid Visual Studio instance"); + DECLARE_MESSAGE(ErrorNoVSInstanceAt, (msg::path), "", "at \"{path}\""); + DECLARE_MESSAGE(ErrorNoVSInstanceFullVersion, (msg::version), "", "with toolset version prefix {version}"); + DECLARE_MESSAGE(ErrorNoVSInstanceVersion, (msg::version), "", "with toolset version {version}"); + DECLARE_MESSAGE(ErrorRequireBaseline, + (), + "", + "this vcpkg instance requires a manifest with a specified baseline in order to " + "interact with ports. Please add 'builtin-baseline' to the manifest or add a " + "'vcpkg-configuration.json' that redefines the default registry."); + DECLARE_MESSAGE(ErrorRequirePackagesList, + (), + "", + "`vcpkg install` requires a list of packages to install in classic mode."); + DECLARE_MESSAGE( + ErrorUnableToDetectCompilerInfo, + (), + "failure output will be displayed at the top of this", + "vcpkg was unable to detect the active compiler's information. See above for the CMake failure output."); + DECLARE_MESSAGE(ErrorVcvarsUnsupported, + (msg::triplet), + "", + "in triplet {triplet}: Use of Visual Studio's Developer Prompt is unsupported " + "on non-Windows hosts.\nDefine 'VCPKG_CMAKE_SYSTEM_NAME' or " + "'VCPKG_CHAINLOAD_TOOLCHAIN_FILE' in the triplet file."); + DECLARE_MESSAGE(ErrorVsCodeNotFound, + (msg::env_var), + "", + "Visual Studio Code was not found and the environment variable '{env_var}' is not set or invalid."); + DECLARE_MESSAGE(ErrorVsCodeNotFoundPathExamined, (), "", "The following paths were examined:"); + DECLARE_MESSAGE(ExcludedPackage, (msg::spec), "", "Excluded {spec}"); + DECLARE_MESSAGE( + ExpectedCharacterHere, + (msg::expected), + "{expected} is a locale-invariant delimiter; for example, the ':' or '=' in 'zlib:x64-windows=skip'", + "expected '{expected}' here"); + DECLARE_MESSAGE(ExpectedFailOrSkip, (), "", "expected 'fail', 'skip', or 'pass' here"); + DECLARE_MESSAGE(ExpectedPortName, (), "", "expected a port name here"); + DECLARE_MESSAGE(ExpectedTripletName, (), "", "expected a triplet name here"); + DECLARE_MESSAGE(ExtendedDocumenationAtUrl, (msg::url), "", "Extended documentation available at '{url}'."); + DECLARE_MESSAGE(FailedToProvisionCe, (), "", "Failed to provision vcpkg-ce."); + DECLARE_MESSAGE(FailedToRunToolToDetermineVersion, + (msg::tool_name, msg::path), + "Additional information, such as the command line output, if any, will be appended on " + "the line after this message", + "Failed to run {path} to determine the {tool_name} version."); + DECLARE_MESSAGE(FailedToStoreBackToMirror, (), "", "failed to store back to mirror:"); + DECLARE_MESSAGE(FailedToStoreBinaryCache, + (msg::path, msg::error_msg), + "", + "Failed to store binary cache '{path}':'{error_msg}'"); + DECLARE_MESSAGE(FailedVendorAuthentication, + (msg::vendor, msg::url), + "", + "One or more {vendor} credential providers failed to authenticate. See '{url}' for more details " + "on how to provide credentials."); + DECLARE_MESSAGE( + ForceSystemBinariesOnWeirdPlatforms, + (), + "", + "Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm, s390x, and ppc64le platforms."); + DECLARE_MESSAGE(FormattedParseMessageExpression, + (msg::value), + "Example of {value} is 'x64 & windows'", + "on expression: {value}"); + DECLARE_MESSAGE(FuzzExpectedOneOf, + (), + "the list after the colon should stay the same, they're literal values", + "expected one of: utf-8, json, platform-expr"); + DECLARE_MESSAGE(GenerateMsgErrorParsingFormatArgs, + (msg::value), + "example of {value} 'GenerateMsgNoComment'", + "parsing format string for {value}:"); + DECLARE_MESSAGE(GenerateMsgIncorrectComment, + (msg::value), + "example of {value} is 'GenerateMsgNoComment'", + R"(message {value} has an incorrect comment:)"); + DECLARE_MESSAGE(GenerateMsgNoArgumentValue, + (msg::value), + "example of {value} is 'arch'", + R"({{{value}}} was specified in a comment, but was not used in the message.)"); + DECLARE_MESSAGE(GenerateMsgNoCommentValue, + (msg::value), + "example of {value} is 'arch'", + R"({{{value}}} was used in the message, but not commented.)"); + DECLARE_MESSAGE(GitCommandFailed, (msg::command_line), "", "failed to execute: {command_line}"); + DECLARE_MESSAGE(GitStatusOutputExpectedFileName, (), "", "expected a file name"); + DECLARE_MESSAGE(GitStatusOutputExpectedNewLine, (), "", "expected new line"); + DECLARE_MESSAGE(GitStatusOutputExpectedRenameOrNewline, (), "", "expected renamed file or new lines"); + DECLARE_MESSAGE(GitStatusUnknownFileStatus, + (msg::value), + "{value} is a single character indicating file status, for example: A, U, M, D", + "unknown file status: {value}"); + DECLARE_MESSAGE(GitUnexpectedCommandOutput, (), "", "unexpected git output"); + DECLARE_MESSAGE( + HashFileFailureToRead, + (msg::path), + "Printed after ErrorMessage and before the specific failing filesystem operation (like file not found)", + "failed to read file '{path}' for hashing: "); + DECLARE_MESSAGE(HeaderOnlyUsage, + (msg::package_name), + "'header' refers to C/C++ .h files", + "{package_name} is header-only and can be used from CMake via:"); + DECLARE_MESSAGE(IllegalFeatures, (), "", "List of features is not allowed in this context"); + DECLARE_MESSAGE(IllegalPlatformSpec, (), "", "Platform qualifier is not allowed in this context"); + DECLARE_MESSAGE(InfoSetEnvVar, + (msg::env_var), + "In this context 'editor' means IDE", + "You can also set the environment variable '{env_var}' to your editor of choice."); + DECLARE_MESSAGE(InstallingFromLocation, + (msg::path), + "'--' at the beginning must be preserved", + "-- Installing port from location: {path}"); + DECLARE_MESSAGE(InstallingPackage, + (msg::action_index, msg::count, msg::spec), + "", + "Installing {action_index}/{count} {spec}..."); + DECLARE_MESSAGE(InstallWithSystemManager, + (), + "", + "You may be able to install this tool via your system package manager."); + DECLARE_MESSAGE(InstallWithSystemManagerMono, + (msg::url), + "", + "Ubuntu 18.04 users may need a newer version of mono, available at {url}."); + DECLARE_MESSAGE(InstallWithSystemManagerPkg, + (msg::command_line), + "", + "You may be able to install this tool via your system package manager ({command_line})."); + DECLARE_MESSAGE(InvalidArgument, (), "", "invalid argument"); + DECLARE_MESSAGE( + InvalidArgumentRequiresAbsolutePath, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' path arguments for binary config strings must be absolute"); + DECLARE_MESSAGE( + InvalidArgumentRequiresBaseUrl, + (msg::base_url, msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires a {base_url} base url as the first argument"); + DECLARE_MESSAGE(InvalidArgumentRequiresBaseUrlAndToken, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires at least a base-url and a SAS token"); + DECLARE_MESSAGE(InvalidArgumentRequiresNoneArguments, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' does not take arguments"); + DECLARE_MESSAGE(InvalidArgumentRequiresOneOrTwoArguments, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires 1 or 2 arguments"); + DECLARE_MESSAGE(InvalidArgumentRequiresPathArgument, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires at least one path argument"); + DECLARE_MESSAGE(InvalidArgumentRequiresPrefix, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires at least one prefix"); + DECLARE_MESSAGE(InvalidArgumentRequiresSingleArgument, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' does not take more than 1 argument"); + DECLARE_MESSAGE(InvalidArgumentRequiresSingleStringArgument, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' expects a single string argument"); + DECLARE_MESSAGE(InvalidArgumentRequiresSourceArgument, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires at least one source argument"); + DECLARE_MESSAGE(InvalidArgumentRequiresTwoOrThreeArguments, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires 2 or 3 arguments"); + DECLARE_MESSAGE(InvalidArgumentRequiresValidToken, + (msg::binary_source), + "", + "invalid argument: binary config '{binary_source}' requires a SAS token without a " + "preceeding '?' as the second argument"); + DECLARE_MESSAGE(InvalidFormatString, + (msg::actual), + "{actual} is the provided format string", + "invalid format string: {actual}"); + DECLARE_MESSAGE(JsonErrorFailedToParse, (msg::path), "", "failed to parse {path}:"); + DECLARE_MESSAGE(JsonErrorFailedToRead, (msg::path, msg::error_msg), "", "failed to read {path}: {error_msg}"); + DECLARE_MESSAGE(JsonErrorMustBeAnObject, (msg::path), "", "Expected {path} to be an object."); + DECLARE_MESSAGE(LaunchingProgramFailed, + (msg::tool_name), + "A platform API call failure message is appended after this", + "Launching {tool_name}:"); + DECLARE_MESSAGE(LicenseExpressionContainsExtraPlus, + (), + "", + "SPDX license expression contains an extra '+'. These are only allowed directly " + "after a license identifier."); + DECLARE_MESSAGE(LicenseExpressionContainsInvalidCharacter, + (msg::value), + "example of {value:02X} is '7B'\nexample of {value} is '{'", + "SPDX license expression contains an invalid character (0x{value:02X} '{value}')."); + DECLARE_MESSAGE(LicenseExpressionContainsUnicode, + (msg::value, msg::pretty_value), + "example of {value:04X} is '22BB'\nexample of {pretty_value} is '⊻'", + "SPDX license expression contains a unicode character (U+{value:04X} " + "'{pretty_value}'), but these expressions are ASCII-only."); + DECLARE_MESSAGE(LicenseExpressionDocumentRefUnsupported, + (), + "", + "The current implementation does not support DocumentRef- SPDX references."); + DECLARE_MESSAGE(LicenseExpressionExpectCompoundFoundParen, + (), + "", + "Expected a compound or the end of the string, found a parenthesis."); + DECLARE_MESSAGE(LicenseExpressionExpectCompoundFoundWith, + (), + "AND, OR, and WITH are all keywords and should not be translated.", + "Expected either AND or OR, found WITH (WITH is only allowed after license names, not " + "parenthesized expressions)."); + DECLARE_MESSAGE(LicenseExpressionExpectCompoundFoundWord, + (msg::value), + "Example of {value} is 'MIT'.\nAND and OR are both keywords and should not be translated.", + "Expected either AND or OR, found a license or exception name: '{value}'."); + DECLARE_MESSAGE(LicenseExpressionExpectCompoundOrWithFoundWord, + (msg::value), + "example of {value} is 'MIT'.\nAND, OR, and WITH are all keywords and should not be translated.", + "Expected either AND, OR, or WITH, found a license or exception name: '{value}'."); + DECLARE_MESSAGE(LicenseExpressionExpectExceptionFoundCompound, + (msg::value), + "Example of {value} is 'AND'", + "Expected an exception name, found the compound {value}."); + DECLARE_MESSAGE(LicenseExpressionExpectExceptionFoundEof, + (), + "", + "Expected an exception name, found the end of the string."); + DECLARE_MESSAGE(LicenseExpressionExpectExceptionFoundParen, + (), + "", + "Expected an exception name, found a parenthesis."); + DECLARE_MESSAGE(LicenseExpressionExpectLicenseFoundCompound, + (msg::value), + "Example of {value} is 'AND'", + "Expected a license name, found the compound {value}."); + DECLARE_MESSAGE(LicenseExpressionExpectLicenseFoundEof, + (), + "", + "Expected a license name, found the end of the string."); + DECLARE_MESSAGE(LicenseExpressionExpectLicenseFoundParen, (), "", "Expected a license name, found a parenthesis."); + DECLARE_MESSAGE(LicenseExpressionImbalancedParens, + (), + "", + "There was a close parenthesis without an opening parenthesis."); + DECLARE_MESSAGE(LicenseExpressionUnknownException, + (msg::value), + "Example of {value} is 'unknownexception'", + "Unknown license exception identifier '{value}'. Known values are listed at " + "https://spdx.org/licenses/exceptions-index.html"); + DECLARE_MESSAGE(LicenseExpressionUnknownLicense, + (msg::value), + "Example of {value} is 'unknownlicense'", + "Unknown license identifier '{value}'. Known values are listed at https://spdx.org/licenses/"); + DECLARE_MESSAGE(LoadingCommunityTriplet, + (msg::path), + "'-- [COMMUNITY]' at the beginning must be preserved", + "-- [COMMUNITY] Loading triplet configuration from: {path}"); + DECLARE_MESSAGE(LoadingOverlayTriplet, + (msg::path), + "'-- [OVERLAY]' at the beginning must be preserved", + "-- [OVERLAY] Loading triplet configuration from: {path}"); + DECLARE_MESSAGE(LocalizedMessageMustNotContainIndents, + (msg::value), + "{value} is is a localized message name like LocalizedMessageMustNotContainIndents. " + "The 'LocalizedString::append_indent' part is locale-invariant.", + "The message named {value} contains what appears to be indenting which must be " + "changed to use LocalizedString::append_indent instead."); + DECLARE_MESSAGE(LocalizedMessageMustNotEndWithNewline, + (msg::value), + "{value} is a localized message name like LocalizedMessageMustNotEndWithNewline", + "The message named {value} ends with a newline which should be added by formatting " + "rather than by localization."); + DECLARE_MESSAGE(MonoInstructions, + (), + "", + "This may be caused by an incomplete mono installation. Full mono is " + "available on some systems via `sudo apt install mono-complete`. Ubuntu 18.04 users may " + "need a newer version of mono, available at https://www.mono-project.com/download/stable/"); + DECLARE_MESSAGE(MsiexecFailedToExtract, + (msg::path, msg::exit_code), + "", + "msiexec failed while extracting '{path}' with launch or exit code {exit_code} and message:"); + DECLARE_MESSAGE(NoLocalizationForMessages, (), "", "No localized messages for the following: "); + DECLARE_MESSAGE(NoRegistryForPort, (msg::package_name), "", "no registry configured for port {package_name}"); + DECLARE_MESSAGE(PackingVendorFailed, + (msg::vendor), + "", + "Packing {vendor} failed. Use --debug for more information."); + DECLARE_MESSAGE(ParseControlErrorInfoInvalidFields, (), "", "The following fields were not expected:"); + DECLARE_MESSAGE(ParseControlErrorInfoMissingFields, (), "", "The following fields were missing:"); + DECLARE_MESSAGE(ParseControlErrorInfoTypesEntry, + (msg::value, msg::expected), + "{value} is the name of a field in an on-disk file, {expected} is a short description " + "of what it should be like 'a non-negative integer' (which isn't localized yet)", + "{value} was expected to be {expected}"); + DECLARE_MESSAGE(ParseControlErrorInfoWhileLoading, + (msg::path), + "Error messages are is printed after this.", + "while loading {path}:"); + DECLARE_MESSAGE(ParseControlErrorInfoWrongTypeFields, (), "", "The following fields had the wrong types:"); + DECLARE_MESSAGE(PortNotInBaseline, + (msg::package_name), + "", + "the baseline does not contain an entry for port {package_name}"); + DECLARE_MESSAGE(ProcessorArchitectureMalformed, + (msg::arch), + "", + "Failed to parse %PROCESSOR_ARCHITECTURE% ({arch}) as a valid CPU architecture."); + DECLARE_MESSAGE(ProcessorArchitectureMissing, + (), + "", + "The required environment variable %PROCESSOR_ARCHITECTURE% is missing."); + DECLARE_MESSAGE(ProcessorArchitectureW6432Malformed, + (msg::arch), + "", + "Failed to parse %PROCESSOR_ARCHITEW6432% ({arch}) as a valid CPU architecture. " + "Falling back to %PROCESSOR_ARCHITECTURE%."); + DECLARE_MESSAGE(ProgramReturnedNonzeroExitCode, + (msg::tool_name, msg::exit_code), + "The program's console output is appended after this.", + "{tool_name} failed with exit code: ({exit_code})."); + DECLARE_MESSAGE(PushingVendorFailed, + (msg::vendor, msg::path), + "", + "Pushing {vendor} to '{path}' failed. Use --debug for more information."); + DECLARE_MESSAGE(ReplaceSecretsError, + (msg::error_msg), + "", + "Replace secretes produced the following error: '{error_msg}'"); + DECLARE_MESSAGE(RestoredPackage, (msg::path), "", "Restored package from '{path}'"); + DECLARE_MESSAGE( + RestoredPackagesFromVendor, + (msg::count, msg::elapsed, msg::value), + "{value} may be either a 'vendor' like 'Azure' or 'NuGet', or a file path like C:\\example or /usr/example", + "Restored {count} package(s) from {value} in {elapsed}. Use --debug to see more details."); + DECLARE_MESSAGE(ResultsHeader, (), "Displayed before a list of installation results.", "RESULTS"); + DECLARE_MESSAGE(SettingEnvVar, + (msg::env_var, msg::url), + "An example of env_var is \"HTTP(S)_PROXY\"" + "'--' at the beginning must be preserved", + "-- Setting \"{env_var}\" environment variables to \"{url}\"."); + DECLARE_MESSAGE(SourceFieldPortNameMismatch, + (msg::package_name, msg::path), + "{package_name} and {path} are both names of installable ports/packages. 'Source', " + "'CONTROL', 'vcpkg.json', and 'name' references are locale-invariant.", + "The 'Source' field inside the CONTROL file, or \"name\" field inside the vcpkg.json " + "file has the name {package_name} and does not match the port directory {path}."); + DECLARE_MESSAGE(StoredBinaryCache, (msg::path), "", "Stored binary cache: '{path}'"); + DECLARE_MESSAGE(SystemApiErrorMessage, + (msg::system_api, msg::exit_code, msg::error_msg), + "", + "calling {system_api} failed with {exit_code} ({error_msg})"); + DECLARE_MESSAGE(ToolFetchFailed, (msg::tool_name), "", "Could not fetch {tool_name}."); + DECLARE_MESSAGE(ToolInWin10, (), "", "This utility is bundled with Windows 10 or later."); + DECLARE_MESSAGE(UnexpectedErrorDuringBulkDownload, (), "", "an unexpected error occurred during bulk download."); + DECLARE_MESSAGE(UnexpectedToolOutput, + (msg::tool_name, msg::path), + "The actual command line output will be appended after this message.", + "{tool_name} ({path}) produced unexpected output when attempting to determine the version:"); + DECLARE_MESSAGE(UnknownBaselineFileContent, + (), + "", + "unrecognizable baseline entry; expected 'port:triplet=(fail|skip|pass)'"); + DECLARE_MESSAGE(UnknownBinaryProviderType, + (), + "", + "unknown binary provider type: valid providers are 'clear', 'default', 'nuget', " + "'nugetconfig','nugettimeout', 'interactive', 'x-azblob', 'x-gcs', 'x-aws', " + "'x-aws-config', 'http', and 'files'"); + DECLARE_MESSAGE(UnknownTool, (), "", "vcpkg does not have a definition of this tool for this platform."); + DECLARE_MESSAGE( + UnknownVariablesInTemplate, + (msg::value, msg::list), + "{value} is the value provided by the user and {list} a list of unknown variables seperated by comma", + "invalid argument: url template '{value}' contains unknown variables: {list}"); + DECLARE_MESSAGE(UnsupportedSystemName, + (msg::system_name), + "", + "Could not map VCPKG_CMAKE_SYSTEM_NAME '{system_name}' to a vcvarsall platform. " + "Supported system names are '', 'Windows' and 'WindowsStore'."); + DECLARE_MESSAGE(UnsupportedToolchain, + (msg::triplet, msg::arch, msg::path, msg::list), + "example for {list} is 'x86, arm64'", + "in triplet {triplet}: Unable to find a valid toolchain for requested target architecture {arch}.\n" + "The selected Visual Studio instance is at: {path}\n" + "The available toolchain combinations are: {list}"); + DECLARE_MESSAGE( + UpdateBaselineAddBaselineNoManifest, + (msg::option), + "", + "the --{option} switch was passed, but there is no manifest file to add a `builtin-baseline` field to."); + DECLARE_MESSAGE(UpdateBaselineLocalGitError, + (msg::path), + "", + "git failed to parse HEAD for the local vcpkg registry at '{path}'"); + DECLARE_MESSAGE(UpdateBaselineNoConfiguration, + (), + "", + "neither `vcpkg.json` nor `vcpkg-configuration.json` exist to update."); + DECLARE_MESSAGE(UpdateBaselineNoExistingBuiltinBaseline, + (msg::option), + "", + "the manifest file currently does not contain a `builtin-baseline` field; in order to " + "add one, pass the --{option} switch."); + DECLARE_MESSAGE(UpdateBaselineNoUpdate, + (msg::url, msg::value), + "example of {value} is '5507daa796359fe8d45418e694328e878ac2b82f'", + "registry '{url}' not updated: '{value}'"); + DECLARE_MESSAGE(UpdateBaselineRemoteGitError, (msg::url), "", "git failed to fetch remote repository '{url}'"); + DECLARE_MESSAGE(UpdateBaselineUpdatedBaseline, + (msg::url, msg::old_value, msg::new_value), + "example of {old_value}, {new_value} is '5507daa796359fe8d45418e694328e878ac2b82f'", + "updated registry '{url}': baseline '{old_value}' -> '{new_value}'"); + DECLARE_MESSAGE(UploadedBinaries, (msg::count, msg::vendor), "", "Uploaded binaries to '{count}' '{vendor}'."); + DECLARE_MESSAGE(UploadedPackagesToVendor, + (msg::count, msg::elapsed, msg::vendor), + "", + "Uploaded {count} package(s) to {vendor} in {elapsed}"); + DECLARE_MESSAGE(UploadingBinariesToVendor, + (msg::spec, msg::vendor, msg::path), + "", + "Uploading binaries for '{spec}' to '{vendor}' source '{path}'."); + DECLARE_MESSAGE(UploadingBinariesUsingVendor, + (msg::spec, msg::vendor, msg::path), + "", + "Uploading binaries for '{spec}' using '{vendor}' '{path}'."); + DECLARE_MESSAGE(UseEnvVar, + (msg::env_var), + "An example of env_var is \"HTTP(S)_PROXY\"" + "'--' at the beginning must be preserved", + "-- Using {env_var} in environment variables."); + DECLARE_MESSAGE(UsingCommunityTriplet, + (msg::triplet), + "'--' at the beginning must be preserved", + "-- Using community triplet {triplet}. This triplet configuration is not guaranteed to succeed."); + DECLARE_MESSAGE(UsingManifestAt, (msg::path), "", "Using manifest file at {path}."); + DECLARE_MESSAGE(VcpkgCeIsExperimental, + (), + "", + "vcpkg-ce ('configure environment') is experimental and may change at any time."); + DECLARE_MESSAGE(VcpkgDisallowedClassicMode, + (), + "", + "Could not locate a manifest (vcpkg.json) above the current working " + "directory.\nThis vcpkg distribution does not have a classic mode instance."); + DECLARE_MESSAGE( + VcpkgHasCrashed, + (), + "Printed at the start of a crash report.", + "vcpkg has crashed. Please create an issue at https://github.com/microsoft/vcpkg containing a brief summary of " + "what you were trying to do and the following information."); + DECLARE_MESSAGE(VcpkgInvalidCommand, (msg::command_name), "", "invalid command: {command_name}"); + DECLARE_MESSAGE(VcpkgSendMetricsButDisabled, (), "", "passed --sendmetrics, but metrics are disabled."); + DECLARE_MESSAGE(VersionCommandHeader, + (msg::version), + "", + "vcpkg package management program version {version}\n\nSee LICENSE.txt for license information."); + DECLARE_MESSAGE(VersionConstraintViolated, + (msg::spec, msg::expected_version, msg::actual_version), + "", + "dependency {spec} was expected to be at least version " + "{expected_version}, but is currently {actual_version}."); + DECLARE_MESSAGE( + VersionInvalidDate, + (msg::version), + "", + "`{version}` is not a valid date version. Dates must follow the format YYYY-MM-DD and disambiguators must be " + "dot-separated positive integer values without leading zeroes."); + DECLARE_MESSAGE(VersionInvalidRelaxed, + (msg::version), + "", + "`{version}` is not a valid relaxed version (semver with arbitrary numeric element count)."); + DECLARE_MESSAGE(VersionInvalidSemver, + (msg::version), + "", + "`{version}` is not a valid semantic version, consult ."); + DECLARE_MESSAGE(VersionSpecMismatch, + (msg::path, msg::expected_version, msg::actual_version), + "", + "Failed to load port because versions are inconsistent. The file \"{path}\" contains the version " + "{actual_version}, but the version database indicates that it should be {expected_version}."); + DECLARE_MESSAGE(VSExaminedInstances, (), "", "The following Visual Studio instances were considered:"); + DECLARE_MESSAGE(VSExaminedPaths, (), "", "The following paths were examined for Visual Studio instances:"); + DECLARE_MESSAGE(VSNoInstances, (), "", "Could not locate a complete Visual Studio instance"); + DECLARE_MESSAGE(WaitingForChildrenToExit, (), "", "Waiting for child processes to exit..."); + DECLARE_MESSAGE(WaitingToTakeFilesystemLock, (msg::path), "", "waiting to take filesystem lock on {path}..."); + DECLARE_MESSAGE(WarningMessageMustUsePrintWarning, + (msg::value), + "{value} is is a localized message name like WarningMessageMustUsePrintWarning", + "The message named {value} starts with warning:, it must be changed to prepend " + "WarningMessage in code instead."); + DECLARE_MESSAGE(WarningsTreatedAsErrors, (), "", "previous warnings being interpreted as errors"); } diff --git a/locales/messages.en.json b/locales/messages.en.json index 2a0e97094..a38d698ab 100644 --- a/locales/messages.en.json +++ b/locales/messages.en.json @@ -114,6 +114,7 @@ "FailedVendorAuthentication": "One or more {vendor} credential providers failed to authenticate. See '{url}' for more details on how to provide credentials.", "ForceSystemBinariesOnWeirdPlatforms": "Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm, s390x, and ppc64le platforms.", "FormattedParseMessageExpression": "on expression: {value}", + "FuzzExpectedOneOf": "expected one of: utf-8, json, platform-expr", "GenerateMsgErrorParsingFormatArgs": "parsing format string for {value}:", "GenerateMsgIncorrectComment": "message {value} has an incorrect comment:", "GenerateMsgNoArgumentValue": "{{{value}}} was specified in a comment, but was not used in the message.", @@ -178,10 +179,10 @@ "LocalizedMessageMustNotEndWithNewline": "The message named {value} ends with a newline which should be added by formatting rather than by localization.", "MonoInstructions": "This may be caused by an incomplete mono installation. Full mono is available on some systems via `sudo apt install mono-complete`. Ubuntu 18.04 users may need a newer version of mono, available at https://www.mono-project.com/download/stable/", "MsiexecFailedToExtract": "msiexec failed while extracting '{path}' with launch or exit code {exit_code} and message:", - "NoLocalizationForMessages": "No localization for the following messages:", + "NoLocalizationForMessages": "No localized messages for the following: ", "NoRegistryForPort": "no registry configured for port {package_name}", "NoteMessage": "note: ", - "PackingVendorFailed": "Packing {vendor} failed. Use --debug for more information.", + "PackingVendorFailed": "Packing {vendor} failed. Use --debug for more information.", "ParseControlErrorInfoInvalidFields": "The following fields were not expected:", "ParseControlErrorInfoMissingFields": "The following fields were missing:", "ParseControlErrorInfoTypesEntry": "{value} was expected to be {expected}", @@ -192,7 +193,7 @@ "ProcessorArchitectureMissing": "The required environment variable %PROCESSOR_ARCHITECTURE% is missing.", "ProcessorArchitectureW6432Malformed": "Failed to parse %PROCESSOR_ARCHITEW6432% ({arch}) as a valid CPU architecture. Falling back to %PROCESSOR_ARCHITECTURE%.", "ProgramReturnedNonzeroExitCode": "{tool_name} failed with exit code: ({exit_code}).", - "PushingVendorFailed": "Pushing {vendor} to '{path}' failed. Use --debug for more information.", + "PushingVendorFailed": "Pushing {vendor} to '{path}' failed. Use --debug for more information.", "RemovingPackage": "Removing {action_index}/{count} {spec}", "ReplaceSecretsError": "Replace secretes produced the following error: '{error_msg}'", "RestoredPackage": "Restored package from '{path}'", diff --git a/locales/messages.json b/locales/messages.json index 789131651..3a063c028 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -202,6 +202,8 @@ "ForceSystemBinariesOnWeirdPlatforms": "Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm, s390x, and ppc64le platforms.", "FormattedParseMessageExpression": "on expression: {value}", "_FormattedParseMessageExpression.comment": "Example of {value} is 'x64 & windows'", + "FuzzExpectedOneOf": "expected one of: utf-8, json, platform-expr", + "_FuzzExpectedOneOf.comment": "the list after the colon should stay the same, they're literal values", "GenerateMsgErrorParsingFormatArgs": "parsing format string for {value}:", "_GenerateMsgErrorParsingFormatArgs.comment": "example of {value} 'GenerateMsgNoComment'", "GenerateMsgIncorrectComment": "message {value} has an incorrect comment:", @@ -311,11 +313,11 @@ "MonoInstructions": "This may be caused by an incomplete mono installation. Full mono is available on some systems via `sudo apt install mono-complete`. Ubuntu 18.04 users may need a newer version of mono, available at https://www.mono-project.com/download/stable/", "MsiexecFailedToExtract": "msiexec failed while extracting '{path}' with launch or exit code {exit_code} and message:", "_MsiexecFailedToExtract.comment": "An example of {path} is /foo/bar. An example of {exit_code} is 127.", - "NoLocalizationForMessages": "No localization for the following messages:", + "NoLocalizationForMessages": "No localized messages for the following: ", "NoRegistryForPort": "no registry configured for port {package_name}", "_NoRegistryForPort.comment": "An example of {package_name} is zlib.", "NoteMessage": "note: ", - "PackingVendorFailed": "Packing {vendor} failed. Use --debug for more information.", + "PackingVendorFailed": "Packing {vendor} failed. Use --debug for more information.", "_PackingVendorFailed.comment": "An example of {vendor} is Azure.", "ParseControlErrorInfoInvalidFields": "The following fields were not expected:", "ParseControlErrorInfoMissingFields": "The following fields were missing:", @@ -333,7 +335,7 @@ "_ProcessorArchitectureW6432Malformed.comment": "An example of {arch} is x64.", "ProgramReturnedNonzeroExitCode": "{tool_name} failed with exit code: ({exit_code}).", "_ProgramReturnedNonzeroExitCode.comment": "The program's console output is appended after this. An example of {tool_name} is aria2. An example of {exit_code} is 127.", - "PushingVendorFailed": "Pushing {vendor} to '{path}' failed. Use --debug for more information.", + "PushingVendorFailed": "Pushing {vendor} to '{path}' failed. Use --debug for more information.", "_PushingVendorFailed.comment": "An example of {vendor} is Azure. An example of {path} is /foo/bar.", "RemovingPackage": "Removing {action_index}/{count} {spec}", "_RemovingPackage.comment": "An example of {action_index} is 340. An example of {count} is 42. An example of {spec} is zlib:x64-windows.", diff --git a/src/vcpkg-fuzz/main.cpp b/src/vcpkg-fuzz/main.cpp index 28a2618f8..bf4e1be73 100644 --- a/src/vcpkg-fuzz/main.cpp +++ b/src/vcpkg-fuzz/main.cpp @@ -16,18 +16,15 @@ using namespace vcpkg; namespace { - DECLARE_AND_REGISTER_MESSAGE(FuzzInvalidKind, (msg::value), "example of {value} is 'utf-8'", "invalid kind: {}"); - DECLARE_AND_REGISTER_MESSAGE(FuzzExpectedOneOf, - (), - "the list after the colon should stay the same, they're literal values", - "expected one of: utf-8, json, platform-expr"); - DECLARE_AND_REGISTER_MESSAGE(FuzzUnknownOption, (msg::option), "", "unknown option: --{option}"); - - DECLARE_AND_REGISTER_MESSAGE(FuzzHelpUsage, (), "", "usage: vcpkg-fuzz --kind="); DECLARE_AND_REGISTER_MESSAGE(FuzzHelpInput, (), "", "accepts input on stdin."); - DECLARE_AND_REGISTER_MESSAGE(FuzzHelpOptions, (), "", "options:"); DECLARE_AND_REGISTER_MESSAGE(FuzzHelpOptionKind, (), "", "one of {{utf-8, json, platform-expr}}"); - + DECLARE_AND_REGISTER_MESSAGE(FuzzHelpOptions, (), "", "options:"); + DECLARE_AND_REGISTER_MESSAGE(FuzzHelpUsage, (), "", "usage: vcpkg-fuzz --kind="); + DECLARE_AND_REGISTER_MESSAGE(FuzzInvalidKind, + (msg::value), + "example of {value} is 'utf-8'", + "invalid kind: '{value}'"); + DECLARE_AND_REGISTER_MESSAGE(FuzzUnknownOption, (msg::option), "", "unknown option: --{option}"); enum class FuzzKind { None, diff --git a/src/vcpkg.cpp b/src/vcpkg.cpp index 1f8e29ec9..8f77ed91a 100644 --- a/src/vcpkg.cpp +++ b/src/vcpkg.cpp @@ -34,26 +34,6 @@ using namespace vcpkg; -namespace -{ - DECLARE_AND_REGISTER_MESSAGE(VcpkgInvalidCommand, (msg::command_name), "", "invalid command: {command_name}"); - DECLARE_AND_REGISTER_MESSAGE(VcpkgSendMetricsButDisabled, - (), - "", - "passed --sendmetrics, but metrics are disabled."); - DECLARE_AND_REGISTER_MESSAGE( - VcpkgHasCrashed, - (), - "Printed at the start of a crash report.", - "vcpkg has crashed. Please create an issue at https://github.com/microsoft/vcpkg containing a brief summary of " - "what you were trying to do and the following information."); - DECLARE_AND_REGISTER_MESSAGE( - ForceSystemBinariesOnWeirdPlatforms, - (), - "", - "Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm, s390x, and ppc64le platforms."); -} - static void invalid_command(const std::string& cmd) { msg::println(Color::error, msgVcpkgInvalidCommand, msg::command_name = cmd); diff --git a/src/vcpkg/archives.cpp b/src/vcpkg/archives.cpp index ea9645889..6e9a569d9 100644 --- a/src/vcpkg/archives.cpp +++ b/src/vcpkg/archives.cpp @@ -12,20 +12,6 @@ namespace { using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE( - MsiexecFailedToExtract, - (msg::path, msg::exit_code), - "", - "msiexec failed while extracting '{path}' with launch or exit code {exit_code} and message:"); - DECLARE_AND_REGISTER_MESSAGE(CouldNotDeduceNugetIdAndVersion, - (msg::path), - "", - "Could not deduce nuget id and version from filename: {path}"); - DECLARE_AND_REGISTER_MESSAGE(AnotherInstallationInProgress, - (), - "", - "Another installation is in progress on the machine, sleeping 6s before retrying."); - #if defined(_WIN32) void win32_extract_nupkg(const ToolCache& tools, MessageSink& status_sink, const Path& archive, const Path& to_path) { diff --git a/src/vcpkg/base/checks.cpp b/src/vcpkg/base/checks.cpp index ee80eaa49..ff5cf3fb2 100644 --- a/src/vcpkg/base/checks.cpp +++ b/src/vcpkg/base/checks.cpp @@ -13,14 +13,6 @@ namespace { return LocalizedString::from_raw(fmt::format("{}: ", line_info)); } - - DECLARE_AND_REGISTER_MESSAGE(ChecksUnreachableCode, (), "", "unreachable code was reached"); - DECLARE_AND_REGISTER_MESSAGE(ChecksFailedCheck, (), "", "vcpkg has crashed; no additional details are available."); - DECLARE_AND_REGISTER_MESSAGE(ChecksUpdateVcpkg, - (), - "", - "updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure."); - void (*g_shutdown_handler)() = nullptr; } diff --git a/src/vcpkg/base/downloads.cpp b/src/vcpkg/base/downloads.cpp index 102819a6f..513376387 100644 --- a/src/vcpkg/base/downloads.cpp +++ b/src/vcpkg/base/downloads.cpp @@ -10,28 +10,6 @@ #include #include -namespace -{ - using namespace vcpkg; - - DECLARE_AND_REGISTER_MESSAGE(CurlReportedUnexpectedResults, - (msg::command_line, msg::actual), - "{command_line} is the command line to call curl.exe, {actual} is the console output " - "of curl.exe locale-invariant download results.", - "curl has reported unexpected results to vcpkg and vcpkg cannot continue.\n" - "Please review the following text for sensitive information and open an issue on the " - "Microsoft/vcpkg GitHub to help fix this problem!\n" - "cmd: {command_line}\n" - "=== curl output ===\n" - "{actual}\n" - "=== end curl output ==="); - DECLARE_AND_REGISTER_MESSAGE(UnexpectedErrorDuringBulkDownload, - (), - "", - "an unexpected error occurred during bulk download."); - DECLARE_AND_REGISTER_MESSAGE(FailedToStoreBackToMirror, (), "", "failed to store back to mirror:"); -} - namespace vcpkg { #if defined(_WIN32) diff --git a/src/vcpkg/base/files.cpp b/src/vcpkg/base/files.cpp index 37d2134cd..1c90e3b3a 100644 --- a/src/vcpkg/base/files.cpp +++ b/src/vcpkg/base/files.cpp @@ -43,11 +43,6 @@ namespace { using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE(WaitingToTakeFilesystemLock, - (msg::path), - "", - "waiting to take filesystem lock on {path}..."); - std::atomic g_us_filesystem_stats(0); struct IsSlash diff --git a/src/vcpkg/base/git.cpp b/src/vcpkg/base/git.cpp index 9768faa45..bcf58abf1 100644 --- a/src/vcpkg/base/git.cpp +++ b/src/vcpkg/base/git.cpp @@ -10,16 +10,6 @@ namespace { using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE(GitCommandFailed, (msg::command_line), "", "failed to execute: {command_line}"); - DECLARE_AND_REGISTER_MESSAGE(GitUnexpectedCommandOutput, (), "", "unexpected git output"); - DECLARE_AND_REGISTER_MESSAGE(GitStatusUnknownFileStatus, - (msg::value), - "{value} is a single character indicating file status, for example: A, U, M, D", - "unknown file status: {value}"); - DECLARE_AND_REGISTER_MESSAGE(GitStatusOutputExpectedNewLine, (), "", "expected new line"); - DECLARE_AND_REGISTER_MESSAGE(GitStatusOutputExpectedFileName, (), "", "expected a file name"); - DECLARE_AND_REGISTER_MESSAGE(GitStatusOutputExpectedRenameOrNewline, (), "", "expected renamed file or new lines"); - Command git_cmd_builder(const GitConfig& config) { auto cmd = Command(config.git_exe); diff --git a/src/vcpkg/base/hash.cpp b/src/vcpkg/base/hash.cpp index 0976096d2..5b816d34a 100644 --- a/src/vcpkg/base/hash.cpp +++ b/src/vcpkg/base/hash.cpp @@ -18,12 +18,6 @@ namespace vcpkg::Hash { - DECLARE_AND_REGISTER_MESSAGE( - HashFileFailureToRead, - (msg::path), - "Printed after ErrorMessage and before the specific failing filesystem operation (like file not found)", - "failed to read file '{path}' for hashing: "); - using uchar = unsigned char; Optional algorithm_from_string(StringView sv) noexcept diff --git a/src/vcpkg/base/json.cpp b/src/vcpkg/base/json.cpp index 8b7131d8c..b109ffd78 100644 --- a/src/vcpkg/base/json.cpp +++ b/src/vcpkg/base/json.cpp @@ -9,17 +9,6 @@ #include -namespace -{ - using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE(JsonErrorFailedToRead, - (msg::path, msg::error_msg), - "", - "failed to read {path}: {error_msg}"); - DECLARE_AND_REGISTER_MESSAGE(JsonErrorFailedToParse, (msg::path), "", "failed to parse {path}:"); - DECLARE_AND_REGISTER_MESSAGE(JsonErrorMustBeAnObject, (msg::path), "", "Expected {path} to be an object."); -} - namespace vcpkg::Json { static std::atomic g_json_parsing_stats(0); diff --git a/src/vcpkg/base/messages.cpp b/src/vcpkg/base/messages.cpp index 2a4fb663d..e3acc1bde 100644 --- a/src/vcpkg/base/messages.cpp +++ b/src/vcpkg/base/messages.cpp @@ -6,8 +6,6 @@ using namespace vcpkg; namespace vcpkg::msg { - DECLARE_AND_REGISTER_MESSAGE(NoLocalizationForMessages, (), "", "No localization for the following messages:"); - REGISTER_MESSAGE(SeeURL); REGISTER_MESSAGE(NoteMessage); REGISTER_MESSAGE(WarningMessage); @@ -406,4 +404,243 @@ namespace vcpkg MessageSink& null_sink = null_sink_instance; MessageSink& stdout_sink = stdout_sink_instance; MessageSink& stderr_sink = stderr_sink_instance; + + REGISTER_MESSAGE(AddArtifactOnlyOne); + REGISTER_MESSAGE(AddFirstArgument); + REGISTER_MESSAGE(AddPortRequiresManifest); + REGISTER_MESSAGE(AddPortSucceded); + REGISTER_MESSAGE(AddTripletExpressionNotAllowed); + REGISTER_MESSAGE(AddVersionAddedVersionToFile); + REGISTER_MESSAGE(AddVersionCommitChangesReminder); + REGISTER_MESSAGE(AddVersionCommitResultReminder); + REGISTER_MESSAGE(AddVersionDetectLocalChangesError); + REGISTER_MESSAGE(AddVersionFileNotFound); + REGISTER_MESSAGE(AddVersionFormatPortSuggestion); + REGISTER_MESSAGE(AddVersionIgnoringOptionAll); + REGISTER_MESSAGE(AddVersionLoadPortFailed); + REGISTER_MESSAGE(AddVersionNewFile); + REGISTER_MESSAGE(AddVersionNewShaIs); + REGISTER_MESSAGE(AddVersionNoFilesUpdated); + REGISTER_MESSAGE(AddVersionNoFilesUpdatedForPort); + REGISTER_MESSAGE(AddVersionNoGitSha); + REGISTER_MESSAGE(AddVersionOldShaIs); + REGISTER_MESSAGE(AddVersionOverwriteOptionSuggestion); + REGISTER_MESSAGE(AddVersionPortDoesNotExist); + REGISTER_MESSAGE(AddVersionPortFilesShaChanged); + REGISTER_MESSAGE(AddVersionPortFilesShaUnchanged); + REGISTER_MESSAGE(AddVersionPortHasImproperFormat); + REGISTER_MESSAGE(AddVersionSuggestNewVersionScheme); + REGISTER_MESSAGE(AddVersionUnableToParseVersionsFile); + REGISTER_MESSAGE(AddVersionUncommittedChanges); + REGISTER_MESSAGE(AddVersionUpdateVersionReminder); + REGISTER_MESSAGE(AddVersionUseOptionAll); + REGISTER_MESSAGE(AddVersionVersionAlreadyInFile); + REGISTER_MESSAGE(AddVersionVersionIs); + REGISTER_MESSAGE(AllFormatArgsRawArgument); + REGISTER_MESSAGE(AllFormatArgsUnbalancedBraces); + REGISTER_MESSAGE(AlreadyInstalled); + REGISTER_MESSAGE(AlreadyInstalledNotHead); + REGISTER_MESSAGE(AnotherInstallationInProgress); + REGISTER_MESSAGE(AttemptingToFetchPackagesFromVendor); + REGISTER_MESSAGE(AuthenticationMayRequireManualAction); + REGISTER_MESSAGE(AutoSettingEnvVar); + REGISTER_MESSAGE(BuildAlreadyInstalled); + REGISTER_MESSAGE(BuildDependenciesMissing); + REGISTER_MESSAGE(BuildingFromHead); + REGISTER_MESSAGE(BuildingPackage); + REGISTER_MESSAGE(BuildingPackageFailed); + REGISTER_MESSAGE(BuildingPackageFailedDueToMissingDeps); + REGISTER_MESSAGE(BuildResultBuildFailed); + REGISTER_MESSAGE(BuildResultCacheMissing); + REGISTER_MESSAGE(BuildResultCascadeDueToMissingDependencies); + REGISTER_MESSAGE(BuildResultDownloaded); + REGISTER_MESSAGE(BuildResultExcluded); + REGISTER_MESSAGE(BuildResultFileConflicts); + REGISTER_MESSAGE(BuildResultPostBuildChecksFailed); + REGISTER_MESSAGE(BuildResultRemoved); + REGISTER_MESSAGE(BuildResultSucceeded); + REGISTER_MESSAGE(BuildResultSummaryHeader); + REGISTER_MESSAGE(BuildResultSummaryLine); + REGISTER_MESSAGE(BuildTroubleshootingMessage1); + REGISTER_MESSAGE(BuildTroubleshootingMessage2); + REGISTER_MESSAGE(BuildTroubleshootingMessage3); + REGISTER_MESSAGE(BuildTroubleshootingMessage4); + REGISTER_MESSAGE(ChecksFailedCheck); + REGISTER_MESSAGE(ChecksUnreachableCode); + REGISTER_MESSAGE(ChecksUpdateVcpkg); + REGISTER_MESSAGE(CiBaselineAllowUnexpectedPassingRequiresBaseline); + REGISTER_MESSAGE(CiBaselineDisallowedCascade); + REGISTER_MESSAGE(CiBaselineRegression); + REGISTER_MESSAGE(CiBaselineRegressionHeader); + REGISTER_MESSAGE(CiBaselineUnexpectedPass); + REGISTER_MESSAGE(CmakeTargetsExcluded); + REGISTER_MESSAGE(CMakeTargetsUsage); + REGISTER_MESSAGE(CMakeTargetsUsageHeuristicMessage); + REGISTER_MESSAGE(CommandFailed); + REGISTER_MESSAGE(CompressFolderFailed); + REGISTER_MESSAGE(CouldNotDeduceNugetIdAndVersion); + REGISTER_MESSAGE(CurlReportedUnexpectedResults); + REGISTER_MESSAGE(DefaultPathToBinaries); + REGISTER_MESSAGE(DetectCompilerHash); + REGISTER_MESSAGE(DownloadAvailable); + REGISTER_MESSAGE(DownloadedSources); + REGISTER_MESSAGE(DownloadingVcpkgCeBundle); + REGISTER_MESSAGE(DownloadingVcpkgCeBundleLatest); + REGISTER_MESSAGE(EmptyLicenseExpression); + REGISTER_MESSAGE(EnvStrFailedToExtract); + REGISTER_MESSAGE(ErrorDetectingCompilerInfo); + REGISTER_MESSAGE(ErrorIndividualPackagesUnsupported); + REGISTER_MESSAGE(ErrorInvalidClassicModeOption); + REGISTER_MESSAGE(ErrorInvalidManifestModeOption); + REGISTER_MESSAGE(ErrorMessageMustUsePrintError); + REGISTER_MESSAGE(ErrorMissingVcpkgRoot); + REGISTER_MESSAGE(ErrorNoVSInstance); + REGISTER_MESSAGE(ErrorNoVSInstanceAt); + REGISTER_MESSAGE(ErrorNoVSInstanceFullVersion); + REGISTER_MESSAGE(ErrorNoVSInstanceVersion); + REGISTER_MESSAGE(ErrorRequireBaseline); + REGISTER_MESSAGE(ErrorRequirePackagesList); + REGISTER_MESSAGE(ErrorUnableToDetectCompilerInfo); + REGISTER_MESSAGE(ErrorVcvarsUnsupported); + REGISTER_MESSAGE(ErrorVsCodeNotFound); + REGISTER_MESSAGE(ErrorVsCodeNotFoundPathExamined); + REGISTER_MESSAGE(ExcludedPackage); + REGISTER_MESSAGE(ExpectedCharacterHere); + REGISTER_MESSAGE(ExpectedFailOrSkip); + REGISTER_MESSAGE(ExpectedPortName); + REGISTER_MESSAGE(ExpectedTripletName); + REGISTER_MESSAGE(ExtendedDocumenationAtUrl); + REGISTER_MESSAGE(FailedToProvisionCe); + REGISTER_MESSAGE(FailedToRunToolToDetermineVersion); + REGISTER_MESSAGE(FailedToStoreBackToMirror); + REGISTER_MESSAGE(FailedToStoreBinaryCache); + REGISTER_MESSAGE(FailedVendorAuthentication); + REGISTER_MESSAGE(ForceSystemBinariesOnWeirdPlatforms); + REGISTER_MESSAGE(FormattedParseMessageExpression); + REGISTER_MESSAGE(FuzzExpectedOneOf); + REGISTER_MESSAGE(GenerateMsgErrorParsingFormatArgs); + REGISTER_MESSAGE(GenerateMsgIncorrectComment); + REGISTER_MESSAGE(GenerateMsgNoArgumentValue); + REGISTER_MESSAGE(GenerateMsgNoCommentValue); + REGISTER_MESSAGE(GitCommandFailed); + REGISTER_MESSAGE(GitStatusOutputExpectedFileName); + REGISTER_MESSAGE(GitStatusOutputExpectedNewLine); + REGISTER_MESSAGE(GitStatusOutputExpectedRenameOrNewline); + REGISTER_MESSAGE(GitStatusUnknownFileStatus); + REGISTER_MESSAGE(GitUnexpectedCommandOutput); + REGISTER_MESSAGE(HashFileFailureToRead); + REGISTER_MESSAGE(HeaderOnlyUsage); + REGISTER_MESSAGE(IllegalFeatures); + REGISTER_MESSAGE(IllegalPlatformSpec); + REGISTER_MESSAGE(InfoSetEnvVar); + REGISTER_MESSAGE(InstallingFromLocation); + REGISTER_MESSAGE(InstallingPackage); + REGISTER_MESSAGE(InstallWithSystemManager); + REGISTER_MESSAGE(InstallWithSystemManagerMono); + REGISTER_MESSAGE(InstallWithSystemManagerPkg); + REGISTER_MESSAGE(InvalidArgument); + REGISTER_MESSAGE(InvalidArgumentRequiresAbsolutePath); + REGISTER_MESSAGE(InvalidArgumentRequiresBaseUrl); + REGISTER_MESSAGE(InvalidArgumentRequiresBaseUrlAndToken); + REGISTER_MESSAGE(InvalidArgumentRequiresNoneArguments); + REGISTER_MESSAGE(InvalidArgumentRequiresOneOrTwoArguments); + REGISTER_MESSAGE(InvalidArgumentRequiresPathArgument); + REGISTER_MESSAGE(InvalidArgumentRequiresPrefix); + REGISTER_MESSAGE(InvalidArgumentRequiresSingleArgument); + REGISTER_MESSAGE(InvalidArgumentRequiresSingleStringArgument); + REGISTER_MESSAGE(InvalidArgumentRequiresSourceArgument); + REGISTER_MESSAGE(InvalidArgumentRequiresTwoOrThreeArguments); + REGISTER_MESSAGE(InvalidArgumentRequiresValidToken); + REGISTER_MESSAGE(InvalidFormatString); + REGISTER_MESSAGE(JsonErrorFailedToParse); + REGISTER_MESSAGE(JsonErrorFailedToRead); + REGISTER_MESSAGE(JsonErrorMustBeAnObject); + REGISTER_MESSAGE(LaunchingProgramFailed); + REGISTER_MESSAGE(LicenseExpressionContainsExtraPlus); + REGISTER_MESSAGE(LicenseExpressionContainsInvalidCharacter); + REGISTER_MESSAGE(LicenseExpressionContainsUnicode); + REGISTER_MESSAGE(LicenseExpressionDocumentRefUnsupported); + REGISTER_MESSAGE(LicenseExpressionExpectCompoundFoundParen); + REGISTER_MESSAGE(LicenseExpressionExpectCompoundFoundWith); + REGISTER_MESSAGE(LicenseExpressionExpectCompoundFoundWord); + REGISTER_MESSAGE(LicenseExpressionExpectCompoundOrWithFoundWord); + REGISTER_MESSAGE(LicenseExpressionExpectExceptionFoundCompound); + REGISTER_MESSAGE(LicenseExpressionExpectExceptionFoundEof); + REGISTER_MESSAGE(LicenseExpressionExpectExceptionFoundParen); + REGISTER_MESSAGE(LicenseExpressionExpectLicenseFoundCompound); + REGISTER_MESSAGE(LicenseExpressionExpectLicenseFoundEof); + REGISTER_MESSAGE(LicenseExpressionExpectLicenseFoundParen); + REGISTER_MESSAGE(LicenseExpressionImbalancedParens); + REGISTER_MESSAGE(LicenseExpressionUnknownException); + REGISTER_MESSAGE(LicenseExpressionUnknownLicense); + REGISTER_MESSAGE(LoadingCommunityTriplet); + REGISTER_MESSAGE(LoadingOverlayTriplet); + REGISTER_MESSAGE(LocalizedMessageMustNotContainIndents); + REGISTER_MESSAGE(LocalizedMessageMustNotEndWithNewline); + REGISTER_MESSAGE(MonoInstructions); + REGISTER_MESSAGE(MsiexecFailedToExtract); + REGISTER_MESSAGE(NoLocalizationForMessages); + REGISTER_MESSAGE(NoRegistryForPort); + REGISTER_MESSAGE(PackingVendorFailed); + REGISTER_MESSAGE(ParseControlErrorInfoInvalidFields); + REGISTER_MESSAGE(ParseControlErrorInfoMissingFields); + REGISTER_MESSAGE(ParseControlErrorInfoTypesEntry); + REGISTER_MESSAGE(ParseControlErrorInfoWhileLoading); + REGISTER_MESSAGE(ParseControlErrorInfoWrongTypeFields); + REGISTER_MESSAGE(PortNotInBaseline); + REGISTER_MESSAGE(ProcessorArchitectureMalformed); + REGISTER_MESSAGE(ProcessorArchitectureMissing); + REGISTER_MESSAGE(ProcessorArchitectureW6432Malformed); + REGISTER_MESSAGE(ProgramReturnedNonzeroExitCode); + REGISTER_MESSAGE(PushingVendorFailed); + REGISTER_MESSAGE(ReplaceSecretsError); + REGISTER_MESSAGE(RestoredPackage); + REGISTER_MESSAGE(RestoredPackagesFromVendor); + REGISTER_MESSAGE(ResultsHeader); + REGISTER_MESSAGE(SettingEnvVar); + REGISTER_MESSAGE(SourceFieldPortNameMismatch); + REGISTER_MESSAGE(StoredBinaryCache); + REGISTER_MESSAGE(SystemApiErrorMessage); + REGISTER_MESSAGE(ToolFetchFailed); + REGISTER_MESSAGE(ToolInWin10); + REGISTER_MESSAGE(UnexpectedErrorDuringBulkDownload); + REGISTER_MESSAGE(UnexpectedToolOutput); + REGISTER_MESSAGE(UnknownBaselineFileContent); + REGISTER_MESSAGE(UnknownBinaryProviderType); + REGISTER_MESSAGE(UnknownTool); + REGISTER_MESSAGE(UnknownVariablesInTemplate); + REGISTER_MESSAGE(UnsupportedSystemName); + REGISTER_MESSAGE(UnsupportedToolchain); + REGISTER_MESSAGE(UpdateBaselineAddBaselineNoManifest); + REGISTER_MESSAGE(UpdateBaselineLocalGitError); + REGISTER_MESSAGE(UpdateBaselineNoConfiguration); + REGISTER_MESSAGE(UpdateBaselineNoExistingBuiltinBaseline); + REGISTER_MESSAGE(UpdateBaselineNoUpdate); + REGISTER_MESSAGE(UpdateBaselineRemoteGitError); + REGISTER_MESSAGE(UpdateBaselineUpdatedBaseline); + REGISTER_MESSAGE(UploadedBinaries); + REGISTER_MESSAGE(UploadedPackagesToVendor); + REGISTER_MESSAGE(UploadingBinariesToVendor); + REGISTER_MESSAGE(UploadingBinariesUsingVendor); + REGISTER_MESSAGE(UseEnvVar); + REGISTER_MESSAGE(UsingCommunityTriplet); + REGISTER_MESSAGE(UsingManifestAt); + REGISTER_MESSAGE(VcpkgCeIsExperimental); + REGISTER_MESSAGE(VcpkgDisallowedClassicMode); + REGISTER_MESSAGE(VcpkgHasCrashed); + REGISTER_MESSAGE(VcpkgInvalidCommand); + REGISTER_MESSAGE(VcpkgSendMetricsButDisabled); + REGISTER_MESSAGE(VersionCommandHeader); + REGISTER_MESSAGE(VersionConstraintViolated); + REGISTER_MESSAGE(VersionInvalidDate); + REGISTER_MESSAGE(VersionInvalidRelaxed); + REGISTER_MESSAGE(VersionInvalidSemver); + REGISTER_MESSAGE(VersionSpecMismatch); + REGISTER_MESSAGE(VSExaminedInstances); + REGISTER_MESSAGE(VSExaminedPaths); + REGISTER_MESSAGE(VSNoInstances); + REGISTER_MESSAGE(WaitingForChildrenToExit); + REGISTER_MESSAGE(WaitingToTakeFilesystemLock); + REGISTER_MESSAGE(WarningMessageMustUsePrintWarning); + REGISTER_MESSAGE(WarningsTreatedAsErrors); } diff --git a/src/vcpkg/base/parse.cpp b/src/vcpkg/base/parse.cpp index e32495908..0906919d8 100644 --- a/src/vcpkg/base/parse.cpp +++ b/src/vcpkg/base/parse.cpp @@ -5,24 +5,6 @@ #include #include -using namespace vcpkg; - -namespace -{ - DECLARE_AND_REGISTER_MESSAGE(WarningsTreatedAsErrors, (), "", "previous warnings being interpreted as errors"); - - DECLARE_AND_REGISTER_MESSAGE(FormattedParseMessageExpression, - (msg::value), - "Example of {value} is 'x64 & windows'", - "on expression: {value}"); - - DECLARE_AND_REGISTER_MESSAGE( - ExpectedCharacterHere, - (msg::expected), - "{expected} is a locale-invariant delimiter; for example, the ':' or '=' in 'zlib:x64-windows=skip'", - "expected '{expected}' here"); -} - namespace vcpkg { static void advance_rowcol(char32_t ch, int& row, int& column) diff --git a/src/vcpkg/base/strings.cpp b/src/vcpkg/base/strings.cpp index ef3cb5b1c..779a18028 100644 --- a/src/vcpkg/base/strings.cpp +++ b/src/vcpkg/base/strings.cpp @@ -18,14 +18,6 @@ using namespace vcpkg; -namespace -{ - DECLARE_AND_REGISTER_MESSAGE(InvalidFormatString, - (msg::actual), - "{actual} is the provided format string", - "invalid format string: {actual}"); -} - vcpkg::ExpectedL vcpkg::details::api_stable_format_impl(StringView sv, void (*cb)(void*, std::string&, StringView), void* user) diff --git a/src/vcpkg/base/system.cpp b/src/vcpkg/base/system.cpp index 8501d77ac..7ee4ea399 100644 --- a/src/vcpkg/base/system.cpp +++ b/src/vcpkg/base/system.cpp @@ -19,26 +19,6 @@ extern char** environ; #endif -namespace -{ - namespace msg = vcpkg::msg; - DECLARE_AND_REGISTER_MESSAGE(ProcessorArchitectureW6432Malformed, - (msg::arch), - "", - "Failed to parse %PROCESSOR_ARCHITEW6432% ({arch}) as a valid CPU architecture. " - "Falling back to %PROCESSOR_ARCHITECTURE%."); - - DECLARE_AND_REGISTER_MESSAGE(ProcessorArchitectureMissing, - (), - "", - "The required environment variable %PROCESSOR_ARCHITECTURE% is missing."); - - DECLARE_AND_REGISTER_MESSAGE(ProcessorArchitectureMalformed, - (msg::arch), - "", - "Failed to parse %PROCESSOR_ARCHITECTURE% ({arch}) as a valid CPU architecture."); -} - namespace vcpkg { long get_process_id() diff --git a/src/vcpkg/base/system.process.cpp b/src/vcpkg/base/system.process.cpp index 940947767..d04409e85 100644 --- a/src/vcpkg/base/system.process.cpp +++ b/src/vcpkg/base/system.process.cpp @@ -27,19 +27,6 @@ namespace { using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE(WaitingForChildrenToExit, (), "", "Waiting for child processes to exit..."); - DECLARE_AND_REGISTER_MESSAGE(LaunchingProgramFailed, - (msg::tool_name), - "A platform API call failure message is appended after this", - "Launching {tool_name}:"); - DECLARE_AND_REGISTER_MESSAGE(ProgramReturnedNonzeroExitCode, - (msg::tool_name, msg::exit_code), - "The program's console output is appended after this.", - "{tool_name} failed with exit code: ({exit_code})."); - DECLARE_AND_REGISTER_MESSAGE(SystemApiErrorMessage, - (msg::system_api, msg::exit_code, msg::error_msg), - "", - "calling {system_api} failed with {exit_code} ({error_msg})"); #if defined(_WIN32) using error_value_type = unsigned long; diff --git a/src/vcpkg/binarycaching.cpp b/src/vcpkg/binarycaching.cpp index dc7ff5f3d..550970e92 100644 --- a/src/vcpkg/binarycaching.cpp +++ b/src/vcpkg/binarycaching.cpp @@ -27,141 +27,6 @@ using namespace vcpkg; namespace { - DECLARE_AND_REGISTER_MESSAGE(AttemptingToFetchPackagesFromVendor, - (msg::count, msg::vendor), - "", - "Attempting to fetch {count} package(s) from {vendor}"); - DECLARE_AND_REGISTER_MESSAGE( - AuthenticationMayRequireManualAction, - (msg::vendor), - "", - "One or more {vendor} credential providers requested manual action. Add the binary source " - "'interactive' to allow interactivity."); - DECLARE_AND_REGISTER_MESSAGE(CompressFolderFailed, (msg::path), "", "Failed to compress folder '{path}':"); - DECLARE_AND_REGISTER_MESSAGE( - DefaultPathToBinaries, - (msg::path), - "", - "Based on your system settings, the default path to store binaries is \n '{path}'. This consults " - "%LOCALAPPDATA%/%APPDATA% on Windows and $XDG_CACHE_HOME or $HOME on other platforms."); - DECLARE_AND_REGISTER_MESSAGE(ExtendedDocumenationAtUrl, - (msg::url), - "", - "Extended documentation available at '{url}'."); - DECLARE_AND_REGISTER_MESSAGE(FailedToStoreBinaryCache, - (msg::path, msg::error_msg), - "", - "Failed to store binary cache '{path}':'{error_msg}'"); - DECLARE_AND_REGISTER_MESSAGE( - FailedVendorAuthentication, - (msg::vendor, msg::url), - "", - "One or more {vendor} credential providers failed to authenticate. See '{url}' for more details " - "on how to provide credentials."); - DECLARE_AND_REGISTER_MESSAGE(InvalidArgument, (), "", "invalid argument"); - DECLARE_AND_REGISTER_MESSAGE( - InvalidArgumentRequiresAbsolutePath, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' path arguments for binary config strings must be absolute"); - DECLARE_AND_REGISTER_MESSAGE( - InvalidArgumentRequiresBaseUrl, - (msg::base_url, msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires a {base_url} base url as the first argument"); - DECLARE_AND_REGISTER_MESSAGE( - InvalidArgumentRequiresBaseUrlAndToken, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires at least a base-url and a SAS token"); - DECLARE_AND_REGISTER_MESSAGE(InvalidArgumentRequiresNoneArguments, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' does not take arguments"); - DECLARE_AND_REGISTER_MESSAGE(InvalidArgumentRequiresOneOrTwoArguments, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires 1 or 2 arguments"); - DECLARE_AND_REGISTER_MESSAGE( - InvalidArgumentRequiresPathArgument, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires at least one path argument"); - DECLARE_AND_REGISTER_MESSAGE(InvalidArgumentRequiresPrefix, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires at least one prefix"); - DECLARE_AND_REGISTER_MESSAGE( - InvalidArgumentRequiresSingleArgument, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' does not take more than 1 argument"); - DECLARE_AND_REGISTER_MESSAGE(InvalidArgumentRequiresSingleStringArgument, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' expects a single string argument"); - DECLARE_AND_REGISTER_MESSAGE( - InvalidArgumentRequiresSourceArgument, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires at least one source argument"); - DECLARE_AND_REGISTER_MESSAGE(InvalidArgumentRequiresTwoOrThreeArguments, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires 2 or 3 arguments"); - DECLARE_AND_REGISTER_MESSAGE(InvalidArgumentRequiresValidToken, - (msg::binary_source), - "", - "invalid argument: binary config '{binary_source}' requires a SAS token without a " - "preceeding '?' as the second argument"); - DECLARE_AND_REGISTER_MESSAGE(PackingVendorFailed, - (msg::vendor), - "", - "Packing {vendor} failed. Use --debug for more information."); - DECLARE_AND_REGISTER_MESSAGE(PushingVendorFailed, - (msg::vendor, msg::path), - "", - "Pushing {vendor} to '{path}' failed. Use --debug for more information."); - DECLARE_AND_REGISTER_MESSAGE(ReplaceSecretsError, - (msg::error_msg), - "", - "Replace secretes produced the following error: '{error_msg}'"); - DECLARE_AND_REGISTER_MESSAGE(RestoredPackage, (msg::path), "", "Restored package from '{path}'"); - DECLARE_AND_REGISTER_MESSAGE( - RestoredPackagesFromVendor, - (msg::count, msg::elapsed, msg::value), - "{value} may be either a 'vendor' like 'Azure' or 'NuGet', or a file path like C:\\example or /usr/example", - "Restored {count} package(s) from {value} in {elapsed}. Use --debug to see more details."); - DECLARE_AND_REGISTER_MESSAGE(StoredBinaryCache, (msg::path), "", "Stored binary cache: '{path}'"); - DECLARE_AND_REGISTER_MESSAGE(UnknownBinaryProviderType, - (), - "", - "unknown binary provider type: valid providers are 'clear', 'default', 'nuget', " - "'nugetconfig','nugettimeout', 'interactive', 'x-azblob', 'x-gcs', 'x-aws', " - "'x-aws-config', 'http', and 'files'"); - DECLARE_AND_REGISTER_MESSAGE( - UnknownVariablesInTemplate, - (msg::value, msg::list), - "{value} is the value provided by the user and {list} a list of unknown variables seperated by comma", - "invalid argument: url template '{value}' contains unknown variables: {list}"); - DECLARE_AND_REGISTER_MESSAGE(UploadedBinaries, - (msg::count, msg::vendor), - "", - "Uploaded binaries to '{count}' '{vendor}'."); - DECLARE_AND_REGISTER_MESSAGE(UploadedPackagesToVendor, - (msg::count, msg::elapsed, msg::vendor), - "", - "Uploaded {count} package(s) to {vendor} in {elapsed}"); - - DECLARE_AND_REGISTER_MESSAGE(UploadingBinariesToVendor, - (msg::spec, msg::vendor, msg::path), - "", - "Uploading binaries for '{spec}' to '{vendor}' source '{path}'."); - DECLARE_AND_REGISTER_MESSAGE(UploadingBinariesUsingVendor, - (msg::spec, msg::vendor, msg::path), - "", - "Uploading binaries for '{spec}' using '{vendor}' '{path}'."); - struct ConfigSegmentsParser : ParserBase { using ParserBase::ParserBase; diff --git a/src/vcpkg/build.cpp b/src/vcpkg/build.cpp index e82d6dbcf..c5413fba0 100644 --- a/src/vcpkg/build.cpp +++ b/src/vcpkg/build.cpp @@ -53,179 +53,6 @@ namespace }; static const NullBuildLogsRecorder null_build_logs_recorder_instance; - - DECLARE_AND_REGISTER_MESSAGE(BuildResultSummaryHeader, - (msg::triplet), - "Displayed before a list of a summary installation results.", - "SUMMARY FOR {triplet}"); - DECLARE_AND_REGISTER_MESSAGE(BuildResultSummaryLine, - (msg::build_result, msg::count), - "Displayed to show a count of results of a build_result in a summary.", - "{build_result}: {count}"); - - DECLARE_AND_REGISTER_MESSAGE( - BuildResultSucceeded, - (), - "Printed after the name of an installed entity to indicate that it was built and installed successfully.", - "SUCCEEDED"); - - DECLARE_AND_REGISTER_MESSAGE(BuildResultBuildFailed, - (), - "Printed after the name of an installed entity to indicate that it failed to build.", - "BUILD_FAILED"); - - DECLARE_AND_REGISTER_MESSAGE( - BuildResultFileConflicts, - (), - "Printed after the name of an installed entity to indicate that it conflicts with something already installed", - "FILE_CONFLICTS"); - - DECLARE_AND_REGISTER_MESSAGE(BuildResultPostBuildChecksFailed, - (), - "Printed after the name of an installed entity to indicate that it built " - "successfully, but that it failed post build checks.", - "POST_BUILD_CHECKS_FAILED"); - - DECLARE_AND_REGISTER_MESSAGE(BuildResultCascadeDueToMissingDependencies, - (), - "Printed after the name of an installed entity to indicate that it could not attempt " - "to be installed because one of its transitive dependencies failed to install.", - "CASCADED_DUE_TO_MISSING_DEPENDENCIES"); - - DECLARE_AND_REGISTER_MESSAGE(BuildResultExcluded, - (), - "Printed after the name of an installed entity to indicate that the user explicitly " - "requested it not be installed.", - "EXCLUDED"); - - DECLARE_AND_REGISTER_MESSAGE( - BuildResultCacheMissing, - (), - "Printed after the name of an installed entity to indicate that it was not present in the binary cache when " - "the user has requested that things may only be installed from the cache rather than built.", - "CACHE_MISSING"); - - DECLARE_AND_REGISTER_MESSAGE(BuildResultDownloaded, - (), - "Printed after the name of an installed entity to indicate that it was successfully " - "downloaded but no build or install was requested.", - "DOWNLOADED"); - - DECLARE_AND_REGISTER_MESSAGE( - BuildResultRemoved, - (), - "Printed after the name of an uninstalled entity to indicate that it was successfully uninstalled.", - "REMOVED"); - - DECLARE_AND_REGISTER_MESSAGE(BuildingPackageFailed, - (msg::spec, msg::build_result), - "", - "building {spec} failed with: {build_result}"); - DECLARE_AND_REGISTER_MESSAGE( - BuildingPackageFailedDueToMissingDeps, - (), - "Printed after BuildingPackageFailed, and followed by a list of dependencies that were missing.", - "due to the following missing dependencies:"); - - DECLARE_AND_REGISTER_MESSAGE(BuildAlreadyInstalled, - (msg::spec), - "", - "{spec} is already installed; please remove {spec} before attempting to build it."); - - DECLARE_AND_REGISTER_MESSAGE(SourceFieldPortNameMismatch, - (msg::package_name, msg::path), - "{package_name} and {path} are both names of installable ports/packages. 'Source', " - "'CONTROL', 'vcpkg.json', and 'name' references are locale-invariant.", - "The 'Source' field inside the CONTROL file, or \"name\" field inside the vcpkg.json " - "file has the name {package_name} and does not match the port directory {path}."); - - DECLARE_AND_REGISTER_MESSAGE(BuildDependenciesMissing, - (), - "", - "The build command requires all dependencies to be already installed.\nThe following " - "dependencies are missing:"); - - DECLARE_AND_REGISTER_MESSAGE( - BuildTroubleshootingMessage1, - (), - "First part of build troubleshooting message, printed before the URI to look for existing bugs.", - "Please ensure you're using the latest port files with `git pull` and `vcpkg " - "update`.\nThen check for known issues at:"); - DECLARE_AND_REGISTER_MESSAGE(BuildTroubleshootingMessage2, - (), - "Second part of build troubleshooting message, printed after the URI to look for " - "existing bugs but before the URI to file one.", - "You can submit a new issue at:"); - DECLARE_AND_REGISTER_MESSAGE( - BuildTroubleshootingMessage3, - (msg::package_name), - "Third part of build troubleshooting message, printed after the URI to file a bug but " - "before version information about vcpkg itself.", - "Include '[{package_name}] Build error' in your bug report title, the following version information in your " - "bug description, and attach any relevant failure logs from above."); - DECLARE_AND_REGISTER_MESSAGE(BuildTroubleshootingMessage4, - (msg::path), - "Fourth optional part of build troubleshooting message, printed after the version" - "information about vcpkg itself.", - "You can also use the prefilled template from {path}."); - DECLARE_AND_REGISTER_MESSAGE(DetectCompilerHash, - (msg::triplet), - "", - "Detecting compiler hash for triplet \"{triplet}\"..."); - DECLARE_AND_REGISTER_MESSAGE(UseEnvVar, - (msg::env_var), - "An example of env_var is \"HTTP(S)_PROXY\"" - "'--' at the beginning must be preserved", - "-- Using {env_var} in environment variables."); - DECLARE_AND_REGISTER_MESSAGE(SettingEnvVar, - (msg::env_var, msg::url), - "An example of env_var is \"HTTP(S)_PROXY\"" - "'--' at the beginning must be preserved", - "-- Setting \"{env_var}\" environment variables to \"{url}\"."); - DECLARE_AND_REGISTER_MESSAGE(AutoSettingEnvVar, - (msg::env_var, msg::url), - "An example of env_var is \"HTTP(S)_PROXY\"" - "'--' at the beginning must be preserved", - "-- Automatically setting {env_var} environment variables to \"{url}\"."); - DECLARE_AND_REGISTER_MESSAGE(ErrorDetectingCompilerInfo, - (msg::path), - "", - "while detecting compiler information:\nThe log file content at \"{path}\" is:"); - DECLARE_AND_REGISTER_MESSAGE( - ErrorUnableToDetectCompilerInfo, - (), - "failure output will be displayed at the top of this", - "vcpkg was unable to detect the active compiler's information. See above for the CMake failure output."); - DECLARE_AND_REGISTER_MESSAGE( - UsingCommunityTriplet, - (msg::triplet), - "'--' at the beginning must be preserved", - "-- Using community triplet {triplet}. This triplet configuration is not guaranteed to succeed."); - DECLARE_AND_REGISTER_MESSAGE(LoadingCommunityTriplet, - (msg::path), - "'-- [COMMUNITY]' at the beginning must be preserved", - "-- [COMMUNITY] Loading triplet configuration from: {path}"); - DECLARE_AND_REGISTER_MESSAGE(LoadingOverlayTriplet, - (msg::path), - "'-- [OVERLAY]' at the beginning must be preserved", - "-- [OVERLAY] Loading triplet configuration from: {path}"); - DECLARE_AND_REGISTER_MESSAGE(InstallingFromLocation, - (msg::path), - "'--' at the beginning must be preserved", - "-- Installing port from location: {path}"); - DECLARE_AND_REGISTER_MESSAGE( - UnsupportedToolchain, - (msg::triplet, msg::arch, msg::path, msg::list), - "example for {list} is 'x86, arm64'", - "in triplet {triplet}: Unable to find a valid toolchain for requested target architecture {arch}.\n" - "The selected Visual Studio instance is at: {path}\n" - "The available toolchain combinations are: {list}"); - - DECLARE_AND_REGISTER_MESSAGE(UnsupportedSystemName, - (msg::system_name), - "", - "Could not map VCPKG_CMAKE_SYSTEM_NAME '{system_name}' to a vcvarsall platform. " - "Supported system names are '', 'Windows' and 'WindowsStore'."); } namespace vcpkg diff --git a/src/vcpkg/ci-baseline.cpp b/src/vcpkg/ci-baseline.cpp index ac4d345e1..073af9523 100644 --- a/src/vcpkg/ci-baseline.cpp +++ b/src/vcpkg/ci-baseline.cpp @@ -8,33 +8,6 @@ using namespace vcpkg; -namespace -{ - DECLARE_AND_REGISTER_MESSAGE(ExpectedPortName, (), "", "expected a port name here"); - DECLARE_AND_REGISTER_MESSAGE(ExpectedTripletName, (), "", "expected a triplet name here"); - DECLARE_AND_REGISTER_MESSAGE(ExpectedFailOrSkip, (), "", "expected 'fail', 'skip', or 'pass' here"); - DECLARE_AND_REGISTER_MESSAGE(UnknownBaselineFileContent, - (), - "", - "unrecognizable baseline entry; expected 'port:triplet=(fail|skip|pass)'"); - - DECLARE_AND_REGISTER_MESSAGE( - CiBaselineRegression, - (msg::spec, msg::build_result, msg::path), - "", - "REGRESSION: {spec} failed with {build_result}. If expected, add {spec}=fail to {path}."); - - DECLARE_AND_REGISTER_MESSAGE(CiBaselineUnexpectedPass, - (msg::spec, msg::path), - "", - "PASSING, REMOVE FROM FAIL LIST: {spec} ({path})."); - - DECLARE_AND_REGISTER_MESSAGE(CiBaselineDisallowedCascade, - (msg::spec, msg::path), - "", - "REGRESSION: {spec} cascaded, but it is required to pass. ({path})."); -} - namespace vcpkg { TripletExclusions::TripletExclusions(const Triplet& triplet) : triplet(triplet), exclusions() { } diff --git a/src/vcpkg/cmakevars.cpp b/src/vcpkg/cmakevars.cpp index 186b53b76..a4b354217 100644 --- a/src/vcpkg/cmakevars.cpp +++ b/src/vcpkg/cmakevars.cpp @@ -266,13 +266,6 @@ endfunction() return dep_info_path; } - DECLARE_AND_REGISTER_MESSAGE(CommandFailed, - (msg::command_line), - "", - "command:\n" - "{command_line}\n" - "failed with the following results:"); - void TripletCMakeVarProvider::launch_and_split( const Path& script_path, std::vector>>& vars) const { diff --git a/src/vcpkg/commands.add-version.cpp b/src/vcpkg/commands.add-version.cpp index 102887e08..4aa7562c1 100644 --- a/src/vcpkg/commands.add-version.cpp +++ b/src/vcpkg/commands.add-version.cpp @@ -36,93 +36,6 @@ namespace Updated, NotUpdated }; - - DECLARE_AND_REGISTER_MESSAGE( - AddVersionSuggestNewVersionScheme, - (msg::new_scheme, msg::old_scheme, msg::package_name, msg::option), - "The -- before {option} must be preserved as they're part of the help message for the user.", - "Use the version scheme \"{new_scheme}\" instead of \"{old_scheme}\" in port " - "\"{package_name}\".\nUse --{option} to disable this check."); - DECLARE_AND_REGISTER_MESSAGE(AddVersionVersionAlreadyInFile, - (msg::version, msg::path), - "", - "version {version} is already in {path}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionAddedVersionToFile, - (msg::version, msg::path), - "", - "added version {version} to {path}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionNewFile, (), "", "(new file)"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionUncommittedChanges, - (msg::package_name), - "", - "there are uncommitted changes for {package_name}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionPortFilesShaUnchanged, - (msg::package_name, msg::version), - "", - "checked-in files for {package_name} are unchanged from version {version}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionCommitChangesReminder, (), "", "Did you remember to commit your changes?"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionNoFilesUpdated, (), "", "No files were updated"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionNoFilesUpdatedForPort, - (msg::package_name), - "", - "No files were updated for {package_name}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionPortFilesShaChanged, - (msg::package_name), - "", - "checked-in files for {package_name} have changed but the version was not updated"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionVersionIs, (msg::version), "", "version: {version}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionOldShaIs, - (msg::value), - "{value} is a 40-digit hexadecimal SHA", - "old SHA: {value}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionNewShaIs, - (msg::value), - "{value} is a 40-digit hexadecimal SHA", - "new SHA: {value}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionUpdateVersionReminder, - (), - "", - "Did you remember to update the version or port version?"); - DECLARE_AND_REGISTER_MESSAGE( - AddVersionOverwriteOptionSuggestion, - (msg::option), - "The -- before {option} must be preserved as they're part of the help message for the user.", - "Use --{option} to bypass this check"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionUnableToParseVersionsFile, - (msg::path), - "", - "unable to parse versions file {path}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionFileNotFound, (msg::path), "", "couldn't find required file {path}"); - DECLARE_AND_REGISTER_MESSAGE( - AddVersionIgnoringOptionAll, - (msg::option), - "The -- before {option} must be preserved as they're part of the help message for the user.", - "ignoring --{option} since a port name argument was provided"); - DECLARE_AND_REGISTER_MESSAGE( - AddVersionUseOptionAll, - (msg::command_name, msg::option), - "The -- before {option} must be preserved as they're part of the help message for the user.", - "{command_name} with no arguments requires passing --{option} to update all port versions at once"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionLoadPortFailed, (msg::package_name), "", "can't load port {package_name}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionPortHasImproperFormat, - (msg::package_name), - "", - "{package_name} is not properly formatted"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionFormatPortSuggestion, - (msg::command_line), - "", - "Run `{command_line}` to format the file"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionCommitResultReminder, (), "", "Don't forget to commit the result!"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionNoGitSha, - (msg::package_name), - "", - "can't obtain SHA for port {package_name}"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionPortDoesNotExist, (msg::package_name), "", "{package_name} does not exist"); - DECLARE_AND_REGISTER_MESSAGE(AddVersionDetectLocalChangesError, - (), - "", - "skipping detection of local changes due to unexpected format in git status output"); - using VersionGitTree = std::pair; void insert_version_to_json_object(Json::Object& obj, const Version& version, StringLiteral version_field) diff --git a/src/vcpkg/commands.add.cpp b/src/vcpkg/commands.add.cpp index 2fdeff672..28d6cce0f 100644 --- a/src/vcpkg/commands.add.cpp +++ b/src/vcpkg/commands.add.cpp @@ -26,27 +26,6 @@ namespace {{}, {}}, nullptr, }; - - DECLARE_AND_REGISTER_MESSAGE(AddTripletExpressionNotAllowed, - (msg::package_name, msg::triplet), - "", - "triplet expressions are not allowed here. You may want to change " - "`{package_name}:{triplet}` to `{package_name}` instead."); - DECLARE_AND_REGISTER_MESSAGE(AddFirstArgument, - (msg::command_line), - "", - "The first argument to '{command_line}' must be 'artifact' or 'port'."); - - DECLARE_AND_REGISTER_MESSAGE(AddPortSucceded, (), "", "Succeeded in adding ports to vcpkg.json file."); - DECLARE_AND_REGISTER_MESSAGE(AddPortRequiresManifest, - (msg::command_line), - "", - "'{command_line}' requires an active manifest file."); - - DECLARE_AND_REGISTER_MESSAGE(AddArtifactOnlyOne, - (msg::command_line), - "", - "'{command_line}' can only add one artifact at a time."); } namespace vcpkg::Commands diff --git a/src/vcpkg/commands.ci.cpp b/src/vcpkg/commands.ci.cpp index fec98e677..734e19005 100644 --- a/src/vcpkg/commands.ci.cpp +++ b/src/vcpkg/commands.ci.cpp @@ -81,18 +81,6 @@ namespace private: Path base_path; }; - - DECLARE_AND_REGISTER_MESSAGE( - CiBaselineRegressionHeader, - (), - "Printed before a series of CiBaselineRegression and/or CiBaselineUnexpectedPass messages.", - "REGRESSIONS:"); - - DECLARE_AND_REGISTER_MESSAGE( - CiBaselineAllowUnexpectedPassingRequiresBaseline, - (), - "", - "--allow-unexpected-passing can only be used if a baseline is provided via --ci-baseline."); } namespace vcpkg::Commands::CI diff --git a/src/vcpkg/commands.edit.cpp b/src/vcpkg/commands.edit.cpp index 1ff2d653f..639743a9d 100644 --- a/src/vcpkg/commands.edit.cpp +++ b/src/vcpkg/commands.edit.cpp @@ -11,37 +11,18 @@ #include -namespace -{ - using namespace vcpkg; - - DECLARE_AND_REGISTER_MESSAGE(EnvStrFailedToExtract, (), "", "could not expand the environment string:"); - - DECLARE_AND_REGISTER_MESSAGE( - ErrorVsCodeNotFound, - (msg::env_var), - "", - "Visual Studio Code was not found and the environment variable '{env_var}' is not set or invalid."); - - DECLARE_AND_REGISTER_MESSAGE(ErrorVsCodeNotFoundPathExamined, (), "", "The following paths were examined:"); - - DECLARE_AND_REGISTER_MESSAGE(InfoSetEnvVar, - (msg::env_var), - "In this context 'editor' means IDE", - "You can also set the environment variable '{env_var}' to your editor of choice."); -} - #if defined(_WIN32) namespace { - std::vector find_from_registry() + using namespace vcpkg; + std::vector find_from_registry() { - std::vector output; + std::vector output; struct RegKey { HKEY root; - vcpkg::StringLiteral subkey; + StringLiteral subkey; } REGKEYS[] = { {HKEY_LOCAL_MACHINE, R"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)"}, @@ -57,11 +38,11 @@ namespace for (auto&& keypath : REGKEYS) { - const vcpkg::Optional code_installpath = - vcpkg::get_registry_string(keypath.root, keypath.subkey, "InstallLocation"); + const Optional code_installpath = + get_registry_string(keypath.root, keypath.subkey, "InstallLocation"); if (const auto c = code_installpath.get()) { - const vcpkg::Path install_path = *c; + const Path install_path = *c; output.push_back(install_path / "Code - Insiders.exe"); output.push_back(install_path / "Code.exe"); } @@ -71,7 +52,7 @@ namespace std::string expand_environment_strings(const std::string& input) { - const auto widened = vcpkg::Strings::to_utf16(input); + const auto widened = Strings::to_utf16(input); std::wstring result; result.resize(result.capacity()); bool done; @@ -79,7 +60,7 @@ namespace { if (result.size() == ULONG_MAX) { - vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); // integer overflow + Checks::exit_fail(VCPKG_LINE_INFO); // integer overflow } const auto required_size = @@ -88,13 +69,13 @@ namespace { msg::println_error( msg::format(msgEnvStrFailedToExtract).append_raw('\n').append(LocalizedString::from_raw(input))); - vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + Checks::exit_fail(VCPKG_LINE_INFO); } done = required_size <= result.size() + 1; result.resize(required_size - 1); } while (!done); - return vcpkg::Strings::to_utf8(result); + return Strings::to_utf8(result); } } #endif diff --git a/src/vcpkg/commands.generate-message-map.cpp b/src/vcpkg/commands.generate-message-map.cpp index e5b56684e..77aebd9ae 100644 --- a/src/vcpkg/commands.generate-message-map.cpp +++ b/src/vcpkg/commands.generate-message-map.cpp @@ -4,58 +4,6 @@ #include -namespace -{ - namespace msg = vcpkg::msg; - DECLARE_AND_REGISTER_MESSAGE(AllFormatArgsUnbalancedBraces, - (msg::value), - "example of {value} is 'foo bar {'", - "unbalanced brace in format string \"{value}\""); - DECLARE_AND_REGISTER_MESSAGE(AllFormatArgsRawArgument, - (msg::value), - "example of {value} is 'foo {} bar'", - "format string \"{value}\" contains a raw format argument"); - - DECLARE_AND_REGISTER_MESSAGE( - ErrorMessageMustUsePrintError, - (msg::value), - "{value} is is a localized message name like ErrorMessageMustUsePrintError", - "The message named {value} starts with error:, it must be changed to prepend ErrorMessage in code instead."); - DECLARE_AND_REGISTER_MESSAGE(WarningMessageMustUsePrintWarning, - (msg::value), - "{value} is is a localized message name like WarningMessageMustUsePrintWarning", - "The message named {value} starts with warning:, it must be changed to prepend " - "WarningMessage in code instead."); - DECLARE_AND_REGISTER_MESSAGE(LocalizedMessageMustNotContainIndents, - (msg::value), - "{value} is is a localized message name like LocalizedMessageMustNotContainIndents. " - "The 'LocalizedString::append_indent' part is locale-invariant.", - "The message named {value} contains what appears to be indenting which must be " - "changed to use LocalizedString::append_indent instead."); - DECLARE_AND_REGISTER_MESSAGE(LocalizedMessageMustNotEndWithNewline, - (msg::value), - "{value} is a localized message name like LocalizedMessageMustNotEndWithNewline", - "The message named {value} ends with a newline which should be added by formatting " - "rather than by localization."); - DECLARE_AND_REGISTER_MESSAGE(GenerateMsgErrorParsingFormatArgs, - (msg::value), - "example of {value} 'GenerateMsgNoComment'", - "parsing format string for {value}:"); - - DECLARE_AND_REGISTER_MESSAGE(GenerateMsgIncorrectComment, - (msg::value), - "example of {value} is 'GenerateMsgNoComment'", - R"(message {value} has an incorrect comment:)"); - DECLARE_AND_REGISTER_MESSAGE(GenerateMsgNoCommentValue, - (msg::value), - "example of {value} is 'arch'", - R"({{{value}}} was used in the message, but not commented.)"); - DECLARE_AND_REGISTER_MESSAGE(GenerateMsgNoArgumentValue, - (msg::value), - "example of {value} is 'arch'", - R"({{{value}}} was specified in a comment, but was not used in the message.)"); -} - namespace vcpkg::Commands { static constexpr StringLiteral OPTION_OUTPUT_COMMENTS = "output-comments"; diff --git a/src/vcpkg/commands.update-baseline.cpp b/src/vcpkg/commands.update-baseline.cpp index e91c84377..99972737d 100644 --- a/src/vcpkg/commands.update-baseline.cpp +++ b/src/vcpkg/commands.update-baseline.cpp @@ -6,36 +6,6 @@ #include #include -namespace -{ - using namespace vcpkg; - - DECLARE_AND_REGISTER_MESSAGE(UpdateBaselineNoConfiguration, - (), - "", - "neither `vcpkg.json` nor `vcpkg-configuration.json` exist to update."); - - DECLARE_AND_REGISTER_MESSAGE(UpdateBaselineNoExistingBuiltinBaseline, - (msg::option), - "", - "the manifest file currently does not contain a `builtin-baseline` field; in order to " - "add one, pass the --{option} switch."); - DECLARE_AND_REGISTER_MESSAGE( - UpdateBaselineAddBaselineNoManifest, - (msg::option), - "", - "the --{option} switch was passed, but there is no manifest file to add a `builtin-baseline` field to."); - - DECLARE_AND_REGISTER_MESSAGE(UpdateBaselineUpdatedBaseline, - (msg::url, msg::old_value, msg::new_value), - "example of {old_value}, {new_value} is '5507daa796359fe8d45418e694328e878ac2b82f'", - "updated registry '{url}': baseline '{old_value}' -> '{new_value}'"); - DECLARE_AND_REGISTER_MESSAGE(UpdateBaselineNoUpdate, - (msg::url, msg::value), - "example of {value} is '5507daa796359fe8d45418e694328e878ac2b82f'", - "registry '{url}' not updated: '{value}'"); -} - namespace vcpkg::Commands { static constexpr StringLiteral OPTION_ADD_INITIAL_BASELINE = "add-initial-baseline"; diff --git a/src/vcpkg/commands.version.cpp b/src/vcpkg/commands.version.cpp index fc5c67212..36b986207 100644 --- a/src/vcpkg/commands.version.cpp +++ b/src/vcpkg/commands.version.cpp @@ -9,13 +9,6 @@ namespace { using namespace vcpkg; - - DECLARE_AND_REGISTER_MESSAGE( - VersionCommandHeader, - (msg::version), - "", - "vcpkg package management program version {version}\n\nSee LICENSE.txt for license information."); - constexpr StringLiteral version_init = VCPKG_BASE_VERSION_AS_STRING "-" VCPKG_VERSION_AS_STRING #ifndef NDEBUG "-debug" diff --git a/src/vcpkg/configuration.cpp b/src/vcpkg/configuration.cpp index 0e7a2d61b..f2ea77a34 100644 --- a/src/vcpkg/configuration.cpp +++ b/src/vcpkg/configuration.cpp @@ -10,15 +10,6 @@ namespace { using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE(UpdateBaselineRemoteGitError, - (msg::url), - "", - "git failed to fetch remote repository '{url}'"); - DECLARE_AND_REGISTER_MESSAGE(UpdateBaselineLocalGitError, - (msg::path), - "", - "git failed to parse HEAD for the local vcpkg registry at '{path}'"); - struct RegistryConfigDeserializer : Json::IDeserializer { constexpr static StringLiteral KIND = "kind"; diff --git a/src/vcpkg/configure-environment.cpp b/src/vcpkg/configure-environment.cpp index eb57fbcbd..b470fd3b0 100644 --- a/src/vcpkg/configure-environment.cpp +++ b/src/vcpkg/configure-environment.cpp @@ -18,20 +18,6 @@ namespace { using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE(FailedToProvisionCe, (), "", "Failed to provision vcpkg-ce."); - DECLARE_AND_REGISTER_MESSAGE(VcpkgCeIsExperimental, - (), - "", - "vcpkg-ce ('configure environment') is experimental and may change at any time."); - DECLARE_AND_REGISTER_MESSAGE(DownloadingVcpkgCeBundle, - (msg::version), - "", - "Downloading vcpkg-ce bundle {version}..."); - DECLARE_AND_REGISTER_MESSAGE(DownloadingVcpkgCeBundleLatest, - (), - "This message is normally displayed only in development.", - "Downloading latest vcpkg-ce bundle..."); - #if !defined(VCPKG_ARTIFACTS_PATH) void extract_ce_tarball(const VcpkgPaths& paths, const Path& ce_tarball, diff --git a/src/vcpkg/dependencies.cpp b/src/vcpkg/dependencies.cpp index b52563162..f1c6ebe9e 100644 --- a/src/vcpkg/dependencies.cpp +++ b/src/vcpkg/dependencies.cpp @@ -20,12 +20,6 @@ namespace vcpkg::Dependencies { namespace { - DECLARE_AND_REGISTER_MESSAGE(VersionConstraintViolated, - (msg::spec, msg::expected_version, msg::actual_version), - "", - "dependency {spec} was expected to be at least version " - "{expected_version}, but is currently {actual_version}."); - struct ClusterGraph; struct ClusterInstalled diff --git a/src/vcpkg/install.cpp b/src/vcpkg/install.cpp index 0b7635e52..8f02d240c 100644 --- a/src/vcpkg/install.cpp +++ b/src/vcpkg/install.cpp @@ -27,45 +27,6 @@ #include -namespace -{ - using namespace vcpkg; - DECLARE_AND_REGISTER_MESSAGE(ResultsHeader, (), "Displayed before a list of installation results.", "RESULTS"); - DECLARE_AND_REGISTER_MESSAGE(CmakeTargetsExcluded, - (msg::count), - "", - "note: {count} additional targets are not displayed."); - DECLARE_AND_REGISTER_MESSAGE(AlreadyInstalledNotHead, - (msg::spec), - "'HEAD' means the most recent version of source code", - "{spec} is already installed -- not building from HEAD"); - DECLARE_AND_REGISTER_MESSAGE(AlreadyInstalled, (msg::spec), "", "{spec} is already installed"); - DECLARE_AND_REGISTER_MESSAGE(BuildingPackage, (msg::spec), "", "Building {spec}..."); - DECLARE_AND_REGISTER_MESSAGE(BuildingFromHead, - (msg::spec), - "'HEAD' means the most recent version of source code", - "Building {spec} from HEAD..."); - DECLARE_AND_REGISTER_MESSAGE(DownloadedSources, (msg::spec), "", "Downloaded sources for {spec}"); - DECLARE_AND_REGISTER_MESSAGE(ExcludedPackage, (msg::spec), "", "Excluded {spec}"); - DECLARE_AND_REGISTER_MESSAGE(InstallingPackage, - (msg::action_index, msg::count, msg::spec), - "", - "Installing {action_index}/{count} {spec}..."); - DECLARE_AND_REGISTER_MESSAGE(HeaderOnlyUsage, - (msg::package_name), - "'header' refers to C/C++ .h files", - "{package_name} is header-only and can be used from CMake via:"); - DECLARE_AND_REGISTER_MESSAGE( - CMakeTargetsUsageHeuristicMessage, - (), - "Displayed after CMakeTargetsUsage; the # must be kept at the beginning so that the message remains a comment.", - "# this is heuristically generated, and may not be correct"); - DECLARE_AND_REGISTER_MESSAGE(CMakeTargetsUsage, - (msg::package_name), - "'targets' are a CMake and Makefile concept", - "{package_name} provides CMake targets:"); -} - namespace vcpkg::Install { using namespace vcpkg; @@ -875,31 +836,6 @@ namespace vcpkg::Install return ret; } - DECLARE_AND_REGISTER_MESSAGE( - ErrorIndividualPackagesUnsupported, - (), - "", - "In manifest mode, `vcpkg install` does not support individual package arguments.\nTo install " - "additional " - "packages, edit vcpkg.json and then run `vcpkg install` without any package arguments."); - - DECLARE_AND_REGISTER_MESSAGE(ErrorRequirePackagesList, - (), - "", - "`vcpkg install` requires a list of packages to install in classic mode."); - - DECLARE_AND_REGISTER_MESSAGE(ErrorInvalidClassicModeOption, - (msg::option), - "", - "The option --{option} is not supported in classic mode and no manifest was found."); - - DECLARE_AND_REGISTER_MESSAGE(UsingManifestAt, (msg::path), "", "Using manifest file at {path}."); - - DECLARE_AND_REGISTER_MESSAGE(ErrorInvalidManifestModeOption, - (msg::option), - "", - "The option --{option} is not supported in manifest mode."); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet, diff --git a/src/vcpkg/packagespec.cpp b/src/vcpkg/packagespec.cpp index c8f9798f9..021bbe8df 100644 --- a/src/vcpkg/packagespec.cpp +++ b/src/vcpkg/packagespec.cpp @@ -42,9 +42,6 @@ namespace vcpkg return left.name() == right.name() && left.triplet() == right.triplet(); } - DECLARE_AND_REGISTER_MESSAGE(IllegalPlatformSpec, (), "", "Platform qualifier is not allowed in this context"); - DECLARE_AND_REGISTER_MESSAGE(IllegalFeatures, (), "", "List of features is not allowed in this context"); - static InternalFeatureSet normalize_feature_list(View fs, ImplicitDefault id) { InternalFeatureSet ret; diff --git a/src/vcpkg/paragraphs.cpp b/src/vcpkg/paragraphs.cpp index 15548ebc3..eb34c4cb6 100644 --- a/src/vcpkg/paragraphs.cpp +++ b/src/vcpkg/paragraphs.cpp @@ -13,28 +13,6 @@ static std::atomic g_load_ports_stats(0); -namespace -{ - using namespace vcpkg; - - DECLARE_AND_REGISTER_MESSAGE(ParseControlErrorInfoWhileLoading, - (msg::path), - "Error messages are is printed after this.", - "while loading {path}:"); - - DECLARE_AND_REGISTER_MESSAGE(ParseControlErrorInfoInvalidFields, (), "", "The following fields were not expected:"); - DECLARE_AND_REGISTER_MESSAGE(ParseControlErrorInfoMissingFields, (), "", "The following fields were missing:"); - DECLARE_AND_REGISTER_MESSAGE(ParseControlErrorInfoWrongTypeFields, - (), - "", - "The following fields had the wrong types:"); - DECLARE_AND_REGISTER_MESSAGE(ParseControlErrorInfoTypesEntry, - (msg::value, msg::expected), - "{value} is the name of a field in an on-disk file, {expected} is a short description " - "of what it should be like 'a non-negative integer' (which isn't localized yet)", - "{value} was expected to be {expected}"); -} - namespace vcpkg { void ParseControlErrorInfo::to_string(std::string& target) const diff --git a/src/vcpkg/portfileprovider.cpp b/src/vcpkg/portfileprovider.cpp index 175b123b1..17029ed47 100644 --- a/src/vcpkg/portfileprovider.cpp +++ b/src/vcpkg/portfileprovider.cpp @@ -88,13 +88,6 @@ namespace vcpkg::PortFileProvider return Util::fmap(m, [](const auto& p) { return p.second; }); } - DECLARE_AND_REGISTER_MESSAGE( - VersionSpecMismatch, - (msg::path, msg::expected_version, msg::actual_version), - "", - "Failed to load port because versions are inconsistent. The file \"{path}\" contains the version " - "{actual_version}, but the version database indicates that it should be {expected_version}."); - namespace { struct BaselineProviderImpl : IBaselineProvider diff --git a/src/vcpkg/registries.cpp b/src/vcpkg/registries.cpp index a2086f6f6..ab90bcd77 100644 --- a/src/vcpkg/registries.cpp +++ b/src/vcpkg/registries.cpp @@ -24,11 +24,6 @@ namespace static constexpr StringLiteral registry_versions_dir_name = "versions"; - DECLARE_AND_REGISTER_MESSAGE(PortNotInBaseline, - (msg::package_name), - "", - "the baseline does not contain an entry for port {package_name}"); - struct GitRegistry; struct GitRegistryEntry final : RegistryEntry @@ -215,13 +210,6 @@ namespace std::vector version_paths; }; - DECLARE_AND_REGISTER_MESSAGE(ErrorRequireBaseline, - (), - "", - "this vcpkg instance requires a manifest with a specified baseline in order to " - "interact with ports. Please add 'builtin-baseline' to the manifest or add a " - "'vcpkg-configuration.json' that redefines the default registry."); - // This registry implementation is the builtin registry without a baseline // that will only consult files in ports struct BuiltinFilesRegistry final : RegistryImplementation @@ -1177,11 +1165,6 @@ namespace vcpkg return default_registry(); } - DECLARE_AND_REGISTER_MESSAGE(NoRegistryForPort, - (msg::package_name), - "", - "no registry configured for port {package_name}"); - ExpectedL RegistrySet::baseline_for_port(StringView port_name) const { auto impl = registry_for_port(port_name); diff --git a/src/vcpkg/sourceparagraph.cpp b/src/vcpkg/sourceparagraph.cpp index adb024b34..8d9b52268 100644 --- a/src/vcpkg/sourceparagraph.cpp +++ b/src/vcpkg/sourceparagraph.cpp @@ -17,87 +17,6 @@ #include #include -namespace -{ - namespace msg = vcpkg::msg; - DECLARE_AND_REGISTER_MESSAGE(EmptyLicenseExpression, (), "", "SPDX license expression was empty."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionContainsUnicode, - (msg::value, msg::pretty_value), - "example of {value:04X} is '22BB'\nexample of {pretty_value} is '⊻'", - "SPDX license expression contains a unicode character (U+{value:04X} " - "'{pretty_value}'), but these expressions are ASCII-only."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionContainsInvalidCharacter, - (msg::value), - "example of {value:02X} is '7B'\nexample of {value} is '{'", - "SPDX license expression contains an invalid character (0x{value:02X} '{value}')."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionContainsExtraPlus, - (), - "", - "SPDX license expression contains an extra '+'. These are only allowed directly " - "after a license identifier."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionDocumentRefUnsupported, - (), - "", - "The current implementation does not support DocumentRef- SPDX references."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectLicenseFoundEof, - (), - "", - "Expected a license name, found the end of the string."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectExceptionFoundEof, - (), - "", - "Expected an exception name, found the end of the string."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectCompoundFoundParen, - (), - "", - "Expected a compound or the end of the string, found a parenthesis."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectLicenseFoundParen, - (), - "", - "Expected a license name, found a parenthesis."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectExceptionFoundParen, - (), - "", - "Expected an exception name, found a parenthesis."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionImbalancedParens, - (), - "", - "There was a close parenthesis without an opening parenthesis."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectLicenseFoundCompound, - (msg::value), - "Example of {value} is 'AND'", - "Expected a license name, found the compound {value}."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectExceptionFoundCompound, - (msg::value), - "Example of {value} is 'AND'", - "Expected an exception name, found the compound {value}."); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionExpectCompoundFoundWith, - (), - "AND, OR, and WITH are all keywords and should not be translated.", - "Expected either AND or OR, found WITH (WITH is only allowed after license names, not " - "parenthesized expressions)."); - DECLARE_AND_REGISTER_MESSAGE( - LicenseExpressionExpectCompoundOrWithFoundWord, - (msg::value), - "example of {value} is 'MIT'.\nAND, OR, and WITH are all keywords and should not be translated.", - "Expected either AND, OR, or WITH, found a license or exception name: '{value}'."); - DECLARE_AND_REGISTER_MESSAGE( - LicenseExpressionExpectCompoundFoundWord, - (msg::value), - "Example of {value} is 'MIT'.\nAND and OR are both keywords and should not be translated.", - "Expected either AND or OR, found a license or exception name: '{value}'."); - DECLARE_AND_REGISTER_MESSAGE( - LicenseExpressionUnknownLicense, - (msg::value), - "Example of {value} is 'unknownlicense'", - "Unknown license identifier '{value}'. Known values are listed at https://spdx.org/licenses/"); - DECLARE_AND_REGISTER_MESSAGE(LicenseExpressionUnknownException, - (msg::value), - "Example of {value} is 'unknownexception'", - "Unknown license exception identifier '{value}'. Known values are listed at " - "https://spdx.org/licenses/exceptions-index.html"); -} // anonymous namespace - namespace vcpkg { template diff --git a/src/vcpkg/tools.cpp b/src/vcpkg/tools.cpp index 84e336506..a0a7898f9 100644 --- a/src/vcpkg/tools.cpp +++ b/src/vcpkg/tools.cpp @@ -20,18 +20,6 @@ namespace vcpkg { - DECLARE_AND_REGISTER_MESSAGE(ToolFetchFailed, (msg::tool_name), "", "Could not fetch {tool_name}."); - DECLARE_AND_REGISTER_MESSAGE(ToolInWin10, (), "", "This utility is bundled with Windows 10 or later."); - DECLARE_AND_REGISTER_MESSAGE( - DownloadAvailable, - (msg::env_var), - "", - "A downloadable copy of this tool is available and can be used by unsetting {env_var}."); - DECLARE_AND_REGISTER_MESSAGE(UnknownTool, - (), - "", - "vcpkg does not have a definition of this tool for this platform."); - // /\d+\.\d+(\.\d+)?/ Optional> parse_tool_version_string(StringView string_version) { @@ -153,23 +141,6 @@ namespace vcpkg std::string version; }; - DECLARE_AND_REGISTER_MESSAGE(InstallWithSystemManager, - (), - "", - "You may be able to install this tool via your system package manager."); - - DECLARE_AND_REGISTER_MESSAGE( - InstallWithSystemManagerPkg, - (msg::command_line), - "", - "You may be able to install this tool via your system package manager ({command_line})."); - - DECLARE_AND_REGISTER_MESSAGE(FailedToRunToolToDetermineVersion, - (msg::tool_name, msg::path), - "Additional information, such as the command line output, if any, will be appended on " - "the line after this message", - "Failed to run {path} to determine the {tool_name} version."); - static ExpectedS run_to_extract_version(StringLiteral tool_name, const Path& exe_path, Command&& cmd) { return flatten_out(cmd_execute_and_capture_output(cmd), exe_path).map_error([&](LocalizedString&& output) { @@ -181,12 +152,6 @@ namespace vcpkg }); } - DECLARE_AND_REGISTER_MESSAGE( - UnexpectedToolOutput, - (msg::tool_name, msg::path), - "The actual command line output will be appended after this message.", - "{tool_name} ({path}) produced unexpected output when attempting to determine the version:"); - ExpectedS extract_prefixed_nonwhitespace(StringLiteral prefix, StringLiteral tool_name, std::string&& output, @@ -318,14 +283,6 @@ namespace vcpkg } }; - DECLARE_AND_REGISTER_MESSAGE( - MonoInstructions, - (), - "", - "This may be caused by an incomplete mono installation. Full mono is " - "available on some systems via `sudo apt install mono-complete`. Ubuntu 18.04 users may " - "need a newer version of mono, available at https://www.mono-project.com/download/stable/"); - struct NuGetProvider : ToolProvider { virtual bool is_abi_sensitive() const override { return false; } @@ -438,11 +395,6 @@ namespace vcpkg } }; - DECLARE_AND_REGISTER_MESSAGE(InstallWithSystemManagerMono, - (msg::url), - "", - "Ubuntu 18.04 users may need a newer version of mono, available at {url}."); - struct MonoProvider : ToolProvider { virtual bool is_abi_sensitive() const override { return false; } diff --git a/src/vcpkg/vcpkgpaths.cpp b/src/vcpkg/vcpkgpaths.cpp index bb2c291c7..4d7015535 100644 --- a/src/vcpkg/vcpkgpaths.cpp +++ b/src/vcpkg/vcpkgpaths.cpp @@ -557,12 +557,6 @@ namespace vcpkg }; } - DECLARE_AND_REGISTER_MESSAGE(VcpkgDisallowedClassicMode, - (), - "", - "Could not locate a manifest (vcpkg.json) above the current working " - "directory.\nThis vcpkg distribution does not have a classic mode instance."); - const InstalledPaths& VcpkgPaths::installed() const { if (auto i = m_pimpl->m_installed.get()) @@ -598,13 +592,6 @@ namespace vcpkg const Optional& VcpkgPaths::maybe_buildtrees() const { return m_pimpl->buildtrees; } const Optional& VcpkgPaths::maybe_packages() const { return m_pimpl->packages; } - DECLARE_AND_REGISTER_MESSAGE( - ErrorMissingVcpkgRoot, - (), - "", - "Could not detect vcpkg-root. If you are trying to use a copy of vcpkg that you've built, you must " - "define the VCPKG_ROOT environment variable to point to a cloned copy of https://github.com/Microsoft/vcpkg."); - // Guaranteed to return non-empty static Path determine_root(const Filesystem& fs, const Path& original_cwd, const VcpkgCmdArguments& args) { @@ -1310,27 +1297,6 @@ namespace vcpkg } const DownloadManager& VcpkgPaths::get_download_manager() const { return *m_pimpl->m_download_manager.get(); } - DECLARE_AND_REGISTER_MESSAGE(ErrorVcvarsUnsupported, - (msg::triplet), - "", - "in triplet {triplet}: Use of Visual Studio's Developer Prompt is unsupported " - "on non-Windows hosts.\nDefine 'VCPKG_CMAKE_SYSTEM_NAME' or " - "'VCPKG_CHAINLOAD_TOOLCHAIN_FILE' in the triplet file."); - - DECLARE_AND_REGISTER_MESSAGE(ErrorNoVSInstance, - (msg::triplet), - "", - "in triplet {triplet}: Unable to find a valid Visual Studio instance"); - - DECLARE_AND_REGISTER_MESSAGE(ErrorNoVSInstanceVersion, (msg::version), "", "with toolset version {version}"); - - DECLARE_AND_REGISTER_MESSAGE(ErrorNoVSInstanceFullVersion, - (msg::version), - "", - "with toolset version prefix {version}"); - - DECLARE_AND_REGISTER_MESSAGE(ErrorNoVSInstanceAt, (msg::path), "", "at \"{path}\""); - #if defined(_WIN32) static const ToolsetsInformation& get_all_toolsets(details::VcpkgPathsImpl& impl, const Filesystem& fs) { diff --git a/src/vcpkg/versions.cpp b/src/vcpkg/versions.cpp index 323f73de7..51ec14098 100644 --- a/src/vcpkg/versions.cpp +++ b/src/vcpkg/versions.cpp @@ -5,29 +5,6 @@ #include -namespace -{ - using namespace vcpkg; - - DECLARE_AND_REGISTER_MESSAGE( - VersionInvalidRelaxed, - (msg::version), - "", - "`{version}` is not a valid relaxed version (semver with arbitrary numeric element count)."); - - DECLARE_AND_REGISTER_MESSAGE(VersionInvalidSemver, - (msg::version), - "", - "`{version}` is not a valid semantic version, consult ."); - - DECLARE_AND_REGISTER_MESSAGE( - VersionInvalidDate, - (msg::version), - "", - "`{version}` is not a valid date version. Dates must follow the format YYYY-MM-DD and disambiguators must be " - "dot-separated positive integer values without leading zeroes."); -} - namespace vcpkg { Version::Version() noexcept : m_text("0.0.0"), m_port_version(0) { } diff --git a/src/vcpkg/visualstudio.cpp b/src/vcpkg/visualstudio.cpp index a6661ad83..b2cba33cf 100644 --- a/src/vcpkg/visualstudio.cpp +++ b/src/vcpkg/visualstudio.cpp @@ -17,18 +17,6 @@ #include -namespace -{ - DECLARE_AND_REGISTER_MESSAGE(VSExaminedPaths, - (), - "", - "The following paths were examined for Visual Studio instances:"); - - DECLARE_AND_REGISTER_MESSAGE(VSNoInstances, (), "", "Could not locate a complete Visual Studio instance"); - - DECLARE_AND_REGISTER_MESSAGE(VSExaminedInstances, (), "", "The following Visual Studio instances were considered:"); -} - #if defined(_WIN32) namespace vcpkg::VisualStudio