-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit an error for duplicate overrides. (#1573)
Also makes Json::IDeserializer no longer need a virtual dtor. Before (first one wins): PS D:\test> type vcpkg.json { "dependencies": [ "zlib" ], "overrides": [{"name": "zlib", "version": "1.2.13"}, {"name": "zlib", "version": "1.3.1"}] } Installing 2/2 zlib:[email protected]... Building zlib:[email protected]... C:\Users\bion\AppData\Local\vcpkg\registries\git-trees\ad5a49006f73b45b715299515f31164131b51982: info: installing overlay port from here -- Using cached madler-zlib-v1.2.13.tar.gz. -- Extracting source D:/vcpkg-downloads/madler-zlib-v1.2.13.tar.gz -- Applying patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch -- Applying patch 0002-skip-building-examples.patch -- Applying patch 0003-build-static-or-shared-not-both.patch -- Applying patch 0004-android-and-mingw-fixes.patch -- Using source at D:/vcpkg/buildtrees/zlib/src/v1.2.13-f30d2a168d.clean -- Found external ninja('1.12.1'). -- Configuring x64-windows -- Building x64-windows-dbg -- Building x64-windows-rel -- Installing: D:/vcpkg/packages/zlib_x64-windows/share/zlib/vcpkg-cmake-wrapper.cmake -- Fixing pkgconfig file: D:/vcpkg/packages/zlib_x64-windows/lib/pkgconfig/zlib.pc -- Using cached msys2-mingw-w64-x86_64-pkgconf-1~2.3.0-1-any.pkg.tar.zst. -- Using cached msys2-msys2-runtime-3.5.4-2-x86_64.pkg.tar.zst. -- Using msys root at D:/vcpkg-downloads/tools/msys2/21caed2f81ec917b -- Fixing pkgconfig file: D:/vcpkg/packages/zlib_x64-windows/debug/lib/pkgconfig/zlib.pc -- Installing: D:/vcpkg/packages/zlib_x64-windows/share/zlib/copyright -- Performing post-build validation Stored binaries in 1 destinations in 93.9 ms. Elapsed time to handle zlib:x64-windows: 3.7 s zlib:x64-windows package ABI: a858cb84557b70b9fa3b3934233ce9667bef3fcf11c99b00070f799cc44bff14 Total install time: 3.7 s The package zlib is compatible with built-in CMake targets: find_package(ZLIB REQUIRED) target_link_libraries(main PRIVATE ZLIB::ZLIB) After: (an error) D:\test\vcpkg.json: error: $.overrides[1] (an override): zlib already has a declared override note: Extended documentation available at 'https://learn.microsoft.com/vcpkg/users/manifests?WT.mc_id=vcpkg_inproduct_cli'. Resolves https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1665249
- Loading branch information
1 parent
f8052c7
commit a5528f3
Showing
15 changed files
with
250 additions
and
220 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
azure-pipelines/e2e-ports/broken-manifests/broken-duplicate-overrides/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
17 changes: 17 additions & 0 deletions
17
azure-pipelines/e2e-ports/broken-manifests/broken-duplicate-overrides/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "broken-duplicate-overrides", | ||
"version": "1", | ||
"dependencies": [ | ||
"zlib" | ||
], | ||
"overrides": [ | ||
{ | ||
"name": "zlib", | ||
"version": "1.2.13" | ||
}, | ||
{ | ||
"name": "zlib", | ||
"version": "1.3.1" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
#include <vcpkg/base/jsonreader.h> | ||
|
||
#include <vcpkg/registries.h> | ||
|
||
namespace vcpkg | ||
{ | ||
struct FilesystemVersionDbEntryDeserializer final : Json::IDeserializer<FilesystemVersionDbEntry> | ||
{ | ||
LocalizedString type_name() const override; | ||
View<StringLiteral> valid_fields() const noexcept override; | ||
Optional<FilesystemVersionDbEntry> visit_object(Json::Reader& r, const Json::Object& obj) const override; | ||
FilesystemVersionDbEntryDeserializer(const Path& root) : registry_root(root) { } | ||
|
||
private: | ||
Path registry_root; | ||
}; | ||
|
||
struct FilesystemVersionDbEntryArrayDeserializer final : Json::IDeserializer<std::vector<FilesystemVersionDbEntry>> | ||
{ | ||
virtual LocalizedString type_name() const override; | ||
virtual Optional<std::vector<FilesystemVersionDbEntry>> visit_array(Json::Reader& r, | ||
const Json::Array& arr) const override; | ||
FilesystemVersionDbEntryArrayDeserializer(const Path& root) : underlying{root} { } | ||
|
||
private: | ||
FilesystemVersionDbEntryDeserializer underlying; | ||
}; | ||
|
||
struct GitVersionDbEntryDeserializer final : Json::IDeserializer<GitVersionDbEntry> | ||
{ | ||
LocalizedString type_name() const override; | ||
View<StringLiteral> valid_fields() const noexcept override; | ||
Optional<GitVersionDbEntry> visit_object(Json::Reader& r, const Json::Object& obj) const override; | ||
}; | ||
|
||
struct GitVersionDbEntryArrayDeserializer final : Json::IDeserializer<std::vector<GitVersionDbEntry>> | ||
{ | ||
virtual LocalizedString type_name() const override; | ||
virtual Optional<std::vector<GitVersionDbEntry>> visit_array(Json::Reader& r, | ||
const Json::Array& arr) const override; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.