diff --git a/azure-pipelines/end-to-end-tests-dir/cli.ps1 b/azure-pipelines/end-to-end-tests-dir/cli.ps1 index af098ccac1..788905e8e2 100644 --- a/azure-pipelines/end-to-end-tests-dir/cli.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/cli.ps1 @@ -45,152 +45,3 @@ if (-Not ($out.StartsWith('error: unexpected switch: --not-a-switch'))) { throw 'Bad install --not-a-switch output' } - -if ($IsWindows) { - $warningText = 'In the September 2023 release' - - # build-external not tested - # ci not tested - # export not tested - - # depend-info - [string]$output = Run-VcpkgAndCaptureStdErr -TestArgs ($directoryArgs + @('depend-info', 'vcpkg-hello-world-1')) - Throw-IfFailed - if (-Not $output.Contains($warningText)) { - throw 'depend-info with unqualified spec should emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureStdErr -TestArgs ($directoryArgs + @('depend-info', 'vcpkg-hello-world-1:x64-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'depend-info with qualified parameters should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureStdErr -TestArgs ($directoryArgs + @('depend-info', 'vcpkg-hello-world-1', '--triplet', 'x86-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'depend-info with arg should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureStdErr -TestArgs ($directoryArgs + @('depend-info', 'vcpkg-hello-world-1', '--triplet', 'x64-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'depend-info with new default arg should not emit the triplet warning' - } - - # set-installed - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('x-set-installed')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'x-set-installed with no parameters should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('x-set-installed', 'vcpkg-hello-world-1')) - Throw-IfFailed - if (-Not $output.Contains($warningText)) { - throw 'x-set-installed with unqualified spec should emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('x-set-installed', 'vcpkg-hello-world-1:x64-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'x-set-installed with qualified parameters should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('x-set-installed', 'vcpkg-hello-world-1', '--triplet', 'x86-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'x-set-installed with arg should not emit the triplet warning' - } - - # install - Refresh-TestRoot - $sub = Join-Path $TestingRoot 'manifest-warn' - New-Item -ItemType Directory -Force $sub | Out-Null - Push-Location $sub - try { - Run-Vcpkg -TestArgs ($directoryArgs + @('new', '--application')) - Throw-IfFailed - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('install')) - Throw-IfFailed - if (-Not $output.Contains($warningText)) { - throw 'manifest install should emit the triplet warning' - } - } finally { - Pop-Location - } - - Refresh-TestRoot - $output =Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('install', 'vcpkg-hello-world-1')) - Throw-IfFailed - if (-Not $output.Contains($warningText)) { - throw 'install with unqualified spec should emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('install', 'vcpkg-hello-world-1:x64-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'install with qualified parameters should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('install', 'vcpkg-hello-world-1', '--triplet', 'x86-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'install with arg should not emit the triplet warning' - } - - # upgrade - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('upgrade')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'upgrade with no parameters should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('upgrade', 'vcpkg-hello-world-1')) - Throw-IfFailed - if (-Not $output.Contains($warningText)) { - throw 'upgrade with unqualified spec should emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('upgrade', 'vcpkg-hello-world-1:x64-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'upgrade with qualified parameters should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('upgrade', 'vcpkg-hello-world-1', '--triplet', 'x86-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'upgrade with arg should not emit the triplet warning' - } - - # remove - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('remove', 'vcpkg-hello-world-1')) - Throw-IfFailed - if (-Not $output.Contains($warningText)) { - throw 'remove with unqualified spec should emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('remove', 'vcpkg-hello-world-1:x64-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'remove with qualified parameters should not emit the triplet warning' - } - - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('remove', 'vcpkg-hello-world-1', '--triplet', 'x86-windows')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'remove with arg should not emit the triplet warning' - } - - $env:VCPKG_DEFAULT_TRIPLET = 'x86-windows' - Refresh-TestRoot - $output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('install', 'vcpkg-hello-world-1')) - Throw-IfFailed - if ($output.Contains($warningText)) { - throw 'install with environment variable set should not emit the triplet warning' - } - - Remove-Item env:VCPKG_DEFAULT_TRIPLET -} diff --git a/include/vcpkg/base/message-data.inc.h b/include/vcpkg/base/message-data.inc.h index d563a7fc94..49f943961b 100644 --- a/include/vcpkg/base/message-data.inc.h +++ b/include/vcpkg/base/message-data.inc.h @@ -980,14 +980,6 @@ DECLARE_MESSAGE( DECLARE_MESSAGE(DefaultFeatureIdentifier, (), "", "the names of default features must be identifiers") DECLARE_MESSAGE(DefaultFlag, (msg::option), "", "Defaulting to --{option} being on.") DECLARE_MESSAGE(DefaultRegistryIsArtifact, (), "", "The default registry cannot be an artifact registry.") -DECLARE_MESSAGE( - DefaultTripletChanged, - (msg::triplet), - "The parts naming --triplet are command line switches that should be unlocalized. The space after the last " - "'triplet' and the period is intended to avoid the period looking like it's part of the command line switch", - "In the September 2023 release, the default triplet for vcpkg libraries changed from x86-windows to " - "the detected host triplet ({triplet}). For the old behavior, add --triplet x86-windows . To " - "suppress this message, add --triplet {triplet} .") DECLARE_MESSAGE(DeleteVcpkgConfigFromManifest, (msg::path), "", diff --git a/include/vcpkg/input.h b/include/vcpkg/input.h index 84d5762107..236c960a02 100644 --- a/include/vcpkg/input.h +++ b/include/vcpkg/input.h @@ -17,13 +17,11 @@ namespace vcpkg // triplet or similar which is no longer active. PackageSpec parse_package_spec(StringView spec_string, Triplet default_triplet, - bool& default_triplet_used, const LocalizedString& example_text); // Same as the above but checks the validity of the triplet. PackageSpec check_and_get_package_spec(StringView spec_string, Triplet default_triplet, - bool& default_triplet_used, const LocalizedString& example_text, const TripletDatabase& database); @@ -33,7 +31,6 @@ namespace vcpkg // Asserts that the package spec has a valid triplet. FullPackageSpec check_and_get_full_package_spec(StringView spec_string, Triplet default_triplet, - bool& default_triplet_used, const LocalizedString& example_text, const TripletDatabase& database); diff --git a/include/vcpkg/packagespec.h b/include/vcpkg/packagespec.h index a7917ec027..fcd36df2de 100644 --- a/include/vcpkg/packagespec.h +++ b/include/vcpkg/packagespec.h @@ -140,11 +140,9 @@ namespace vcpkg /// @param id add "default" if "core" is not present /// @return nullopt on success. On failure, caller should supplement returned string with more context. - ExpectedL to_full_spec(Triplet default_triplet, - bool& default_triplet_used, - ImplicitDefault id) const; + ExpectedL to_full_spec(Triplet default_triplet, ImplicitDefault id) const; - ExpectedL to_package_spec(Triplet default_triplet, bool& default_triplet_used) const; + ExpectedL to_package_spec(Triplet default_triplet) const; }; Optional parse_feature_name(ParserBase& parser); diff --git a/include/vcpkg/triplet.h b/include/vcpkg/triplet.h index c605d3e324..1f24d7088a 100644 --- a/include/vcpkg/triplet.h +++ b/include/vcpkg/triplet.h @@ -59,7 +59,6 @@ namespace vcpkg { Triplet default_triplet(const VcpkgCmdArguments& args, const TripletDatabase& database); Triplet default_host_triplet(const VcpkgCmdArguments& args, const TripletDatabase& database); - void print_default_triplet_warning(const VcpkgCmdArguments& arg, const TripletDatabase& database); struct TripletFile { diff --git a/locales/messages.json b/locales/messages.json index 0dd23c9236..32cadcd6dc 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -580,8 +580,6 @@ "DefaultFlag": "Defaulting to --{option} being on.", "_DefaultFlag.comment": "An example of {option} is editable.", "DefaultRegistryIsArtifact": "The default registry cannot be an artifact registry.", - "DefaultTripletChanged": "In the September 2023 release, the default triplet for vcpkg libraries changed from x86-windows to the detected host triplet ({triplet}). For the old behavior, add --triplet x86-windows . To suppress this message, add --triplet {triplet} .", - "_DefaultTripletChanged.comment": "The parts naming --triplet are command line switches that should be unlocalized. The space after the last 'triplet' and the period is intended to avoid the period looking like it's part of the command line switch An example of {triplet} is x64-windows.", "DeleteVcpkgConfigFromManifest": "-- Or remove \"vcpkg-configuration\" from the manifest file {path}.", "_DeleteVcpkgConfigFromManifest.comment": "An example of {path} is /foo/bar.", "DependencyFeatureCore": "the feature \"core\" cannot be in a dependency's feature list. To turn off default features, add \"default-features\": false instead.", diff --git a/src/vcpkg-test/specifier.cpp b/src/vcpkg-test/specifier.cpp index 7574692393..ca294f48c9 100644 --- a/src/vcpkg-test/specifier.cpp +++ b/src/vcpkg-test/specifier.cpp @@ -42,26 +42,19 @@ TEST_CASE ("specifier parsing", "[specifier]") REQUIRE(!spec.triplet); REQUIRE(!spec.platform); - bool default_triplet_used = false; - auto full_spec_implicit = spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::YES) - .value_or_exit(VCPKG_LINE_INFO); - REQUIRE(default_triplet_used); - default_triplet_used = false; + auto full_spec_implicit = + spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::YES).value_or_exit(VCPKG_LINE_INFO); REQUIRE(full_spec_implicit.package_spec.name() == "zlib"); REQUIRE(full_spec_implicit.package_spec.triplet() == Test::X86_WINDOWS); REQUIRE(full_spec_implicit.features == std::vector{"core", "default"}); - auto full_spec_explicit = spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::NO) - .value_or_exit(VCPKG_LINE_INFO); - REQUIRE(default_triplet_used); - default_triplet_used = false; + auto full_spec_explicit = + spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::NO).value_or_exit(VCPKG_LINE_INFO); REQUIRE(full_spec_explicit.package_spec.name() == "zlib"); REQUIRE(full_spec_explicit.package_spec.triplet() == Test::X86_WINDOWS); REQUIRE(full_spec_explicit.features == std::vector{"core"}); - auto package_spec = - spec.to_package_spec(Test::X86_WINDOWS, default_triplet_used).value_or_exit(VCPKG_LINE_INFO); - REQUIRE(default_triplet_used); + auto package_spec = spec.to_package_spec(Test::X86_WINDOWS).value_or_exit(VCPKG_LINE_INFO); REQUIRE(package_spec.name() == "zlib"); REQUIRE(package_spec.triplet() == Test::X86_WINDOWS); } @@ -74,24 +67,19 @@ TEST_CASE ("specifier parsing", "[specifier]") REQUIRE(spec.triplet.value_or_exit(VCPKG_LINE_INFO) == "x64-uwp"); REQUIRE(!spec.platform); - bool default_triplet_used = false; - auto full_spec_implicit = spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::YES) - .value_or_exit(VCPKG_LINE_INFO); - REQUIRE(!default_triplet_used); + auto full_spec_implicit = + spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::YES).value_or_exit(VCPKG_LINE_INFO); REQUIRE(full_spec_implicit.package_spec.name() == "zlib"); REQUIRE(full_spec_implicit.package_spec.triplet() == Test::X64_UWP); REQUIRE(full_spec_implicit.features == std::vector{"core", "default"}); - auto full_spec_explicit = spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::NO) - .value_or_exit(VCPKG_LINE_INFO); - REQUIRE(!default_triplet_used); + auto full_spec_explicit = + spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::NO).value_or_exit(VCPKG_LINE_INFO); REQUIRE(full_spec_explicit.package_spec.name() == "zlib"); REQUIRE(full_spec_explicit.package_spec.triplet() == Test::X64_UWP); REQUIRE(full_spec_explicit.features == std::vector{"core"}); - auto package_spec = - spec.to_package_spec(Test::X86_WINDOWS, default_triplet_used).value_or_exit(VCPKG_LINE_INFO); - REQUIRE(!default_triplet_used); + auto package_spec = spec.to_package_spec(Test::X86_WINDOWS).value_or_exit(VCPKG_LINE_INFO); REQUIRE(package_spec.name() == "zlib"); REQUIRE(package_spec.triplet() == Test::X64_UWP); } @@ -110,23 +98,19 @@ TEST_CASE ("specifier parsing", "[specifier]") REQUIRE(spec.triplet.value_or("") == "x64-uwp"); REQUIRE(!spec.platform); - bool default_triplet_used = false; - auto full_spec_implicit = spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::YES) - .value_or_exit(VCPKG_LINE_INFO); - REQUIRE(!default_triplet_used); + auto full_spec_implicit = + spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::YES).value_or_exit(VCPKG_LINE_INFO); REQUIRE(full_spec_implicit.package_spec.name() == "zlib"); REQUIRE(full_spec_implicit.package_spec.triplet() == Test::X64_UWP); REQUIRE(full_spec_implicit.features == std::vector{"feature", "core", "default"}); - auto full_spec_explicit = spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::NO) - .value_or_exit(VCPKG_LINE_INFO); - REQUIRE(!default_triplet_used); + auto full_spec_explicit = + spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::NO).value_or_exit(VCPKG_LINE_INFO); REQUIRE(full_spec_explicit.package_spec.name() == "zlib"); REQUIRE(full_spec_explicit.package_spec.triplet() == Test::X64_UWP); REQUIRE(full_spec_explicit.features == std::vector{"feature", "core"}); - auto maybe_package_spec = spec.to_package_spec(Test::X86_WINDOWS, default_triplet_used); - REQUIRE(!default_triplet_used); + auto maybe_package_spec = spec.to_package_spec(Test::X86_WINDOWS); REQUIRE(!maybe_package_spec.has_value()); REQUIRE(maybe_package_spec.error() == LocalizedString::from_raw("error: List of features is not allowed in this context")); @@ -182,22 +166,17 @@ TEST_CASE ("specifier parsing", "[specifier]") REQUIRE(!spec.triplet); REQUIRE(to_string(spec.platform.value_or_exit(VCPKG_LINE_INFO)) == "windows"); - bool default_triplet_used = false; - auto maybe_full_spec_implicit = - spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::YES); - REQUIRE(!default_triplet_used); + auto maybe_full_spec_implicit = spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::YES); REQUIRE(!maybe_full_spec_implicit.has_value()); REQUIRE(maybe_full_spec_implicit.error() == LocalizedString::from_raw("error: Platform qualifier is not allowed in this context")); - auto maybe_full_spec_explicit = spec.to_full_spec(Test::X86_WINDOWS, default_triplet_used, ImplicitDefault::NO); - REQUIRE(!default_triplet_used); + auto maybe_full_spec_explicit = spec.to_full_spec(Test::X86_WINDOWS, ImplicitDefault::NO); REQUIRE(!maybe_full_spec_explicit.has_value()); REQUIRE(maybe_full_spec_explicit.error() == LocalizedString::from_raw("error: Platform qualifier is not allowed in this context")); - auto maybe_package_spec = spec.to_package_spec(Test::X86_WINDOWS, default_triplet_used); - REQUIRE(!default_triplet_used); + auto maybe_package_spec = spec.to_package_spec(Test::X86_WINDOWS); REQUIRE(!maybe_package_spec.has_value()); REQUIRE(maybe_package_spec.error() == LocalizedString::from_raw("error: Platform qualifier is not allowed in this context")); diff --git a/src/vcpkg-test/util.cpp b/src/vcpkg-test/util.cpp index e86e2bf06b..436f8381cf 100644 --- a/src/vcpkg-test/util.cpp +++ b/src/vcpkg-test/util.cpp @@ -133,9 +133,7 @@ namespace vcpkg::Test { auto opt = parse_qualified_specifier(parser); REQUIRE(opt.has_value()); - bool unused = false; - ret.push_back( - opt.get()->to_full_spec(X86_WINDOWS, unused, ImplicitDefault::YES).value_or_exit(VCPKG_LINE_INFO)); + ret.push_back(opt.get()->to_full_spec(X86_WINDOWS, ImplicitDefault::YES).value_or_exit(VCPKG_LINE_INFO)); } return ret; diff --git a/src/vcpkg/commands.build-external.cpp b/src/vcpkg/commands.build-external.cpp index cb3ce55c68..1c11afafc6 100644 --- a/src/vcpkg/commands.build-external.cpp +++ b/src/vcpkg/commands.build-external.cpp @@ -27,16 +27,10 @@ namespace vcpkg { const ParsedArguments options = args.parse_arguments(CommandBuildExternalMetadata); - bool default_triplet_used = false; const FullPackageSpec spec = check_and_get_full_package_spec(options.command_arguments[0], default_triplet, - default_triplet_used, CommandBuildExternalMetadata.get_example_text(), paths.get_triplet_db()); - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } auto overlays = paths.overlay_ports; overlays.insert(overlays.begin(), options.command_arguments[1]); diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp index 8eac2887f1..14139c4cce 100644 --- a/src/vcpkg/commands.build.cpp +++ b/src/vcpkg/commands.build.cpp @@ -84,16 +84,10 @@ namespace vcpkg { // Build only takes a single package and all dependencies must already be installed const ParsedArguments options = args.parse_arguments(CommandBuildMetadata); - bool default_triplet_used = false; const FullPackageSpec spec = check_and_get_full_package_spec(options.command_arguments[0], default_triplet, - default_triplet_used, CommandBuildMetadata.get_example_text(), paths.get_triplet_db()); - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } auto& fs = paths.get_filesystem(); auto registry_set = paths.make_registry_set(); diff --git a/src/vcpkg/commands.check-support.cpp b/src/vcpkg/commands.check-support.cpp index 282b4d2af8..3f7b8efd09 100644 --- a/src/vcpkg/commands.check-support.cpp +++ b/src/vcpkg/commands.check-support.cpp @@ -121,20 +121,11 @@ namespace vcpkg Json::Array json_to_print; // only used when `use_json` - bool default_triplet_used = false; const std::vector specs = Util::fmap(options.command_arguments, [&](auto&& arg) { - return check_and_get_full_package_spec(arg, - default_triplet, - default_triplet_used, - CommandCheckSupportMetadata.get_example_text(), - paths.get_triplet_db()); + return check_and_get_full_package_spec( + arg, default_triplet, CommandCheckSupportMetadata.get_example_text(), paths.get_triplet_db()); }); - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } - auto& fs = paths.get_filesystem(); auto registry_set = paths.make_registry_set(); PathsPortFileProvider provider( diff --git a/src/vcpkg/commands.ci.cpp b/src/vcpkg/commands.ci.cpp index ed152c156d..2bb533ea71 100644 --- a/src/vcpkg/commands.ci.cpp +++ b/src/vcpkg/commands.ci.cpp @@ -328,9 +328,6 @@ namespace vcpkg Triplet host_triplet) { msg::println_warning(msgInternalCICommand); - - print_default_triplet_warning(args, paths.get_triplet_db()); - const ParsedArguments options = args.parse_arguments(CommandCiMetadata); const auto& settings = options.settings; diff --git a/src/vcpkg/commands.depend-info.cpp b/src/vcpkg/commands.depend-info.cpp index 401e69b546..4874987e3b 100644 --- a/src/vcpkg/commands.depend-info.cpp +++ b/src/vcpkg/commands.depend-info.cpp @@ -396,20 +396,11 @@ namespace vcpkg const ParsedArguments options = args.parse_arguments(CommandDependInfoMetadata); const auto strategy = determine_depend_info_mode(options).value_or_exit(VCPKG_LINE_INFO); - bool default_triplet_used = false; const std::vector specs = Util::fmap(options.command_arguments, [&](auto&& arg) { - return check_and_get_full_package_spec(arg, - default_triplet, - default_triplet_used, - CommandDependInfoMetadata.get_example_text(), - paths.get_triplet_db()); + return check_and_get_full_package_spec( + arg, default_triplet, CommandDependInfoMetadata.get_example_text(), paths.get_triplet_db()); }); - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } - auto& fs = paths.get_filesystem(); auto registry_set = paths.make_registry_set(); PathsPortFileProvider provider( diff --git a/src/vcpkg/commands.export.cpp b/src/vcpkg/commands.export.cpp index e44af7a404..01698f5570 100644 --- a/src/vcpkg/commands.export.cpp +++ b/src/vcpkg/commands.export.cpp @@ -396,16 +396,9 @@ namespace else { // input sanitization - bool default_triplet_used = false; ret.specs = Util::fmap(options.command_arguments, [&](auto&& arg) { - return parse_package_spec( - arg, default_triplet, default_triplet_used, CommandExportMetadata.get_example_text()); + return parse_package_spec(arg, default_triplet, CommandExportMetadata.get_example_text()); }); - - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } } if (!ret.raw && !ret.nuget && !ret.ifw && !ret.zip && !ret.seven_zip && !ret.dry_run && !ret.chocolatey && diff --git a/src/vcpkg/commands.install.cpp b/src/vcpkg/commands.install.cpp index 5a2e05c040..fbf73ea246 100644 --- a/src/vcpkg/commands.install.cpp +++ b/src/vcpkg/commands.install.cpp @@ -1088,8 +1088,6 @@ namespace vcpkg msg::print(usage_for_command(CommandInstallMetadataManifest)); Checks::exit_fail(VCPKG_LINE_INFO); } - - print_default_triplet_warning(args, paths.get_triplet_db()); } else { @@ -1286,20 +1284,11 @@ namespace vcpkg PathsPortFileProvider provider( fs, *registry_set, make_overlay_provider(fs, paths.original_cwd, paths.overlay_ports)); - bool default_triplet_used = false; const std::vector specs = Util::fmap(options.command_arguments, [&](auto&& arg) { - return check_and_get_full_package_spec(arg, - default_triplet, - default_triplet_used, - CommandInstallMetadataClassic.get_example_text(), - paths.get_triplet_db()); + return check_and_get_full_package_spec( + arg, default_triplet, CommandInstallMetadataClassic.get_example_text(), paths.get_triplet_db()); }); - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } - // create the plan msg::println(msgComputingInstallPlan); StatusParagraphs status_db = database_load_check(fs, paths.installed()); diff --git a/src/vcpkg/commands.remove.cpp b/src/vcpkg/commands.remove.cpp index 9e489dfd35..2fb34e93b3 100644 --- a/src/vcpkg/commands.remove.cpp +++ b/src/vcpkg/commands.remove.cpp @@ -219,16 +219,9 @@ namespace vcpkg Checks::exit_fail(VCPKG_LINE_INFO); } - bool default_triplet_used = false; specs = Util::fmap(options.command_arguments, [&](auto&& arg) { - return parse_package_spec( - arg, default_triplet, default_triplet_used, CommandRemoveMetadata.get_example_text()); + return parse_package_spec(arg, default_triplet, CommandRemoveMetadata.get_example_text()); }); - - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } } const Purge purge = Util::Sets::contains(options.switches, OPTION_PURGE) ? Purge::YES : Purge::NO; diff --git a/src/vcpkg/commands.set-installed.cpp b/src/vcpkg/commands.set-installed.cpp index e4040698f8..15fbf95122 100644 --- a/src/vcpkg/commands.set-installed.cpp +++ b/src/vcpkg/commands.set-installed.cpp @@ -281,20 +281,11 @@ namespace vcpkg { // input sanitization const ParsedArguments options = args.parse_arguments(CommandSetInstalledMetadata); - bool default_triplet_used = false; const std::vector specs = Util::fmap(options.command_arguments, [&](auto&& arg) { - return check_and_get_full_package_spec(arg, - default_triplet, - default_triplet_used, - CommandSetInstalledMetadata.get_example_text(), - paths.get_triplet_db()); + return check_and_get_full_package_spec( + arg, default_triplet, CommandSetInstalledMetadata.get_example_text(), paths.get_triplet_db()); }); - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } - const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); const bool only_downloads = Util::Sets::contains(options.switches, OPTION_ONLY_DOWNLOADS); const KeepGoing keep_going = Util::Sets::contains(options.switches, OPTION_KEEP_GOING) || only_downloads diff --git a/src/vcpkg/commands.upgrade.cpp b/src/vcpkg/commands.upgrade.cpp index ae3dd056c9..36a2641f5e 100644 --- a/src/vcpkg/commands.upgrade.cpp +++ b/src/vcpkg/commands.upgrade.cpp @@ -95,20 +95,11 @@ namespace vcpkg else { // input sanitization - bool default_triplet_used = false; const std::vector specs = Util::fmap(options.command_arguments, [&](auto&& arg) { - return check_and_get_package_spec(arg, - default_triplet, - default_triplet_used, - CommandUpgradeMetadata.get_example_text(), - paths.get_triplet_db()); + return check_and_get_package_spec( + arg, default_triplet, CommandUpgradeMetadata.get_example_text(), paths.get_triplet_db()); }); - if (default_triplet_used) - { - print_default_triplet_warning(args, paths.get_triplet_db()); - } - std::vector not_installed; std::vector no_control_file; std::vector to_upgrade; diff --git a/src/vcpkg/input.cpp b/src/vcpkg/input.cpp index bc1d9e889a..d0baee0ad6 100644 --- a/src/vcpkg/input.cpp +++ b/src/vcpkg/input.cpp @@ -11,15 +11,12 @@ namespace vcpkg { - PackageSpec parse_package_spec(StringView spec_string, - Triplet default_triplet, - bool& default_triplet_used, - const LocalizedString& example_text) + PackageSpec parse_package_spec(StringView spec_string, Triplet default_triplet, const LocalizedString& example_text) { auto maybe_qualified_specifier = parse_qualified_specifier(Strings::ascii_to_lowercase(spec_string)); if (auto qualified_specifier = maybe_qualified_specifier.get()) { - auto expected_spec = qualified_specifier->to_package_spec(default_triplet, default_triplet_used); + auto expected_spec = qualified_specifier->to_package_spec(default_triplet); if (auto spec = expected_spec.get()) { return std::move(*spec); @@ -50,7 +47,6 @@ namespace vcpkg PackageSpec check_and_get_package_spec(StringView spec_string, Triplet default_triplet, - bool& default_triplet_used, const LocalizedString& example_text, const TripletDatabase& database) { @@ -62,7 +58,7 @@ namespace vcpkg check_triplet(*specified_triplet, database); } - auto expected_spec = qualified_specifier->to_package_spec(default_triplet, default_triplet_used); + auto expected_spec = qualified_specifier->to_package_spec(default_triplet); if (auto spec = expected_spec.get()) { return std::move(*spec); @@ -81,7 +77,6 @@ namespace vcpkg FullPackageSpec check_and_get_full_package_spec(StringView spec_string, Triplet default_triplet, - bool& default_triplet_used, const LocalizedString& example_text, const TripletDatabase& database) { @@ -93,8 +88,7 @@ namespace vcpkg check_triplet(*specified_triplet, database); } - auto expected_spec = - qualified_specifier->to_full_spec(default_triplet, default_triplet_used, ImplicitDefault::YES); + auto expected_spec = qualified_specifier->to_full_spec(default_triplet, ImplicitDefault::YES); if (auto spec = expected_spec.get()) { return std::move(*spec); diff --git a/src/vcpkg/packagespec.cpp b/src/vcpkg/packagespec.cpp index 266c44e49c..25557afdce 100644 --- a/src/vcpkg/packagespec.cpp +++ b/src/vcpkg/packagespec.cpp @@ -7,16 +7,13 @@ namespace { using namespace vcpkg; - Triplet resolve_triplet(const Optional& specified_triplet, - Triplet default_triplet, - bool& default_triplet_used) + Triplet resolve_triplet(const Optional& specified_triplet, Triplet default_triplet) { if (auto pspecified = specified_triplet.get()) { return Triplet::from_canonical_name(*pspecified); } - default_triplet_used = true; return default_triplet; } } // unnamed namespace @@ -91,9 +88,7 @@ namespace vcpkg return left.name() == right.name() && left.triplet() == right.triplet(); } - ExpectedL ParsedQualifiedSpecifier::to_full_spec(Triplet default_triplet, - bool& default_triplet_used, - ImplicitDefault id) const + ExpectedL ParsedQualifiedSpecifier::to_full_spec(Triplet default_triplet, ImplicitDefault id) const { if (platform) { @@ -106,12 +101,10 @@ namespace vcpkg fs = *pfeatures; } - return FullPackageSpec{{name, resolve_triplet(triplet, default_triplet, default_triplet_used)}, - internalize_feature_list(fs, id)}; + return FullPackageSpec{{name, resolve_triplet(triplet, default_triplet)}, internalize_feature_list(fs, id)}; } - ExpectedL ParsedQualifiedSpecifier::to_package_spec(Triplet default_triplet, - bool& default_triplet_used) const + ExpectedL ParsedQualifiedSpecifier::to_package_spec(Triplet default_triplet) const { if (platform) { @@ -123,7 +116,7 @@ namespace vcpkg return msg::format_error(msgIllegalFeatures); } - return PackageSpec{name, resolve_triplet(triplet, default_triplet, default_triplet_used)}; + return PackageSpec{name, resolve_triplet(triplet, default_triplet)}; } ExpectedL parse_qualified_specifier(StringView input) diff --git a/src/vcpkg/triplet.cpp b/src/vcpkg/triplet.cpp index 8647395406..9a401b55c5 100644 --- a/src/vcpkg/triplet.cpp +++ b/src/vcpkg/triplet.cpp @@ -123,20 +123,6 @@ namespace vcpkg return Triplet::from_canonical_name(host_triplet_name); } - void print_default_triplet_warning(const VcpkgCmdArguments& args, const TripletDatabase& database) - { - (void)args; - (void)database; -#if defined(_WIN32) - if (!args.triplet.has_value()) - { - // Remove this warning in March 2024 - // The triplet is not set by --triplet or VCPKG_DEFAULT_TRIPLET - msg::println_warning(msgDefaultTripletChanged, msg::triplet = default_host_triplet(args, database)); - } -#endif // ^^^ _WIN32 - } - TripletFile::TripletFile(StringView name, StringView location) : name(name.data(), name.size()), location(location) { }