Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move vcpkgTools.xml into the tool and better support for arm64-linux #1490

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
101 changes: 0 additions & 101 deletions azure-pipelines/end-to-end-tests-dir/fetch.ps1

This file was deleted.

9 changes: 0 additions & 9 deletions include/vcpkg/base/message-data.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -911,10 +911,6 @@ DECLARE_MESSAGE(CouldNotFindGitTreeAtCommit,
(msg::package_name, msg::commit_sha),
"",
"could not find the git tree for `versions` in repo {package_name} at commit {commit_sha}")
DECLARE_MESSAGE(CouldNotFindToolVersion,
(msg::version, msg::path),
"",
"Could not find <tools version=\"{version}\"> in {path}")
DECLARE_MESSAGE(CouldNotFindVersionDatabaseFile, (msg::path), "", "Couldn't find the versions database file: {path}")
DECLARE_MESSAGE(CreatedNuGetPackage, (msg::path), "", "Created nupkg: {path}")
DECLARE_MESSAGE(CreateFailureLogsDir, (msg::path), "", "Creating failure logs output directory {path}.")
Expand Down Expand Up @@ -2952,11 +2948,6 @@ DECLARE_MESSAGE(VersionCommandHeader,
(msg::version),
"",
"vcpkg package management program version {version}\n\nSee LICENSE.txt for license information.")
DECLARE_MESSAGE(
VersionConflictXML,
(msg::path, msg::expected_version, msg::actual_version),
"",
"Expected {path} version: [{expected_version}], but was [{actual_version}]. Please re-run bootstrap-vcpkg.")
DECLARE_MESSAGE(VersionConstraintNotInDatabase1,
(msg::package_name, msg::version),
"",
Expand Down
1 change: 0 additions & 1 deletion include/vcpkg/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ namespace vcpkg
std::unique_ptr<ToolCache> get_tool_cache(const Filesystem& fs,
std::shared_ptr<const DownloadManager> downloader,
Path downloads,
Path xml_config,
Path tools,
RequireExactVersions abiToolVersionHandling);
}
2 changes: 0 additions & 2 deletions include/vcpkg/tools.test.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ namespace vcpkg
Path exe_path(const Path& tools_base_path) const { return tools_base_path / tool_dir_subpath / exe_subpath; }
};

Optional<ToolData> parse_tool_data_from_xml(StringView XML, StringView XML_PATH, StringView tool, StringView os);

Optional<std::array<int, 3>> parse_tool_version_string(StringView string_version);
}
4 changes: 0 additions & 4 deletions locales/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,6 @@
"_CouldNotFindBaselineInCommit.comment": "An example of {url} is https://github.com/microsoft/vcpkg. An example of {commit_sha} is 7cfad47ae9f68b183983090afd6337cd60fd4949. An example of {package_name} is zlib.",
"CouldNotFindGitTreeAtCommit": "could not find the git tree for `versions` in repo {package_name} at commit {commit_sha}",
"_CouldNotFindGitTreeAtCommit.comment": "An example of {package_name} is zlib. An example of {commit_sha} is 7cfad47ae9f68b183983090afd6337cd60fd4949.",
"CouldNotFindToolVersion": "Could not find <tools version=\"{version}\"> in {path}",
"_CouldNotFindToolVersion.comment": "An example of {version} is 1.3.8. An example of {path} is /foo/bar.",
"CouldNotFindVersionDatabaseFile": "Couldn't find the versions database file: {path}",
"_CouldNotFindVersionDatabaseFile.comment": "An example of {path} is /foo/bar.",
"CreateFailureLogsDir": "Creating failure logs output directory {path}.",
Expand Down Expand Up @@ -1574,8 +1572,6 @@
"_VersionBuiltinPortTreeEntryMissing.comment": "{expected} and {actual} are versions like 1.0. An example of {package_name} is zlib.",
"VersionCommandHeader": "vcpkg package management program version {version}\n\nSee LICENSE.txt for license information.",
"_VersionCommandHeader.comment": "An example of {version} is 1.3.8.",
"VersionConflictXML": "Expected {path} version: [{expected_version}], but was [{actual_version}]. Please re-run bootstrap-vcpkg.",
"_VersionConflictXML.comment": "An example of {path} is /foo/bar. An example of {expected_version} is 1.3.8. An example of {actual_version} is 1.3.8.",
"VersionConstraintNotInDatabase1": "the \"version>=\" constraint to {package_name} names version {version} which does not exist in the version database. All versions must exist in the version database to be interpreted by vcpkg.",
"_VersionConstraintNotInDatabase1.comment": "An example of {package_name} is zlib. An example of {version} is 1.3.8.",
"VersionConstraintNotInDatabase2": "consider removing the version constraint or choosing a value declared here",
Expand Down
75 changes: 0 additions & 75 deletions src/vcpkg-test/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,81 +41,6 @@ Copyright (C) 2006, 2019 Tatsuhiro Tsujikawa)");
CHECK_FALSE(result.has_value());
}

TEST_CASE ("parse_tool_data_from_xml", "[tools]")
{
const StringView tool_doc = R"(
<?xml version="1.0"?>
<tools version="2">
<tool name="git" os="linux">
<version>2.7.4</version>
<exeRelativePath></exeRelativePath>
<url></url>
<sha512></sha512>
</tool>
<tool name="nuget" os="osx">
<version>5.11.0</version>
<exeRelativePath>nuget.exe</exeRelativePath>
<url>https://dist.nuget.org/win-x86-commandline/v5.11.0/nuget.exe</url>
<sha512>06a337c9404dec392709834ef2cdbdce611e104b510ef40201849595d46d242151749aef65bc2d7ce5ade9ebfda83b64c03ce14c8f35ca9957a17a8c02b8c4b7</sha512>
</tool>
<tool name="node" os="windows">
<version>16.12.0</version>
<exeRelativePath>node-v16.12.0-win-x64\node.exe</exeRelativePath>
<url>https://nodejs.org/dist/v16.12.0/node-v16.12.0-win-x64.7z</url>
<sha512>0bb793fce8140bd59c17f3ac9661b062eac0f611d704117774f5cb2453d717da94b1e8b17d021d47baff598dc023fb7068ed1f8a7678e446260c3db3537fa888</sha512>
<archiveName>node-v16.12.0-win-x64.7z</archiveName>
</tool>
</tools>
)";

{
auto data = parse_tool_data_from_xml(tool_doc, "vcpkgTools.xml", "tool1", "windows");
REQUIRE(!data.has_value());
}
{
auto data = parse_tool_data_from_xml(tool_doc, "vcpkgTools.xml", "node", "unknown");
REQUIRE(!data.has_value());
}
{
auto data = parse_tool_data_from_xml(tool_doc, "vcpkgTools.xml", "node", "windows");
REQUIRE(data.has_value());
auto& p = *data.get();
CHECK(p.is_archive);
CHECK(p.version == decltype(p.version){16, 12, 0});
CHECK(p.tool_dir_subpath == "node-16.12.0-windows");
CHECK(p.exe_subpath == "node-v16.12.0-win-x64\\node.exe");
CHECK(p.download_subpath == "node-v16.12.0-win-x64.7z");
CHECK(p.sha512 == "0bb793fce8140bd59c17f3ac9661b062eac0f611d704117774f5cb2453d717da94b1e8b17d021d47baff598dc023"
"fb7068ed1f8a7678e446260c3db3537fa888");
CHECK(p.url == "https://nodejs.org/dist/v16.12.0/node-v16.12.0-win-x64.7z");
}
{
auto data = parse_tool_data_from_xml(tool_doc, "vcpkgTools.xml", "nuget", "osx");
REQUIRE(data.has_value());
auto& p = *data.get();
CHECK_FALSE(p.is_archive);
CHECK(p.version == decltype(p.version){5, 11, 0});
CHECK(p.tool_dir_subpath == "nuget-5.11.0-osx");
CHECK(p.exe_subpath == "nuget.exe");
CHECK(p.download_subpath == "06a337c9-nuget.exe");
CHECK(p.sha512 == "06a337c9404dec392709834ef2cdbdce611e104b510ef40201849595d46d242151749aef65bc2d7ce5ade9ebfda8"
"3b64c03ce14c8f35ca9957a17a8c02b8c4b7");
CHECK(p.url == "https://dist.nuget.org/win-x86-commandline/v5.11.0/nuget.exe");
}
{
auto data = parse_tool_data_from_xml(tool_doc, "vcpkgTools.xml", "git", "linux");
REQUIRE(data.has_value());
auto& p = *data.get();
CHECK_FALSE(p.is_archive);
CHECK(p.version == decltype(p.version){2, 7, 4});
CHECK(p.tool_dir_subpath == "git-2.7.4-linux");
CHECK(p.exe_subpath == "");
CHECK(p.download_subpath == "");
CHECK(p.sha512 == "");
CHECK(p.url == "");
}
}

TEST_CASE ("extract_prefixed_nonwhitespace", "[tools]")
{
CHECK(extract_prefixed_nonwhitespace("fooutil version ", "fooutil", "fooutil version 1.2", "fooutil.exe")
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ int main(const int argc, const char* const* const argv)

register_console_ctrl_handler();

#if (defined(__aarch64__) || defined(__arm__) || defined(__s390x__) || defined(__riscv) || \
#if (defined(__arm__) || defined(__s390x__) || defined(__riscv) || \
((defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)) && \
defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) || \
defined(_M_ARM) || defined(_M_ARM64)) && \
Expand Down
Loading
Loading