Skip to content

Commit

Permalink
Implement published test results built in and reduce console chattine…
Browse files Browse the repository at this point in the history
…ss. (#437)

* Reduce build output chattiness.

This change deletes the word "package" from several places where it is clear, and deduplicates "starting install" and "installing" messages.

Before:

```
PS C:\Dev\vcpkg> .\vcpkg.exe install zlib
Computing installation plan...
The following packages will be built and installed:
    zlib[core]:x86-windows -> 1.2.11#13
Detecting compiler hash for triplet x86-windows...
Restored 1 packages from C:\Users\bion\AppData\Local\vcpkg\archives in 43.57 ms. Use --debug to see more details.
Starting package 1/1: zlib:x86-windows
Installing package zlib[core]:x86-windows...
Elapsed time for package zlib:x86-windows: 18.41 ms

Total elapsed time: 2.266 s

The package zlib is compatible with built-in CMake targets:

    find_package(ZLIB REQUIRED)
    target_link_libraries(main PRIVATE ZLIB::ZLIB)

PS C:\Dev\vcpkg> .\vcpkg.exe remove zlib
The following packages will be removed:
    zlib:x86-windows
Removing package zlib:x86-windows...
PS C:\Dev\vcpkg> .\vcpkg.exe install zlib --no-binarycaching
Computing installation plan...
The following packages will be built and installed:
    zlib[core]:x86-windows -> 1.2.11#13
Detecting compiler hash for triplet x86-windows...
Starting package 1/1: zlib:x86-windows
Building package zlib[core]:x86-windows...
-- Using cached zlib1211.tar.gz.
-- Extracting source C:/Dev/vcpkg-downloads/zlib1211.tar.gz
-- Applying patch cmake_dont_build_more_than_needed.patch
-- Applying patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
-- Applying patch add_debug_postfix_on_mingw.patch
-- Applying patch 0002-android-build-mingw.patch
-- Using source at C:/Dev/vcpkg/buildtrees/zlib/src/1.2.11-e9a093319e.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Installing: C:/Dev/vcpkg/packages/zlib_x86-windows/share/zlib/vcpkg-cmake-wrapper.cmake
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/zlib_x86-windows/lib/pkgconfig/zlib.pc
-- Using cached msys-mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst.
-- Using msys root at C:/Dev/vcpkg-downloads/tools/msys2/9a1ec3f33446b195
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/zlib_x86-windows/debug/lib/pkgconfig/zlib.pc
-- Installing: C:/Dev/vcpkg/packages/zlib_x86-windows/share/zlib/copyright
-- Performing post-build validation
-- Performing post-build validation done
Installing package zlib[core]:x86-windows...
Elapsed time for package zlib:x86-windows: 4.83 s

Total elapsed time: 7.009 s

The package zlib is compatible with built-in CMake targets:

    find_package(ZLIB REQUIRED)
    target_link_libraries(main PRIVATE ZLIB::ZLIB)

PS C:\Dev\vcpkg> .\vcpkg.exe x-set-installed
The following packages will be removed:
    zlib:x86-windows
Starting package 1/1: zlib:x86-windows
Removing package zlib:x86-windows...
Elapsed time for package zlib:x86-windows: 9.93 ms
Restored 0 packages from C:\Users\bion\AppData\Local\vcpkg\archives in 92.5 us. Use --debug to see more details.

Total elapsed time: 14.01 ms

PS C:\Dev\vcpkg> .\vcpkg.exe remove zlib
The following packages are not installed, so not removed:
    zlib:x86-windows
Package zlib:x86-windows is not installed
PS C:\Dev\vcpkg>
```

After:

```
PS C:\Dev\vcpkg> ..\vcpkg-tool\out\build\x64-Debug\vcpkg.exe install zlib
Computing installation plan...
The following packages will be built and installed:
    zlib[core]:x86-windows -> 1.2.11#13
Detecting compiler hash for triplet x86-windows...
Restored 1 packages from C:\Users\bion\AppData\Local\vcpkg\archives in 60.79 ms. Use --debug to see more details.
Installing zlib:x86-windows (1/1)...
Elapsed time for zlib:x86-windows: 20.03 ms

Total elapsed time: 2.662 s

The package zlib is compatible with built-in CMake targets:

    find_package(ZLIB REQUIRED)
    target_link_libraries(main PRIVATE ZLIB::ZLIB)

PS C:\Dev\vcpkg> ..\vcpkg-tool\out\build\x64-Debug\vcpkg.exe remove zlib
The following packages will be removed:
    zlib:x86-windows
Removing zlib:x86-windows (1/1)...
PS C:\Dev\vcpkg> ..\vcpkg-tool\out\build\x64-Debug\vcpkg.exe install zlib --no-binarycaching
Computing installation plan...
The following packages will be built and installed:
    zlib[core]:x86-windows -> 1.2.11#13
Detecting compiler hash for triplet x86-windows...
Installing zlib:x86-windows (1/1)...
Building zlib[core]:x86-windows...
-- Using cached zlib1211.tar.gz.
-- Cleaning sources at C:/Dev/vcpkg/buildtrees/zlib/src/1.2.11-e9a093319e.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Dev/vcpkg-downloads/zlib1211.tar.gz
-- Applying patch cmake_dont_build_more_than_needed.patch
-- Applying patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
-- Applying patch add_debug_postfix_on_mingw.patch
-- Applying patch 0002-android-build-mingw.patch
-- Using source at C:/Dev/vcpkg/buildtrees/zlib/src/1.2.11-e9a093319e.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Installing: C:/Dev/vcpkg/packages/zlib_x86-windows/share/zlib/vcpkg-cmake-wrapper.cmake
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/zlib_x86-windows/lib/pkgconfig/zlib.pc
-- Using cached msys-mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst.
-- Using msys root at C:/Dev/vcpkg-downloads/tools/msys2/9a1ec3f33446b195
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/zlib_x86-windows/debug/lib/pkgconfig/zlib.pc
-- Installing: C:/Dev/vcpkg/packages/zlib_x86-windows/share/zlib/copyright
-- Performing post-build validation
-- Performing post-build validation done
Elapsed time for zlib:x86-windows: 5.137 s

Total elapsed time: 7.36 s

The package zlib is compatible with built-in CMake targets:

    find_package(ZLIB REQUIRED)
    target_link_libraries(main PRIVATE ZLIB::ZLIB)

PS C:\Dev\vcpkg> ..\vcpkg-tool\out\build\x64-Debug\vcpkg.exe remove zlib
The following packages will be removed:
    zlib:x86-windows
Removing zlib:x86-windows (1/1)...
PS C:\Dev\vcpkg> ..\vcpkg-tool\out\build\x64-Debug\vcpkg.exe remove zlib
The following packages are not installed, so not removed:
    zlib:x86-windows
Removing zlib:x86-windows (1/1)...
PS C:\Dev\vcpkg>
```

* Built in implementation of microsoft/vcpkg#23477 .

Needs tests.

* Fix POSIX build failures.

* ref-ize SpecSummary as re	quested by @dg0yt

* Use XmlSerializer to generate xUnit results

* Localize touched messages

Co-authored-by: Robert Schumacher <[email protected]>
  • Loading branch information
BillyONeal and ras0219-msft authored Apr 6, 2022
1 parent fa8ab83 commit 8e8fb17
Show file tree
Hide file tree
Showing 15 changed files with 329 additions and 214 deletions.
8 changes: 8 additions & 0 deletions include/vcpkg/base/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ namespace vcpkg
return std::chrono::duration_cast<TimeUnit>(m_duration);
}

ElapsedTime& operator+=(const ElapsedTime& other)
{
m_duration += other.m_duration;
return *this;
}

std::string to_string() const;
void to_string(std::string& into) const;

Expand Down Expand Up @@ -81,6 +87,8 @@ namespace vcpkg
mutable tm m_tm;
};

Optional<tm> to_utc_time(const std::time_t& t);

tm get_current_date_time();

tm get_current_date_time_local();
Expand Down
6 changes: 6 additions & 0 deletions include/vcpkg/base/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ namespace vcpkg
m_data.append(s.begin(), s.size());
return *this;
}
template<class... Args>
LocalizedString& append_fmt_raw(fmt::string_view s, const Args&... args)
{
m_data.append(fmt::format(s, args...));
return *this;
}
LocalizedString& append(const LocalizedString& s)
{
m_data.append(s.m_data);
Expand Down
6 changes: 6 additions & 0 deletions include/vcpkg/base/xmlserializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ namespace vcpkg
XmlSerializer& open_tag(StringLiteral sl);
XmlSerializer& start_complex_open_tag(StringLiteral sl);
XmlSerializer& text_attr(StringLiteral name, StringView content);
template<class T>
XmlSerializer& attr(StringLiteral name, const T& content)
{
return text_attr(name, Strings::concat_or_view(content));
}
XmlSerializer& finish_complex_open_tag();
XmlSerializer& finish_self_closing_complex_tag();
XmlSerializer& close_tag(StringLiteral sl);
XmlSerializer& text(StringView sv);
XmlSerializer& cdata(StringView sv);
XmlSerializer& simple_tag(StringLiteral tag, StringView content);
XmlSerializer& line_break();

Expand Down
4 changes: 1 addition & 3 deletions include/vcpkg/build.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace vcpkg::Build
{
enum class BuildResult
{
NULLVALUE = 0,
SUCCEEDED,
BUILD_FAILED,
POST_BUILD_CHECKS_FAILED,
Expand Down Expand Up @@ -197,7 +196,6 @@ namespace vcpkg::Build

struct BuildResultCounts
{
int null_value = 0;
int succeeded = 0;
int build_failed = 0;
int post_build_checks_failed = 0;
Expand Down Expand Up @@ -254,7 +252,7 @@ namespace vcpkg::Build

struct ExtendedBuildResult
{
ExtendedBuildResult(BuildResult code);
explicit ExtendedBuildResult(BuildResult code);
ExtendedBuildResult(BuildResult code, std::vector<FeatureSpec>&& unmet_deps);
ExtendedBuildResult(BuildResult code, std::unique_ptr<BinaryControlFile>&& bcf);

Expand Down
16 changes: 11 additions & 5 deletions include/vcpkg/install.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/base/chrono.h>
#include <vcpkg/base/optional.h>

#include <vcpkg/binaryparagraph.h>
#include <vcpkg/build.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>

#include <chrono>
#include <set>
#include <string>
#include <vector>
Expand All @@ -25,15 +27,19 @@ namespace vcpkg::Install

struct SpecSummary
{
SpecSummary(const PackageSpec& spec, const Dependencies::InstallPlanAction* action);
explicit SpecSummary(const Dependencies::InstallPlanAction& action);
explicit SpecSummary(const Dependencies::RemovePlanAction& action);

const BinaryParagraph* get_binary_paragraph() const;

PackageSpec spec;
Build::ExtendedBuildResult build_result;
const PackageSpec& get_spec() const { return m_spec; }
bool is_user_requested_install() const;
Optional<Build::ExtendedBuildResult> build_result;
vcpkg::ElapsedTime timing;
std::chrono::system_clock::time_point start_time;

const Dependencies::InstallPlanAction* action;
private:
const Dependencies::InstallPlanAction* m_install_action;
PackageSpec m_spec;
};

struct InstallSummary
Expand Down
18 changes: 4 additions & 14 deletions include/vcpkg/packagespec.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <vcpkg/base/fwd/format.h>
#include <vcpkg/base/fwd/parse.h>

#include <vcpkg/base/expected.h>
Expand Down Expand Up @@ -194,20 +195,6 @@ namespace vcpkg
Optional<ParsedQualifiedSpecifier> parse_qualified_specifier(ParserBase& parser);
}

template<class Char>
struct fmt::formatter<vcpkg::PackageSpec, Char>
{
constexpr auto parse(format_parse_context& ctx) const -> decltype(ctx.begin())
{
return vcpkg::basic_format_parse_impl(ctx);
}
template<class FormatContext>
auto format(const vcpkg::PackageSpec& spec, FormatContext& ctx) const -> decltype(ctx.out())
{
return fmt::formatter<std::string, Char>{}.format(spec.to_string(), ctx);
}
};

template<>
struct std::hash<vcpkg::PackageSpec>
{
Expand All @@ -230,3 +217,6 @@ struct std::hash<vcpkg::FeatureSpec>
return hash;
}
};

VCPKG_FORMAT_WITH_TO_STRING(vcpkg::PackageSpec);
VCPKG_FORMAT_WITH_TO_STRING(vcpkg::FeatureSpec);
4 changes: 4 additions & 0 deletions include/vcpkg/remove.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <vcpkg/fwd/vcpkgcmdarguments.h>
#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/base/messages.h>

#include <vcpkg/commands.interface.h>

namespace vcpkg::Remove
Expand All @@ -14,6 +16,8 @@ namespace vcpkg::Remove
YES
};

DECLARE_MESSAGE(RemovingPackage, (msg::spec), "", "Removing {spec}");

void perform_remove_plan_action(const VcpkgPaths& paths,
const Dependencies::RemovePlanAction& action,
const Purge purge,
Expand Down
11 changes: 11 additions & 0 deletions locales/messages.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"AddTripletExpressionNotAllowed": "Error: triplet expressions are not allowed here. You may want to change `{package_name}:{triplet}` to `{package_name}` instead.",
"AllFormatArgsRawArgument": "format string \"{value}\" contains a raw format argument",
"AllFormatArgsUnbalancedBraces": "unbalanced brace in format string \"{value}\"",
"AlreadyInstalled": "{spec} is already installed",
"AlreadyInstalledNotHead": "{spec} is already installed -- not building from HEAD",
"AttemptingToFetchPackagesFromVendor": "Attempting to fetch {count} package(s) from {vendor}",
"BothYesAndNoOptionSpecifiedError": "error: cannot specify both --no-{option} and --{option}.",
"BuildResultBuildFailed": "BUILD_FAILED",
Expand All @@ -18,8 +20,11 @@
"BuildResultSucceeded": "SUCCEEDED",
"BuildResultSummaryHeader": "SUMMARY FOR {triplet}",
"BuildResultSummaryLine": " {build_result}: {count}",
"BuildingFromHead": "Building {spec} from HEAD...",
"BuildingPackage": "Building {spec}...",
"BuildingPackageFailed": "building {spec} failed with: {build_result}",
"BuildingPackageFailedDueToMissingDeps": "due to the following missing dependencies:",
"CMakeTargetsUsage": "{package_name} provides CMake targets:",
"ChecksFailedCheck": "vcpkg has crashed; no additional details are available.",
"ChecksUnreachableCode": "unreachable code was reached",
"ChecksUpdateVcpkg": "updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure.",
Expand All @@ -30,8 +35,10 @@
"CmakeTargetsExcluded": "note: {count} additional targets are not displayed.",
"CouldNotDeduceNugetIdAndVersion": "Could not deduce nuget id and version from filename: {path}",
"CurlReportedUnexpectedResults": "curl has reported unexpected results to vcpkg and vcpkg cannot continue.\nPlease review the following text for sensitive information and open an issue on the Microsoft/vcpkg GitHub to help fix this problem!\ncmd: {command_line}\n=== curl output ===\n{actual}\n=== end curl output ===\n",
"DownloadedSources": "Downloaded sources for {spec}",
"DownloadingVcpkgCeBundle": "Downloading vcpkg-ce bundle {version}...",
"DownloadingVcpkgCeBundleLatest": "Downloading latest vcpkg-ce bundle...",
"ElapsedForPackage": "Elapsed time to handle {spec}: {elapsed}",
"EmptyLicenseExpression": "SPDX license expression was empty.",
"ErrorIndividualPackagesUnsupported": "Error: 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.",
"ErrorInvalidClassicModeOption": "Error: The option --{option} is not supported in classic mode and no manifest was found.",
Expand All @@ -46,6 +53,7 @@
"ErrorRequirePackagesList": "Error: `vcpkg install` requires a list of packages to install in classic mode.",
"ErrorRequirePackagesToInstall": "Error: No packages were listed for installation and no manifest was found.",
"ErrorVcvarsUnsupported": "Error: 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.",
"ExcludedPackage": "Excluded {spec}",
"ExpectedCharacterHere": "expected '{expected}' here",
"ExpectedFailOrSkip": "expected 'fail' or 'skip' here",
"ExpectedPortName": "expected a port name here",
Expand All @@ -60,8 +68,10 @@
"GenerateMsgNoCommentValue": " {{{value}}} was used in the message, but not commented.",
"GraphCycleDetected": "Cycle detected within graph at {package_name}:",
"HashFileFailureToRead": "failed to read file '{path}' for hashing: {error}",
"HeaderOnlyUsage": "{package_name} is header-only and can be used from CMake via:",
"IllegalFeatures": "error: List of features is not allowed in this contect",
"IllegalPlatformSpec": "error: Platform qualifier is not allowed in this context",
"InstallingPackage": "Installing {spec}...",
"InternalErrorMessage": "internal error: ",
"InternalErrorMessageContact": "Please open an issue at https://github.com/microsoft/vcpkg/issues/new?template=other-type-of-bug-report.md&labels=category:vcpkg-bug with detailed steps to reproduce the problem.",
"JsonErrorFailedToParse": "failed to parse {path}:",
Expand Down Expand Up @@ -90,6 +100,7 @@
"ProcessorArchitectureMalformed": "Failed to parse %PROCESSOR_ARCHITECTURE% ({arch}) as a valid CPU architecture.",
"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%.",
"RemovingPackage": "Removing {spec}",
"RestoredPackagesFromVendor": "Restored {count} package(s) from {vendor} in {elapsed}",
"ResultsHeader": "RESULTS",
"SeeURL": "See {url} for more information.",
Expand Down
22 changes: 22 additions & 0 deletions locales/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"_AllFormatArgsRawArgument.comment": "example of {value} is 'foo {} bar'\n",
"AllFormatArgsUnbalancedBraces": "unbalanced brace in format string \"{value}\"",
"_AllFormatArgsUnbalancedBraces.comment": "example of {value} is 'foo bar {'\n",
"AlreadyInstalled": "{spec} is already installed",
"_AlreadyInstalled.comment": "example of {spec} is 'zlib:x64-windows'.\n",
"AlreadyInstalledNotHead": "{spec} is already installed -- not building from HEAD",
"_AlreadyInstalledNotHead.comment": "'HEAD' means the most recent version of source code\nexample of {spec} is 'zlib:x64-windows'.\n",
"AttemptingToFetchPackagesFromVendor": "Attempting to fetch {count} package(s) from {vendor}",
"_AttemptingToFetchPackagesFromVendor.comment": "example of {count} is '42'.\nexample of {vendor} is 'Azure'.\n",
"BothYesAndNoOptionSpecifiedError": "error: cannot specify both --no-{option} and --{option}.",
Expand All @@ -36,10 +40,16 @@
"_BuildResultSummaryHeader.comment": "Displayed before a list of a summary installation results.\nexample of {triplet} is 'x64-windows'.\n",
"BuildResultSummaryLine": " {build_result}: {count}",
"_BuildResultSummaryLine.comment": "Displayed to show a count of results of a build_result in a summary.\nexample of {build_result} is 'One of the BuildResultXxx messages (such as BuildResultSucceeded/SUCCEEDED)'.\nexample of {count} is '42'.\n",
"BuildingFromHead": "Building {spec} from HEAD...",
"_BuildingFromHead.comment": "'HEAD' means the most recent version of source code\nexample of {spec} is 'zlib:x64-windows'.\n",
"BuildingPackage": "Building {spec}...",
"_BuildingPackage.comment": "example of {spec} is 'zlib:x64-windows'.\n",
"BuildingPackageFailed": "building {spec} failed with: {build_result}",
"_BuildingPackageFailed.comment": "example of {spec} is 'zlib:x64-windows'.\nexample of {build_result} is 'One of the BuildResultXxx messages (such as BuildResultSucceeded/SUCCEEDED)'.\n",
"BuildingPackageFailedDueToMissingDeps": "due to the following missing dependencies:",
"_BuildingPackageFailedDueToMissingDeps.comment": "Printed after BuildingPackageFailed, and followed by a list of dependencies that were missing.\n",
"CMakeTargetsUsage": "{package_name} provides CMake targets:",
"_CMakeTargetsUsage.comment": "'targets' are a CMake and Makefile concept\nexample of {package_name} is 'zlib'.\n",
"ChecksFailedCheck": "vcpkg has crashed; no additional details are available.",
"ChecksUnreachableCode": "unreachable code was reached",
"ChecksUpdateVcpkg": "updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure.",
Expand All @@ -56,10 +66,14 @@
"_CouldNotDeduceNugetIdAndVersion.comment": "example of {path} is '/foo/bar'.\n",
"CurlReportedUnexpectedResults": "curl has reported unexpected results to vcpkg and vcpkg cannot continue.\nPlease review the following text for sensitive information and open an issue on the Microsoft/vcpkg GitHub to help fix this problem!\ncmd: {command_line}\n=== curl output ===\n{actual}\n=== end curl output ===\n",
"_CurlReportedUnexpectedResults.comment": "{command_line} is the command line to call curl.exe, {actual} is the console output of curl.exe locale-invariant download results.\nexample of {command_line} is 'vcpkg install zlib'.\n",
"DownloadedSources": "Downloaded sources for {spec}",
"_DownloadedSources.comment": "example of {spec} is 'zlib:x64-windows'.\n",
"DownloadingVcpkgCeBundle": "Downloading vcpkg-ce bundle {version}...",
"_DownloadingVcpkgCeBundle.comment": "example of {version} is '1.3.8'.\n",
"DownloadingVcpkgCeBundleLatest": "Downloading latest vcpkg-ce bundle...",
"_DownloadingVcpkgCeBundleLatest.comment": "This message is normally displayed only in development.\n",
"ElapsedForPackage": "Elapsed time to handle {spec}: {elapsed}",
"_ElapsedForPackage.comment": "example of {spec} is 'zlib:x64-windows'.\nexample of {elapsed} is '3.532 min'.\n",
"EmptyLicenseExpression": "SPDX license expression was empty.",
"ErrorIndividualPackagesUnsupported": "Error: 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.",
"ErrorInvalidClassicModeOption": "Error: The option --{option} is not supported in classic mode and no manifest was found.",
Expand All @@ -82,6 +96,8 @@
"ErrorRequirePackagesToInstall": "Error: No packages were listed for installation and no manifest was found.",
"ErrorVcvarsUnsupported": "Error: 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.",
"_ErrorVcvarsUnsupported.comment": "example of {triplet} is 'x64-windows'.\n",
"ExcludedPackage": "Excluded {spec}",
"_ExcludedPackage.comment": "example of {spec} is 'zlib:x64-windows'.\n",
"ExpectedCharacterHere": "expected '{expected}' here",
"_ExpectedCharacterHere.comment": "{expected} is a locale-invariant delimiter; for example, the ':' or '=' in 'zlib:x64-windows=skip'\n",
"ExpectedFailOrSkip": "expected 'fail' or 'skip' here",
Expand All @@ -104,8 +120,12 @@
"_GraphCycleDetected.comment": "A list of package names comprising the cycle will be printed after this message.\nexample of {package_name} is 'zlib'.\n",
"HashFileFailureToRead": "failed to read file '{path}' for hashing: {error}",
"_HashFileFailureToRead.comment": "example of {error} is 'no such file or directory'\nexample of {path} is '/foo/bar'.\n",
"HeaderOnlyUsage": "{package_name} is header-only and can be used from CMake via:",
"_HeaderOnlyUsage.comment": "'header' refers to C/C++ .h files\nexample of {package_name} is 'zlib'.\n",
"IllegalFeatures": "error: List of features is not allowed in this contect",
"IllegalPlatformSpec": "error: Platform qualifier is not allowed in this context",
"InstallingPackage": "Installing {spec}...",
"_InstallingPackage.comment": "example of {spec} is 'zlib:x64-windows'.\n",
"InternalErrorMessage": "internal error: ",
"InternalErrorMessageContact": "Please open an issue at https://github.com/microsoft/vcpkg/issues/new?template=other-type-of-bug-report.md&labels=category:vcpkg-bug with detailed steps to reproduce the problem.",
"JsonErrorFailedToParse": "failed to parse {path}:",
Expand Down Expand Up @@ -149,6 +169,8 @@
"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%.",
"_ProcessorArchitectureW6432Malformed.comment": "example of {arch} is 'x64'.\n",
"RemovingPackage": "Removing {spec}",
"_RemovingPackage.comment": "example of {spec} is 'zlib:x64-windows'.\n",
"RestoredPackagesFromVendor": "Restored {count} package(s) from {vendor} in {elapsed}",
"_RestoredPackagesFromVendor.comment": "example of {count} is '42'.\nexample of {elapsed} is '3.532 min'.\nexample of {vendor} is 'Azure'.\n",
"ResultsHeader": "RESULTS",
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg/base/chrono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace vcpkg
return parts;
}

static Optional<tm> to_utc_time(const std::time_t& t)
Optional<tm> to_utc_time(const std::time_t& t)
{
tm parts{};
#if defined(_WIN32)
Expand Down
10 changes: 10 additions & 0 deletions src/vcpkg/base/xmlserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ namespace vcpkg
}
return *this;
}
XmlSerializer& XmlSerializer::cdata(StringView sv)
{
emit_pending_indent();
Checks::check_exit(
VCPKG_LINE_INFO, Strings::search(sv, "]]>") == sv.end(), "]]> is not supported in a CDATA block");
buf.append("<![CDATA[");
buf.append(sv.begin(), sv.size());
buf.append("]]>");
return *this;
}
XmlSerializer& XmlSerializer::simple_tag(StringLiteral tag, StringView content)
{
return emit_pending_indent().open_tag(tag).text(content).close_tag(tag);
Expand Down
Loading

0 comments on commit 8e8fb17

Please sign in to comment.