Skip to content

Commit

Permalink
Delete the actual overlay-port-dirs feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyONeal committed Nov 13, 2024
1 parent f71b37c commit 14afed2
Show file tree
Hide file tree
Showing 31 changed files with 43 additions and 197 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"overlay-port-dirs": [ "." ]
"overlay-ports": [ "." ]
}
Original file line number Diff line number Diff line change
@@ -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" ]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"overlay-port-dirs": [ "./hello/.." ]
"overlay-ports": [ "./hello/.." ]
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

34 changes: 3 additions & 31 deletions azure-pipelines/end-to-end-tests-dir/overlays.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions docs/vcpkg-configuration.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
3 changes: 0 additions & 3 deletions include/vcpkg/base/contractual-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
11 changes: 3 additions & 8 deletions include/vcpkg/base/message-data.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
(),
Expand Down Expand Up @@ -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),
"",
Expand Down
1 change: 0 additions & 1 deletion include/vcpkg/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace vcpkg
std::vector<RegistryConfig> registries;
Json::Object ce_metadata;
Json::Object extra_info;
std::vector<std::string> overlay_port_dirs;
std::vector<std::string> overlay_ports;
std::vector<std::string> overlay_triplets;

Expand Down
4 changes: 3 additions & 1 deletion include/vcpkg/portfileprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace vcpkg
{
struct OverlayPortPaths
{
std::vector<Path> overlay_port_dirs;
Optional<Path> builtin_overlay_port_dir;
std::vector<Path> overlay_ports;

bool empty() const noexcept;
Expand All @@ -37,6 +37,8 @@ namespace vcpkg
ExpectedL<Unit> try_load_all_ports(const ReadOnlyFilesystem& fs,
std::map<std::string, const SourceControlFileAndLocation*>& out);

void check_directory(const ReadOnlyFilesystem& fs) const;

private:
OverlayPortKind m_kind;
Path m_directory;
Expand Down
2 changes: 0 additions & 2 deletions include/vcpkg/vcpkgcmdarguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ namespace vcpkg

Optional<std::string> triplet;
Optional<std::string> host_triplet;
std::vector<std::string> cli_overlay_port_dirs;
std::vector<std::string> env_overlay_port_dirs;
std::vector<std::string> cli_overlay_ports;
std::vector<std::string> env_overlay_ports;
std::vector<std::string> cli_overlay_triplets;
Expand Down
6 changes: 2 additions & 4 deletions locales/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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})",
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg/commands.install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
12 changes: 0 additions & 12 deletions src/vcpkg/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -773,7 +771,6 @@ namespace vcpkg
JsonIdDefaultRegistry,
JsonIdRegistries,
JsonIdOverlayPorts,
JsonIdOverlayPortDirs,
JsonIdOverlayTriplets,
JsonIdMessage,
JsonIdWarning,
Expand Down Expand Up @@ -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());
Expand Down
Loading

0 comments on commit 14afed2

Please sign in to comment.