Skip to content

Commit

Permalink
Delete --x-use-aria2.
Browse files Browse the repository at this point in the history
* Huge parts of the vcpkg product do not respect this setting
* microsoft/vcpkg#30079 shows it has been entirely broken for an extremely long time.
* It's an --x switch and we never claimed full support for it.
* We have never tested that it ever actually works.

Related: microsoft/vcpkg-docs#441
  • Loading branch information
BillyONeal committed Jan 22, 2025
1 parent 1a23f1a commit 19d8aac
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BeforeAll {
'--clean-downloads-after-build', '--clean-packages-after-build', '--dry-run', '--editable'
'--enforce-port-checks', '--head', '--keep-going', '--no-downloads', '--no-print-usage'
'--only-binarycaching', '--only-downloads', '--recurse', '--x-feature', '--x-no-default-features'
'--x-prohibit-backcompat-features', '--x-use-aria2', '--x-write-nuget-packages-config', '--x-xunit'
'--x-prohibit-backcompat-features', '--x-write-nuget-packages-config', '--x-xunit'
)
remove = @(
'--dry-run', '--outdated', '--purge', '--recurse'
Expand Down
2 changes: 0 additions & 2 deletions include/vcpkg/base/contractual-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ namespace vcpkg
inline constexpr StringLiteral SwitchXProhibitBackcompatFeatures = "x-prohibit-backcompat-features";
inline constexpr StringLiteral SwitchXRandomize = "x-randomize";
inline constexpr StringLiteral SwitchXTransitive = "x-transitive";
inline constexpr StringLiteral SwitchXUseAria2 = "x-use-aria2";
inline constexpr StringLiteral SwitchXVersionSuffix = "x-version-suffix";
inline constexpr StringLiteral SwitchXWriteNuGetPackagesConfig = "x-write-nuget-packages-config";
inline constexpr StringLiteral SwitchXXUnit = "x-xunit";
Expand Down Expand Up @@ -388,7 +387,6 @@ namespace vcpkg
inline constexpr StringLiteral CMakeVariableDisableCompilerTracking = "VCPKG_DISABLE_COMPILER_TRACKING";
inline constexpr StringLiteral CMakeVariableDownloadMode = "VCPKG_DOWNLOAD_MODE";
inline constexpr StringLiteral CMakeVariableDownloads = "DOWNLOADS";
inline constexpr StringLiteral CMakeVariableDownloadTool = "_VCPKG_DOWNLOAD_TOOL";
inline constexpr StringLiteral CMakeVariableEditable = "_VCPKG_EDITABLE";
inline constexpr StringLiteral CMakeVariableEnvPassthrough = "VCPKG_ENV_PASSTHROUGH";
inline constexpr StringLiteral CMakeVariableEnvPassthroughUntracked = "VCPKG_ENV_PASSTHROUGH_UNTRACKED";
Expand Down
2 changes: 1 addition & 1 deletion include/vcpkg/base/message-args.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DECLARE_MSG_ARG(sha,
DECLARE_MSG_ARG(supports_expression, "windows & !static")
DECLARE_MSG_ARG(system_api, "CreateProcessW")
DECLARE_MSG_ARG(system_name, "Darwin")
DECLARE_MSG_ARG(tool_name, "aria2")
DECLARE_MSG_ARG(tool_name, "signtool")
DECLARE_MSG_ARG(triplet, "x64-windows")
DECLARE_MSG_ARG(upper, "42")
DECLARE_MSG_ARG(url, "https://github.com/microsoft/vcpkg")
Expand Down
1 change: 0 additions & 1 deletion include/vcpkg/base/message-data.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,6 @@ DECLARE_MESSAGE(HelpTxtOptNoUsage, (), "", "Does not print CMake usage informati
DECLARE_MESSAGE(HelpTxtOptOnlyBinCache, (), "", "Fails if cached binaries are not available")
DECLARE_MESSAGE(HelpTxtOptOnlyDownloads, (), "", "Makes best-effort attempt to download sources without building")
DECLARE_MESSAGE(HelpTxtOptRecurse, (), "", "Allows removal of packages as part of installation")
DECLARE_MESSAGE(HelpTxtOptUseAria2, (), "", "Uses aria2 to perform download tasks")
DECLARE_MESSAGE(HelpTxtOptUseHeadVersion,
(),
"",
Expand Down
4 changes: 0 additions & 4 deletions include/vcpkg/commands.build.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ namespace vcpkg
Triplet default_triplet,
Triplet host_triplet);

StringLiteral to_string_view(DownloadTool tool);
std::string to_string(DownloadTool tool);

struct BuildPackageOptions
{
BuildMissing build_missing;
Expand All @@ -70,7 +67,6 @@ namespace vcpkg
CleanBuildtrees clean_buildtrees;
CleanPackages clean_packages;
CleanDownloads clean_downloads;
DownloadTool download_tool;
BackcompatFeatures backcompat_features;
KeepGoing keep_going;
};
Expand Down
6 changes: 0 additions & 6 deletions include/vcpkg/fwd/build.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ namespace vcpkg
Release,
};

enum class DownloadTool
{
Builtin,
Aria2,
};

enum class Editable
{
No = 0,
Expand Down
1 change: 0 additions & 1 deletion include/vcpkg/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace vcpkg
static constexpr StringLiteral NINJA = "ninja";
static constexpr StringLiteral POWERSHELL_CORE = "powershell-core";
static constexpr StringLiteral NUGET = "nuget";
static constexpr StringLiteral ARIA2 = "aria2";
static constexpr StringLiteral NODE = "node";
static constexpr StringLiteral IFW_INSTALLER_BASE = "ifw_installerbase";
// This duplicate of CMake should only be used as a fallback to unpack
Expand Down
19 changes: 9 additions & 10 deletions locales/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
"DownloadingFileFirstAuthoritativeSource": "Downloading {path}, trying {url}",
"_DownloadingFileFirstAuthoritativeSource.comment": "An example of {path} is /foo/bar. An example of {url} is https://github.com/microsoft/vcpkg.",
"DownloadingPortableToolVersionX": "A suitable version of {tool_name} was not found (required v{version}).",
"_DownloadingPortableToolVersionX.comment": "An example of {tool_name} is aria2. An example of {version} is 1.3.8.",
"_DownloadingPortableToolVersionX.comment": "An example of {tool_name} is signtool. An example of {version} is 1.3.8.",
"DownloadingUrlToFile": "Downloading {url} -> {path}",
"_DownloadingUrlToFile.comment": "An example of {url} is https://github.com/microsoft/vcpkg. An example of {path} is /foo/bar.",
"DownloadingVcpkgStandaloneBundle": "Downloading standalone bundle {version}.",
Expand Down Expand Up @@ -766,7 +766,7 @@
"_ExtendedDocumentationAtUrl.comment": "An example of {url} is https://github.com/microsoft/vcpkg.",
"ExtractHelp": "Extracts an archive.",
"ExtractingTool": "Extracting {tool_name}...",
"_ExtractingTool.comment": "An example of {tool_name} is aria2.",
"_ExtractingTool.comment": "An example of {tool_name} is signtool.",
"FailedPostBuildChecks": "Found {count} post-build check problem(s). These are usually caused by bugs in portfile.cmake or the upstream build system. Please correct these before submitting this port to the curated registry.",
"_FailedPostBuildChecks.comment": "An example of {count} is 42.",
"FailedToAcquireMutant": "failed to acquire mutant {path}",
Expand Down Expand Up @@ -809,7 +809,7 @@
"FailedToParseVersionFile": "Failed to parse version file: {path}",
"_FailedToParseVersionFile.comment": "An example of {path} is /foo/bar.",
"FailedToRunToolToDetermineVersion": "Failed to run \"{path}\" to determine the {tool_name} version.",
"_FailedToRunToolToDetermineVersion.comment": "Additional information, such as the command line output, if any, will be appended on the line after this message An example of {tool_name} is aria2. An example of {path} is /foo/bar.",
"_FailedToRunToolToDetermineVersion.comment": "Additional information, such as the command line output, if any, will be appended on the line after this message An example of {tool_name} is signtool. An example of {path} is /foo/bar.",
"FailedToStoreBackToMirror": "Failed to store {path} to {url}.",
"_FailedToStoreBackToMirror.comment": "An example of {path} is /foo/bar. An example of {url} is https://github.com/microsoft/vcpkg.",
"FailedToStoreBinaryCache": "Failed to store binary cache {path}",
Expand Down Expand Up @@ -971,7 +971,6 @@
"HelpTxtOptOnlyBinCache": "Fails if cached binaries are not available",
"HelpTxtOptOnlyDownloads": "Makes best-effort attempt to download sources without building",
"HelpTxtOptRecurse": "Allows removal of packages as part of installation",
"HelpTxtOptUseAria2": "Uses aria2 to perform download tasks",
"HelpTxtOptUseHeadVersion": "Installs the libraries on the command line using the latest upstream sources (classic mode)",
"HelpTxtOptWritePkgConfig": "Writes a NuGet packages.config-formatted file for use with external binary caching. See `vcpkg help binarycaching` for more information",
"_HelpTxtOptWritePkgConfig.comment": "'vcpkg help binarycaching' is a command line and should not be localized.",
Expand Down Expand Up @@ -1139,7 +1138,7 @@
"JsonValueNotObject": "json value is not an object",
"JsonValueNotString": "json value is not a string",
"LaunchingProgramFailed": "Launching {tool_name}:",
"_LaunchingProgramFailed.comment": "A platform API call failure message is appended after this An example of {tool_name} is aria2.",
"_LaunchingProgramFailed.comment": "A platform API call failure message is appended after this An example of {tool_name} is signtool.",
"LibraryArchiveMemberTooSmall": "A library archive member was too small to contain the expected data type.",
"LibraryFirstLinkerMemberMissing": "Could not find first linker member name.",
"LicenseExpressionContainsExtraPlus": "SPDX license expression contains an extra '+'. These are only allowed directly after a license identifier.",
Expand Down Expand Up @@ -1398,7 +1397,7 @@
"ProgramPathReturnedNonzeroExitCode": "failed with exit code {exit_code}",
"_ProgramPathReturnedNonzeroExitCode.comment": "An example of {exit_code} is 127.",
"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.",
"_ProgramReturnedNonzeroExitCode.comment": "The program's console output is appended after this. An example of {tool_name} is signtool. An example of {exit_code} is 127.",
"ProvideExportType": "At least one of the following options are required: --raw --nuget --ifw --zip --7zip --chocolatey --prefab.",
"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.",
Expand Down Expand Up @@ -1481,12 +1480,12 @@
"ToolDataFileSchemaVersionNotSupported": "document schema version {version} is not supported by this version of vcpkg",
"_ToolDataFileSchemaVersionNotSupported.comment": "An example of {version} is 1.3.8.",
"ToolFetchFailed": "Could not fetch {tool_name}.",
"_ToolFetchFailed.comment": "An example of {tool_name} is aria2.",
"_ToolFetchFailed.comment": "An example of {tool_name} is signtool.",
"ToolHashMismatch": "{tool_name} appears to be already downloaded, but has an incorrect hash. Expected {expected} but was {actual}",
"_ToolHashMismatch.comment": "{expected} and {actual} are SHA512 hashes in hex format. An example of {tool_name} is aria2.",
"_ToolHashMismatch.comment": "{expected} and {actual} are SHA512 hashes in hex format. An example of {tool_name} is signtool.",
"ToolInWin10": "This utility is bundled with Windows 10 or later.",
"ToolOfVersionXNotFound": "A suitable version of {tool_name} was not found (required v{version}) and unable to automatically download a portable one. Please install a newer version of {tool_name}",
"_ToolOfVersionXNotFound.comment": "An example of {tool_name} is aria2. An example of {version} is 1.3.8.",
"_ToolOfVersionXNotFound.comment": "An example of {tool_name} is signtool. An example of {version} is 1.3.8.",
"TotalInstallTime": "Total install time: {elapsed}",
"_TotalInstallTime.comment": "An example of {elapsed} is 3.532 min.",
"TrailingCommaInArray": "Trailing comma in array",
Expand Down Expand Up @@ -1545,7 +1544,7 @@
"UnexpectedSwitch": "unexpected switch: {option}",
"_UnexpectedSwitch.comment": "Switch is a command line switch like --switch An example of {option} is editable.",
"UnexpectedToolOutput": "{tool_name} ({path}) produced unexpected output when attempting to determine the version:",
"_UnexpectedToolOutput.comment": "The actual command line output will be appended after this message. An example of {tool_name} is aria2. An example of {path} is /foo/bar.",
"_UnexpectedToolOutput.comment": "The actual command line output will be appended after this message. An example of {tool_name} is signtool. An example of {path} is /foo/bar.",
"UnexpectedWindowsArchitecture": "unexpected Windows host architecture: {actual}",
"_UnexpectedWindowsArchitecture.comment": "{actual} is the CPU kind we observed like ARM or MIPS",
"UnknownBaselineFileContent": "unrecognizable baseline entry; expected 'port:triplet=(fail|skip|pass)'",
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CMake suite maintained and supported by Kitware (kitware.com/cmake).)");
REQUIRE(result.has_value());
CHECK(*result.get() == std::array<int, 3>{3, 22, 2});

result = parse_tool_version_string(R"(aria2 version 1.35.0
result = parse_tool_version_string(R"(example version 1.35.0
Copyright (C) 2006, 2019 Tatsuhiro Tsujikawa)");
REQUIRE(result.has_value());
CHECK(*result.get() == std::array<int, 3>{1, 35, 0});
Expand Down
1 change: 0 additions & 1 deletion src/vcpkg/commands.build-external.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace vcpkg
CleanBuildtrees::Yes,
CleanPackages::Yes,
CleanDownloads::No,
DownloadTool::Builtin,
BackcompatFeatures::Allow,
};

Expand Down
19 changes: 0 additions & 19 deletions src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ namespace vcpkg
CleanBuildtrees::No,
CleanPackages::No,
CleanDownloads::No,
DownloadTool::Builtin,
BackcompatFeatures::Allow,
};

Expand Down Expand Up @@ -289,18 +288,6 @@ namespace vcpkg
}
}

StringLiteral to_string_view(DownloadTool tool)
{
switch (tool)
{
case DownloadTool::Builtin: return "BUILT_IN";
case DownloadTool::Aria2: return "ARIA2";
default: Checks::unreachable(VCPKG_LINE_INFO);
}
}

std::string to_string(DownloadTool tool) { return to_string_view(tool).to_string(); }

Optional<LinkageType> to_linkage_type(StringView str)
{
if (str == "dynamic") return LinkageType::Dynamic;
Expand Down Expand Up @@ -789,18 +776,12 @@ namespace vcpkg
{CMakeVariablePort, port_name},
{CMakeVariableVersion, scf.to_version().text},
{CMakeVariableUseHeadVersion, Util::Enum::to_bool(action.use_head_version) ? "1" : "0"},
{CMakeVariableDownloadTool, to_string_view(build_options.download_tool)},
{CMakeVariableEditable, Util::Enum::to_bool(action.editable) ? "1" : "0"},
{CMakeVariableNoDownloads, !Util::Enum::to_bool(build_options.allow_downloads) ? "1" : "0"},
{CMakeVariableZChainloadToolchainFile, action.pre_build_info(VCPKG_LINE_INFO).toolchain_file()},
{CMakeVariableZPostPortfileIncludes, all_post_portfile_includes},
};

if (build_options.download_tool == DownloadTool::Aria2)
{
variables.emplace_back("ARIA2", paths.get_tool_exe(Tools::ARIA2, out_sink));
}

if (auto cmake_debug = args.cmake_debug.get())
{
if (cmake_debug->is_port_affected(port_name))
Expand Down
1 change: 0 additions & 1 deletion src/vcpkg/commands.ci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ namespace vcpkg
CleanBuildtrees::Yes,
CleanPackages::Yes,
CleanDownloads::No,
DownloadTool::Builtin,
BackcompatFeatures::Prohibit,
KeepGoing::Yes,
};
Expand Down
6 changes: 0 additions & 6 deletions src/vcpkg/commands.install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@ namespace vcpkg
{SwitchRecurse, msgHelpTxtOptRecurse},
{SwitchKeepGoing, msgHelpTxtOptKeepGoing},
{SwitchEditable, msgHelpTxtOptEditable},
{SwitchXUseAria2, msgHelpTxtOptUseAria2},
{SwitchCleanAfterBuild, msgHelpTxtOptCleanAfterBuild},
{SwitchCleanBuildtreesAfterBuild, msgHelpTxtOptCleanBuildTreesAfterBuild},
{SwitchCleanPackagesAfterBuild, msgHelpTxtOptCleanPkgAfterBuild},
Expand Down Expand Up @@ -1044,7 +1043,6 @@ namespace vcpkg
const bool is_recursive = Util::Sets::contains(options.switches, (SwitchRecurse));
const bool is_editable =
Util::Sets::contains(options.switches, (SwitchEditable)) || cmake_args_sets_variable(args);
const bool use_aria2 = Util::Sets::contains(options.switches, (SwitchXUseAria2));
const bool clean_after_build = Util::Sets::contains(options.switches, (SwitchCleanAfterBuild));
const bool clean_buildtrees_after_build =
Util::Sets::contains(options.switches, (SwitchCleanBuildtreesAfterBuild));
Expand Down Expand Up @@ -1116,17 +1114,13 @@ namespace vcpkg

auto& fs = paths.get_filesystem();

DownloadTool download_tool = DownloadTool::Builtin;
if (use_aria2) download_tool = DownloadTool::Aria2;

const BuildPackageOptions build_package_options = {
Util::Enum::to_enum<BuildMissing>(!no_build_missing),
Util::Enum::to_enum<AllowDownloads>(!no_downloads),
Util::Enum::to_enum<OnlyDownloads>(only_downloads),
Util::Enum::to_enum<CleanBuildtrees>(clean_after_build || clean_buildtrees_after_build),
Util::Enum::to_enum<CleanPackages>(clean_after_build || clean_packages_after_build),
Util::Enum::to_enum<CleanDownloads>(clean_after_build || clean_downloads_after_build),
download_tool,
prohibit_backcompat_features ? BackcompatFeatures::Prohibit : BackcompatFeatures::Allow,
keep_going,
};
Expand Down
1 change: 0 additions & 1 deletion src/vcpkg/commands.set-installed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ namespace vcpkg
CleanBuildtrees::Yes,
CleanPackages::Yes,
CleanDownloads::No,
DownloadTool::Builtin,
prohibit_backcompat_features,
keep_going,
};
Expand Down
1 change: 0 additions & 1 deletion src/vcpkg/commands.upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ namespace vcpkg
CleanBuildtrees::Yes,
CleanPackages::Yes,
CleanDownloads::No,
DownloadTool::Builtin,
BackcompatFeatures::Allow,
keep_going,
};
Expand Down
19 changes: 0 additions & 19 deletions src/vcpkg/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,24 +433,6 @@ namespace vcpkg
}
};

struct Aria2Provider : ToolProvider
{
virtual bool is_abi_sensitive() const override { return false; }
virtual StringView tool_data_name() const override { return Tools::ARIA2; }
virtual std::vector<StringView> system_exe_stems() const override { return {"aria2c"}; }
virtual std::array<int, 3> default_min_version() const override { return {1, 33, 1}; }
virtual ExpectedL<std::string> get_version(const ToolCache&, MessageSink&, const Path& exe_path) const override
{
return run_to_extract_version(Tools::ARIA2, exe_path, Command(exe_path).string_arg("--version"))
.then([&](std::string&& output) {
// Sample output:
// aria2 version 1.35.0
// Copyright (C) 2006, 2019 Tatsuhiro Tsujikawa
return extract_prefixed_nonwhitespace("aria2 version ", Tools::ARIA2, std::move(output), exe_path);
});
}
};

struct NodeProvider : ToolProvider
{
virtual bool is_abi_sensitive() const override { return false; }
Expand Down Expand Up @@ -1048,7 +1030,6 @@ namespace vcpkg
if (tool == Tools::NINJA) return get_path(NinjaProvider(), status_sink);
if (tool == Tools::POWERSHELL_CORE) return get_path(PowerShellCoreProvider(), status_sink);
if (tool == Tools::NUGET) return get_path(NuGetProvider(), status_sink);
if (tool == Tools::ARIA2) return get_path(Aria2Provider(), status_sink);
if (tool == Tools::NODE) return get_path(NodeProvider(), status_sink);
if (tool == Tools::IFW_INSTALLER_BASE) return get_path(IfwInstallerBaseProvider(), status_sink);
if (tool == Tools::MONO) return get_path(MonoProvider(), status_sink);
Expand Down

0 comments on commit 19d8aac

Please sign in to comment.