From 14afed239f829dde4234dd4b8a36847978a19618 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 13 Nov 2024 12:47:19 -0800 Subject: [PATCH] Delete the actual overlay-port-dirs feature. --- .../overlays-dot/vcpkg-configuration.json | 2 +- .../vcpkg-configuration.json | 2 +- .../vcpkg-configuration.json | 2 +- .../another-vcpkg-empty-port/portfile.cmake | 1 - .../another-vcpkg-empty-port/vcpkg.json | 4 -- .../cli-overlays/portfile.cmake | 1 - .../cli-overlays/vcpkg.json | 4 -- .../config-overlays/beicode/portfile.cmake | 21 -------- .../config-overlays/beicode/vcpkg.json | 6 --- .../config-overlays/portfile.cmake | 1 - .../config-overlays/vcpkg.json | 4 -- .../env-overlays/portfile.cmake | 1 - .../vcpkg-empty-port/portfile.cmake | 1 - .../env-overlays/vcpkg-empty-port/vcpkg.json | 4 -- .../env-overlays/vcpkg.json | 4 -- .../my-triplets/fancy-triplet.cmake | 18 ------- .../vcpkg-configuration.json | 4 -- .../vcpkg.json | 7 --- .../end-to-end-tests-dir/overlays.ps1 | 34 ++----------- docs/vcpkg-configuration.schema.json | 7 --- include/vcpkg/base/contractual-constants.h | 3 -- include/vcpkg/base/message-data.inc.h | 11 ++--- include/vcpkg/configuration.h | 1 - include/vcpkg/portfileprovider.h | 4 +- include/vcpkg/vcpkgcmdarguments.h | 2 - locales/messages.json | 6 +-- src/vcpkg/commands.install.cpp | 2 +- src/vcpkg/configuration.cpp | 12 ----- src/vcpkg/portfileprovider.cpp | 48 ++++++++++--------- src/vcpkg/vcpkgcmdarguments.cpp | 14 +----- src/vcpkg/vcpkgpaths.cpp | 9 +--- 31 files changed, 43 insertions(+), 197 deletions(-) delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/portfile.cmake delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/vcpkg.json delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/portfile.cmake delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/vcpkg.json delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/portfile.cmake delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/vcpkg.json delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/portfile.cmake delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/vcpkg.json delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/portfile.cmake delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/portfile.cmake delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/vcpkg.json delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg.json delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/my-triplets/fancy-triplet.cmake delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg-configuration.json delete mode 100644 azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg.json diff --git a/azure-pipelines/e2e-projects/overlays-dot/vcpkg-configuration.json b/azure-pipelines/e2e-projects/overlays-dot/vcpkg-configuration.json index a1667fc2d1..8bf3475a84 100644 --- a/azure-pipelines/e2e-projects/overlays-dot/vcpkg-configuration.json +++ b/azure-pipelines/e2e-projects/overlays-dot/vcpkg-configuration.json @@ -1,3 +1,3 @@ { - "overlay-port-dirs": [ "." ] + "overlay-ports": [ "." ] } diff --git a/azure-pipelines/e2e-projects/overlays-malformed-shadowing/vcpkg-configuration.json b/azure-pipelines/e2e-projects/overlays-malformed-shadowing/vcpkg-configuration.json index 88a24a9219..cbf8b52cfe 100644 --- a/azure-pipelines/e2e-projects/overlays-malformed-shadowing/vcpkg-configuration.json +++ b/azure-pipelines/e2e-projects/overlays-malformed-shadowing/vcpkg-configuration.json @@ -1,4 +1,4 @@ { "$comment": "'config-overlays/a' in . should get loaded first, so we should never consider 'config-overlays/malformed/a'", - "overlay-port-dirs": [ "config-overlays", "config-overlays/malformed" ] + "overlay-ports": [ "config-overlays", "config-overlays/malformed" ] } diff --git a/azure-pipelines/e2e-projects/overlays-not-quite-dot/vcpkg-configuration.json b/azure-pipelines/e2e-projects/overlays-not-quite-dot/vcpkg-configuration.json index ddd81de124..dfbb7f3ebc 100644 --- a/azure-pipelines/e2e-projects/overlays-not-quite-dot/vcpkg-configuration.json +++ b/azure-pipelines/e2e-projects/overlays-not-quite-dot/vcpkg-configuration.json @@ -1,3 +1,3 @@ { - "overlay-port-dirs": [ "./hello/.." ] + "overlay-ports": [ "./hello/.." ] } diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/portfile.cmake b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/portfile.cmake deleted file mode 100644 index 065116c276..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/vcpkg.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/vcpkg.json deleted file mode 100644 index baf6dd9a57..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/another-vcpkg-empty-port/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "another-vcpkg-empty-port", - "version": "0" -} diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/portfile.cmake b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/portfile.cmake deleted file mode 100644 index aef13f8bcf..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "overlay-port-dirs should prevent this directory being interpreted as an overlay-port") diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/vcpkg.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/vcpkg.json deleted file mode 100644 index baf6dd9a57..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/cli-overlays/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "another-vcpkg-empty-port", - "version": "0" -} diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/portfile.cmake b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/portfile.cmake deleted file mode 100644 index c03dfab71e..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/portfile.cmake +++ /dev/null @@ -1,21 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO northwindtraders/beicode - REF 19a1f95c2f56a27ced90227b5e2754a602a08e69 - SHA512 7b2bb7acb2a8ff07bff59cfa27247a7b2cced03828919cd65cc0c8cf1f724f5f1e947ed6992dcdbc913fb470694a52613d1861eaaadbf8903e94eb9cdfe4d000 - HEAD_REF main -) - -vcpkg_configure_cmake( - SOURCE_PATH "${SOURCE_PATH}" - PREFER_NINJA -) -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file( - INSTALL "${SOURCE_PATH}/LICENSE" - DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" - RENAME copyright) \ No newline at end of file diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/vcpkg.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/vcpkg.json deleted file mode 100644 index 945db90b35..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/beicode/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "beicode", - "version": "1.0.0", - "description": "A simple utf-8 based unicode decoding and encoding library", - "homepage": "https://github.com/northwindtraders/beicode" -} \ No newline at end of file diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/portfile.cmake b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/portfile.cmake deleted file mode 100644 index aef13f8bcf..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "overlay-port-dirs should prevent this directory being interpreted as an overlay-port") diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/vcpkg.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/vcpkg.json deleted file mode 100644 index cd2e87fbe6..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/config-overlays/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "beicode", - "version": "0" -} diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/portfile.cmake b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/portfile.cmake deleted file mode 100644 index aef13f8bcf..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "overlay-port-dirs should prevent this directory being interpreted as an overlay-port") diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/portfile.cmake b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/portfile.cmake deleted file mode 100644 index 065116c276..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/vcpkg.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/vcpkg.json deleted file mode 100644 index 1f42aa9278..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg-empty-port/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "vcpkg-empty-port", - "version": "0" -} diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg.json deleted file mode 100644 index 1f42aa9278..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/env-overlays/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "vcpkg-empty-port", - "version": "0" -} diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/my-triplets/fancy-triplet.cmake b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/my-triplets/fancy-triplet.cmake deleted file mode 100644 index 91a235b525..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/my-triplets/fancy-triplet.cmake +++ /dev/null @@ -1,18 +0,0 @@ -if(CMAKE_HOST_WIN32) -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE static) -set(VCPKG_LIBRARY_LINKAGE dynamic) -elseif(CMAKE_HOST_APPLE) -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE static) - -set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES x86_64) -else() -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE static) - -set(VCPKG_CMAKE_SYSTEM_NAME Linux) -endif() diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg-configuration.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg-configuration.json deleted file mode 100644 index d6e6ed2f35..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg-configuration.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "overlay-port-dirs": [ "./config-overlays" ], - "overlay-triplets": [ "./my-triplets" ] -} diff --git a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg.json b/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg.json deleted file mode 100644 index 797d3da4ea..0000000000 --- a/azure-pipelines/e2e-projects/overlays-project-with-config-dirs/vcpkg.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": [ - "vcpkg-empty-port", - "another-vcpkg-empty-port", - "beicode" - ] -} diff --git a/azure-pipelines/end-to-end-tests-dir/overlays.ps1 b/azure-pipelines/end-to-end-tests-dir/overlays.ps1 index ab77531494..9f32317f07 100644 --- a/azure-pipelines/end-to-end-tests-dir/overlays.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/overlays.ps1 @@ -4,8 +4,7 @@ Copy-Item -Recurse -LiteralPath @( "$PSScriptRoot/../e2e-projects/overlays-malformed-shadowing", "$PSScriptRoot/../e2e-projects/overlays-project-config-embedded", - "$PSScriptRoot/../e2e-projects/overlays-project-with-config", - "$PSScriptRoot/../e2e-projects/overlays-project-with-config-dirs" + "$PSScriptRoot/../e2e-projects/overlays-project-with-config" ) $TestingRoot $manifestRoot = "$TestingRoot/overlays-project-with-config" @@ -18,33 +17,6 @@ Run-Vcpkg install --x-manifest-root=$manifestRoot ` --triplet fancy-triplet Throw-IfFailed -# And also with overlay-port-dirs -$manifestRoot = "$TestingRoot/overlays-project-with-config-dirs" -$canonicalManifestRoot = (Get-Item $manifestRoot).FullName -Remove-Item env:VCPKG_OVERLAY_PORTS -$env:VCPKG_OVERLAY_PORT_DIRS = "$manifestRoot/env-overlays" - -Run-Vcpkg install --x-manifest-root=$manifestRoot ` - --overlay-port-dirs=$manifestRoot/cli-overlays ` - --overlay-triplets=$manifestRoot/my-triplets ` - --x-install-root=$installRoot ` - --triplet fancy-triplet -Throw-IfFailed - -# ... but not if the manifest directory is an overlay -$output = Run-VcpkgAndCaptureStdErr install --x-manifest-root=$manifestRoot ` - --overlay-port-dirs=$manifestRoot ` - --overlay-port-dirs=$manifestRoot/cli-overlays ` - --overlay-triplets=$manifestRoot/my-triplets ` - --x-install-root=$installRoot ` - --triplet fancy-triplet -Throw-IfNotFailed -Throw-IfNonContains -Actual $output -Expected @" -The manifest directory ($canonicalManifestRoot) cannot be the same as a directory configured as an overlay-port or overlay-port-dir. -"@ - -Remove-Item env:VCPKG_OVERLAY_PORT_DIRS - # Tests overlays configured in env and cli on a project with configuration embedded on the manifest file $manifestRoot = "$TestingRoot/overlays-project-config-embedded" $env:VCPKG_OVERLAY_PORTS = "$manifestRoot/env-overlays" @@ -102,7 +74,7 @@ $manifestRoot = "$PSScriptRoot/../e2e-projects/overlays-dot" $output = Run-VcpkgAndCaptureStdErr install --x-manifest-root=$manifestRoot --x-install-root=$installRoot Throw-IfNotFailed Throw-IfNonContains -Actual $output -Expected @" -error: The manifest directory cannot be the same as a directory configured as an overlay-port or overlay-port-dir, so "overlay-ports" and "overlay-port-dir" values cannot be ".". +error: The manifest directory cannot be the same as a directory configured in overlay-ports, so "overlay-ports" values cannot be ".". "@ # Test that trying to declare overlay-ports as the same directory in a roundabout way fails @@ -111,7 +83,7 @@ $canonicalManifestRoot = (Get-Item $manifestRoot).FullName $output = Run-VcpkgAndCaptureStdErr install --x-manifest-root=$manifestRoot --x-install-root=$installRoot Throw-IfNotFailed Throw-IfNonContains -Actual $output -Expected @" -The manifest directory ($canonicalManifestRoot) cannot be the same as a directory configured as an overlay-port or overlay-port-dir. +The manifest directory ($canonicalManifestRoot) cannot be the same as a directory configured in overlay-ports. "@ # Test that removals can happen without the overlay triplets diff --git a/docs/vcpkg-configuration.schema.json b/docs/vcpkg-configuration.schema.json index 949d61d1d6..eb0aa2461d 100644 --- a/docs/vcpkg-configuration.schema.json +++ b/docs/vcpkg-configuration.schema.json @@ -21,13 +21,6 @@ "type": "string", "description": "A message to print if this entry is evaluated." }, - "overlay-port-dirs": { - "type": "array", - "description": "An array of port overlay directory paths.", - "items": { - "type": "string" - } - }, "overlay-ports": { "type": "array", "description": "An array of port overlay paths.", diff --git a/include/vcpkg/base/contractual-constants.h b/include/vcpkg/base/contractual-constants.h index ee77642efe..1dd7d6fbc9 100644 --- a/include/vcpkg/base/contractual-constants.h +++ b/include/vcpkg/base/contractual-constants.h @@ -69,7 +69,6 @@ namespace vcpkg inline constexpr StringLiteral JsonIdMicrosoft = "microsoft"; inline constexpr StringLiteral JsonIdName = "name"; inline constexpr StringLiteral JsonIdOverlayPorts = "overlay-ports"; - inline constexpr StringLiteral JsonIdOverlayPortDirs = "overlay-port-dirs"; inline constexpr StringLiteral JsonIdOverlayTriplets = "overlay-triplets"; inline constexpr StringLiteral JsonIdOverrides = "overrides"; inline constexpr StringLiteral JsonIdPackages = "packages"; @@ -252,7 +251,6 @@ namespace vcpkg inline constexpr StringLiteral SwitchOutput = "output"; inline constexpr StringLiteral SwitchOutputDir = "output-dir"; inline constexpr StringLiteral SwitchOutputHashes = "output-hashes"; - inline constexpr StringLiteral SwitchOverlayPortDirs = "overlay-port-dirs"; inline constexpr StringLiteral SwitchOverlayPorts = "overlay-ports"; inline constexpr StringLiteral SwitchOverlayTriplets = "overlay-triplets"; inline constexpr StringLiteral SwitchOverwriteVersion = "overwrite-version"; @@ -537,7 +535,6 @@ namespace vcpkg inline constexpr StringLiteral EnvironmentVariableVcpkgMaxConcurrency = "VCPKG_MAX_CONCURRENCY"; inline constexpr StringLiteral EnvironmentVariableVcpkgNoCi = "VCPKG_NO_CI"; inline constexpr StringLiteral EnvironmentVariableVcpkgNuGetRepository = "VCPKG_NUGET_REPOSITORY"; - inline constexpr StringLiteral EnvironmentVariableVcpkgOverlayPortDirs = "VCPKG_OVERLAY_PORT_DIRS"; inline constexpr StringLiteral EnvironmentVariableVcpkgOverlayPorts = "VCPKG_OVERLAY_PORTS"; inline constexpr StringLiteral EnvironmentVariableVcpkgRoot = "VCPKG_ROOT"; inline constexpr StringLiteral EnvironmentVariableVcpkgUseNuGetCache = "VCPKG_USE_NUGET_CACHE"; diff --git a/include/vcpkg/base/message-data.inc.h b/include/vcpkg/base/message-data.inc.h index b8a2cbba55..3e2ce4e735 100644 --- a/include/vcpkg/base/message-data.inc.h +++ b/include/vcpkg/base/message-data.inc.h @@ -1123,13 +1123,12 @@ DECLARE_MESSAGE(ErrorInvalidManifestModeOption, DECLARE_MESSAGE(ErrorManifestMustDifferFromOverlay, (msg::path), "", - "The manifest directory ({path}) cannot be the same as a directory configured as an overlay-port or " - "overlay-port-dir.") + "The manifest directory ({path}) cannot be the same as a directory configured in overlay-ports.") DECLARE_MESSAGE(ErrorManifestMustDifferFromOverlayDot, (), "", - "The manifest directory cannot be the same as a directory configured as an overlay-port or " - "overlay-port-dir, so \"overlay-ports\" and \"overlay-port-dir\" values cannot be \".\".") + "The manifest directory cannot be the same as a directory configured in overlay-ports, so " + "\"overlay-ports\" values cannot be \".\".") DECLARE_MESSAGE( ErrorMissingVcpkgRoot, (), @@ -2236,10 +2235,6 @@ DECLARE_MESSAGE(Options, (), "Printed just before a list of options for a comman DECLARE_MESSAGE(OriginalBinParagraphHeader, (), "", "\nOriginal Binary Paragraph") DECLARE_MESSAGE(OtherCommandsHeader, (), "", "Other") DECLARE_MESSAGE(OverlayPatchDir, (msg::path), "", "Overlay path \"{path}\" must be an existing directory.") -DECLARE_MESSAGE(OverlayPortDirsHelp, - (msg::env_var), - "", - "Directories containing overlay-port directories (also: {env_var})") DECLARE_MESSAGE(OverlayPortsHelp, (msg::env_var), "", diff --git a/include/vcpkg/configuration.h b/include/vcpkg/configuration.h index ac9c416e79..79d4d0fe9f 100644 --- a/include/vcpkg/configuration.h +++ b/include/vcpkg/configuration.h @@ -51,7 +51,6 @@ namespace vcpkg std::vector registries; Json::Object ce_metadata; Json::Object extra_info; - std::vector overlay_port_dirs; std::vector overlay_ports; std::vector overlay_triplets; diff --git a/include/vcpkg/portfileprovider.h b/include/vcpkg/portfileprovider.h index e194fa202a..312e26d66f 100644 --- a/include/vcpkg/portfileprovider.h +++ b/include/vcpkg/portfileprovider.h @@ -19,7 +19,7 @@ namespace vcpkg { struct OverlayPortPaths { - std::vector overlay_port_dirs; + Optional builtin_overlay_port_dir; std::vector overlay_ports; bool empty() const noexcept; @@ -37,6 +37,8 @@ namespace vcpkg ExpectedL try_load_all_ports(const ReadOnlyFilesystem& fs, std::map& out); + void check_directory(const ReadOnlyFilesystem& fs) const; + private: OverlayPortKind m_kind; Path m_directory; diff --git a/include/vcpkg/vcpkgcmdarguments.h b/include/vcpkg/vcpkgcmdarguments.h index 27b2089649..37109d3056 100644 --- a/include/vcpkg/vcpkgcmdarguments.h +++ b/include/vcpkg/vcpkgcmdarguments.h @@ -228,8 +228,6 @@ namespace vcpkg Optional triplet; Optional host_triplet; - std::vector cli_overlay_port_dirs; - std::vector env_overlay_port_dirs; std::vector cli_overlay_ports; std::vector env_overlay_ports; std::vector cli_overlay_triplets; diff --git a/locales/messages.json b/locales/messages.json index a4fa7ebbe2..a7e03c113f 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -650,9 +650,9 @@ "_ErrorInvalidExtractOption.comment": "The keyword 'AUTO' should not be localized An example of {option} is editable.", "ErrorInvalidManifestModeOption": "The option --{option} is not supported in manifest mode.", "_ErrorInvalidManifestModeOption.comment": "An example of {option} is editable.", - "ErrorManifestMustDifferFromOverlay": "The manifest directory ({path}) cannot be the same as a directory configured as an overlay-port or overlay-port-dir.", + "ErrorManifestMustDifferFromOverlay": "The manifest directory ({path}) cannot be the same as a directory configured in overlay-ports.", "_ErrorManifestMustDifferFromOverlay.comment": "An example of {path} is /foo/bar.", - "ErrorManifestMustDifferFromOverlayDot": "The manifest directory cannot be the same as a directory configured as an overlay-port or overlay-port-dir, so \"overlay-ports\" and \"overlay-port-dir\" values cannot be \".\".", + "ErrorManifestMustDifferFromOverlayDot": "The manifest directory cannot be the same as a directory configured in overlay-ports, so \"overlay-ports\" values cannot be \".\".", "ErrorMissingVcpkgRoot": "Could not detect vcpkg-root. If you are trying to use a copy of vcpkg that you've built, you must define the VCPKG_ROOT environment variable to point to a cloned copy of https://github.com/Microsoft/vcpkg.", "ErrorNoVSInstance": "in triplet {triplet}: Unable to find a valid Visual Studio instance", "_ErrorNoVSInstance.comment": "An example of {triplet} is x64-windows.", @@ -1233,8 +1233,6 @@ "OtherCommandsHeader": "Other", "OverlayPatchDir": "Overlay path \"{path}\" must be an existing directory.", "_OverlayPatchDir.comment": "An example of {path} is /foo/bar.", - "OverlayPortDirsHelp": "Directories containing overlay-port directories (also: {env_var})", - "_OverlayPortDirsHelp.comment": "An example of {env_var} is VCPKG_DEFAULT_TRIPLET.", "OverlayPortsHelp": "Overlay-port directories, or directories containing overlay-port directories (also: {env_var})", "_OverlayPortsHelp.comment": "An example of {env_var} is VCPKG_DEFAULT_TRIPLET.", "OverlayTripletDirectoriesHelp": "Directories of overlay triplets (also: {env_var})", diff --git a/src/vcpkg/commands.install.cpp b/src/vcpkg/commands.install.cpp index 8e40a1c74c..43f9e5787b 100644 --- a/src/vcpkg/commands.install.cpp +++ b/src/vcpkg/commands.install.cpp @@ -1239,7 +1239,7 @@ namespace vcpkg auto extended_overlay_port_directories = paths.overlay_ports; if (add_builtin_ports_directory_as_overlay) { - extended_overlay_port_directories.overlay_ports.emplace_back(paths.builtin_ports_directory()); + extended_overlay_port_directories.builtin_overlay_port_dir.emplace(paths.builtin_ports_directory()); } auto oprovider = diff --git a/src/vcpkg/configuration.cpp b/src/vcpkg/configuration.cpp index 61a43bcf0a..9aa32cd370 100644 --- a/src/vcpkg/configuration.cpp +++ b/src/vcpkg/configuration.cpp @@ -548,8 +548,6 @@ namespace } r.optional_object_field(obj, JsonIdOverlayPorts, ret.overlay_ports, OverlayPathArrayDeserializer::instance); - r.optional_object_field( - obj, JsonIdOverlayPortDirs, ret.overlay_port_dirs, OverlayPathArrayDeserializer::instance); r.optional_object_field( obj, JsonIdOverlayTriplets, ret.overlay_triplets, OverlayTripletsPathArrayDeserializer::instance); @@ -773,7 +771,6 @@ namespace vcpkg JsonIdDefaultRegistry, JsonIdRegistries, JsonIdOverlayPorts, - JsonIdOverlayPortDirs, JsonIdOverlayTriplets, JsonIdMessage, JsonIdWarning, @@ -962,15 +959,6 @@ namespace vcpkg } } - if (!overlay_port_dirs.empty()) - { - auto& opd_arr = obj.insert(JsonIdOverlayPortDirs, Json::Array()); - for (const auto& port : overlay_port_dirs) - { - opd_arr.push_back(port); - } - } - if (!overlay_ports.empty()) { auto& op_arr = obj.insert(JsonIdOverlayPorts, Json::Array()); diff --git a/src/vcpkg/portfileprovider.cpp b/src/vcpkg/portfileprovider.cpp index 08ac747bc2..04c1c9f428 100644 --- a/src/vcpkg/portfileprovider.cpp +++ b/src/vcpkg/portfileprovider.cpp @@ -239,6 +239,16 @@ namespace vcpkg } } + void OverlayPortIndexEntry::check_directory(const ReadOnlyFilesystem& fs) const + { + Debug::println("Using overlay: ", m_directory); + + Checks::msg_check_exit(VCPKG_LINE_INFO, + vcpkg::is_directory(fs.status(m_directory, VCPKG_LINE_INFO)), + msgOverlayPatchDir, + msg::path = m_directory); + } + struct OverlayPortIndex { OverlayPortIndex() = delete; @@ -247,9 +257,9 @@ namespace vcpkg OverlayPortIndex(const OverlayPortPaths& paths) { - for (auto&& overlay_port_dir : paths.overlay_port_dirs) + if (auto builtin_overlay_port_dir = paths.builtin_overlay_port_dir.get()) { - m_entries.emplace_back(OverlayPortKind::Directory, overlay_port_dir); + m_entries.emplace_back(OverlayPortKind::Directory, *builtin_overlay_port_dir); } for (auto&& overlay_port : paths.overlay_ports) @@ -287,10 +297,22 @@ namespace vcpkg return Unit{}; } + void check_directories(const ReadOnlyFilesystem& fs) + { + for (auto&& overlay : m_entries) + { + overlay.check_directory(fs); + } + } + + private: std::vector m_entries; }; - bool OverlayPortPaths::empty() const noexcept { return overlay_port_dirs.empty() && overlay_ports.empty(); } + bool OverlayPortPaths::empty() const noexcept + { + return !builtin_overlay_port_dir.has_value() && overlay_ports.empty(); + } MapPortFileProvider::MapPortFileProvider(const std::unordered_map& map) : ports(map) @@ -492,25 +514,7 @@ namespace vcpkg OverlayProviderImpl(const ReadOnlyFilesystem& fs, const OverlayPortPaths& overlay_port_paths) : m_fs(fs), m_overlay_index(overlay_port_paths) { - for (auto&& overlay : overlay_port_paths.overlay_port_dirs) - { - Debug::println("Using overlay-dir: ", overlay); - - Checks::msg_check_exit(VCPKG_LINE_INFO, - vcpkg::is_directory(m_fs.status(overlay, VCPKG_LINE_INFO)), - msgOverlayPatchDir, - msg::path = overlay); - } - - for (auto&& overlay : overlay_port_paths.overlay_ports) - { - Debug::println("Using overlay: ", overlay); - - Checks::msg_check_exit(VCPKG_LINE_INFO, - vcpkg::is_directory(m_fs.status(overlay, VCPKG_LINE_INFO)), - msgOverlayPatchDir, - msg::path = overlay); - } + m_overlay_index.check_directories(m_fs); } OverlayProviderImpl(const OverlayProviderImpl&) = delete; diff --git a/src/vcpkg/vcpkgcmdarguments.cpp b/src/vcpkg/vcpkgcmdarguments.cpp index 3247976471..7c9c033be2 100644 --- a/src/vcpkg/vcpkgcmdarguments.cpp +++ b/src/vcpkg/vcpkgcmdarguments.cpp @@ -375,12 +375,6 @@ namespace vcpkg } } - args.parser.parse_multi_option( - SwitchOverlayPortDirs, - StabilityTag::Standard, - args.cli_overlay_port_dirs, - msg::format(msgOverlayPortDirsHelp, - msg::env_var = format_environment_variable(EnvironmentVariableVcpkgOverlayPortDirs))); args.parser.parse_multi_option( SwitchOverlayPorts, StabilityTag::Standard, @@ -611,13 +605,7 @@ namespace vcpkg ignore_lock_failures = true; } } - { - const auto vcpkg_overlay_port_dirs_env = get_env(EnvironmentVariableVcpkgOverlayPortDirs); - if (const auto unpacked = vcpkg_overlay_port_dirs_env.get()) - { - env_overlay_port_dirs = Strings::split_paths(*unpacked); - } - } + { const auto vcpkg_overlay_ports_env = get_env(EnvironmentVariableVcpkgOverlayPorts); if (const auto unpacked = vcpkg_overlay_ports_env.get()) diff --git a/src/vcpkg/vcpkgpaths.cpp b/src/vcpkg/vcpkgpaths.cpp index 9c11e21bb8..e915e3db36 100644 --- a/src/vcpkg/vcpkgpaths.cpp +++ b/src/vcpkg/vcpkgpaths.cpp @@ -113,7 +113,7 @@ namespace } auto full_entry = relative_root / entry; - if (fs.almost_canonical(full_entry, VCPKG_LINE_INFO) == config_directory) + if (forbid_dot && fs.almost_canonical(full_entry, VCPKG_LINE_INFO) == config_directory) { Checks::msg_exit_with_error( VCPKG_LINE_INFO, msgErrorManifestMustDifferFromOverlay, msg::path = config_directory); @@ -705,13 +705,6 @@ namespace vcpkg std::move(maybe_json_config), m_pimpl->m_config_dir, *this); - overlay_ports.overlay_port_dirs = merge_overlays(m_pimpl->m_fs, - args.cli_overlay_port_dirs, - args.env_overlay_port_dirs, - original_cwd, - true, - m_pimpl->m_config.config.overlay_port_dirs, - m_pimpl->m_config.directory); overlay_ports.overlay_ports = merge_overlays(m_pimpl->m_fs, args.cli_overlay_ports, args.env_overlay_ports,