Skip to content

Commit 848b828

Browse files
committed
wip
1 parent aaa0ea7 commit 848b828

File tree

9 files changed

+206
-156
lines changed

9 files changed

+206
-156
lines changed

include/vcpkg/base/json.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
#include <vcpkg/base/fwd/files.h>
43
#include <vcpkg/base/fwd/json.h>
54

65
#include <vcpkg/base/expected.h>
@@ -336,7 +335,6 @@ namespace vcpkg::Json
336335
};
337336

338337
ExpectedL<ParsedJson> parse(StringView text, StringView origin);
339-
ParsedJson parse_file(LineInfo li, const ReadOnlyFilesystem&, const Path&);
340338
ExpectedL<Json::Object> parse_object(StringView text, StringView origin);
341339

342340
std::string stringify(const Value&);

include/vcpkg/base/message-data.inc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ DECLARE_MESSAGE(ARegistryPathMustStartWithDollar,
186186
"",
187187
"A registry path must start with `$` to mean the registry root; for example, `$/foo/bar`.")
188188
DECLARE_MESSAGE(ARelaxedVersionString, (), "", "a relaxed version string")
189+
DECLARE_MESSAGE(
190+
RequestedPortsNotInCIPlan,
191+
(),
192+
"",
193+
"one or more ports requested to be installed were not present in the action plan. (Probably a vcpkg bug)")
189194
DECLARE_MESSAGE(ArtifactsBootstrapFailed, (), "", "vcpkg-artifacts is not installed and could not be bootstrapped.")
190195
DECLARE_MESSAGE(ArtifactsOptionIncompatibility, (msg::option), "", "--{option} has no effect on find artifact.")
191196
DECLARE_MESSAGE(ArtifactsOptionJson,

include/vcpkg/paragraphs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <vcpkg/base/fwd/expected.h>
4+
#include <vcpkg/base/fwd/files.h>
45
#include <vcpkg/base/fwd/stringview.h>
56

67
#include <vcpkg/fwd/binaryparagraph.h>

locales/messages.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@
14091409
"_RemovePackageConflict.comment": "An example of {package_name} is zlib. An example of {spec} is zlib:x64-windows. An example of {triplet} is x64-windows.",
14101410
"RemovingPackage": "Removing {action_index}/{count} {spec}",
14111411
"_RemovingPackage.comment": "An example of {action_index} is 340. An example of {count} is 42. An example of {spec} is zlib:x64-windows.",
1412+
"RequestedPortsNotInCIPlan": "one or more ports requested to be installed were not present in the action plan. (Probably a vcpkg bug)",
14121413
"ResponseFileCode": "@response_file",
14131414
"_ResponseFileCode.comment": "Explains to the user that they can use response files on the command line, 'response_file' must have no spaces and be a legal file name.",
14141415
"RestoredPackagesFromAWS": "Restored {count} package(s) from AWS in {elapsed}. Use --debug to see more details.",

src/vcpkg-test/ci-baseline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ bill-made-up-another-skip:x64-linux=skip)"; // note no trailing newline
206206
SECTION ("Applies Skips and Fails")
207207
{
208208
ExclusionsMap exclusions;
209-
exclusions.insert(x64_uwp, {}); // example triplet
209+
exclusions.insert(x64_uwp, {}); // example triplet
210210
exclusions.insert(x64_linux, {}); // example host triplet
211211
auto actual = parse_and_apply_ci_baseline(expected_from_example_input, exclusions, SkipFailures::No);
212212
const SortedVector<PackageSpec> expected_expected_failures{

src/vcpkg/base/json.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,18 +1168,6 @@ namespace vcpkg::Json
11681168
return true;
11691169
}
11701170

1171-
ParsedJson parse_file(vcpkg::LineInfo li, const ReadOnlyFilesystem& fs, const Path& json_file)
1172-
{
1173-
std::error_code ec;
1174-
auto disk_contents = fs.read_contents(json_file, ec);
1175-
if (ec)
1176-
{
1177-
Checks::msg_exit_with_error(li, format_filesystem_call_error(ec, "read_contents", {json_file}));
1178-
}
1179-
1180-
return parse(disk_contents, json_file).value_or_exit(VCPKG_LINE_INFO);
1181-
}
1182-
11831171
ExpectedL<ParsedJson> parse(StringView json, StringView origin) { return Parser::parse(json, origin); }
11841172

11851173
ExpectedL<Json::Object> parse_object(StringView text, StringView origin)

src/vcpkg/commands.ci.cpp

Lines changed: 187 additions & 133 deletions
Large diffs are not rendered by default.

src/vcpkg/commands.z-generate-message-map.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ namespace vcpkg
233233
Path path_to_artifact_messages = parsed_args.command_arguments[1];
234234

235235
// parse file to get json obj
236-
auto artifact_messages = Json::parse_file(VCPKG_LINE_INFO, fs, path_to_artifact_messages).value;
237-
auto artifact_obj = artifact_messages.object(VCPKG_LINE_INFO);
238-
236+
auto artifact_messages_content = fs.try_read_contents(path_to_artifact_messages).value_or_exit(VCPKG_LINE_INFO);
237+
auto artifact_obj = Json::parse_object(artifact_messages_content.content, artifact_messages_content.origin)
238+
.value_or_exit(VCPKG_LINE_INFO);
239239
for (auto&& it : artifact_obj)
240240
{
241241
obj.insert(it.first, it.second);

src/vcpkg/xunitwriter.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ namespace
2525
StringLiteral result_string = "";
2626
switch (test.result)
2727
{
28-
case BuildResult::PostBuildChecksFailed:
29-
case BuildResult::FileConflicts:
30-
case BuildResult::BuildFailed: result_string = "Fail"; break;
31-
case BuildResult::Excluded:
32-
case BuildResult::CascadedDueToMissingDependencies: result_string = "Skip"; break;
3328
case BuildResult::Succeeded: result_string = "Pass"; break;
29+
case BuildResult::BuildFailed:
30+
case BuildResult::PostBuildChecksFailed:
31+
case BuildResult::FileConflicts: result_string = "Fail"; break;
32+
case BuildResult::CascadedDueToMissingDependencies:
33+
case BuildResult::Excluded: result_string = "Skip"; break;
34+
case BuildResult::CacheMissing:
35+
case BuildResult::Downloaded:
36+
case BuildResult::Removed:
3437
default: Checks::unreachable(VCPKG_LINE_INFO);
3538
}
3639

0 commit comments

Comments
 (0)