forked from microsoft/vcpkg-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deduplicate overlay-ports handling and avoid repeated querying of the…
… filesystem for 'port' vs 'subdirectories' (microsoft#1534) Other notable behavior changes: * Attempting to set `overlay-ports` to the provably same directory as a top-level manifest now generates an error, with a special error for `"."` in the configuration file. Note that `overlay-triplets` are *not* affected. * Previously, the `load_all_control_files` family on `OverlayPortProviderImpl` would load all ports in the lowest priority `--overlay-ports`, then overwrite any of those with 'higher' values. This meant that malformed ports which vcpkg would never consider would be forced to be loaded, thus potentially triggering irrelevant errors. * Previously, some paths that considered overlay ports in the "subdirectories of named overlay ports" would enforce that their contained `CONTROL`/`vcpkg.json` declared a matching name, and some paths did not. Now, all paths consider ports with mismatched names an error rather than silently using the name in `vcpkg.json`. * Previously, there were additional `fs.exists` checks in order to determine if the indicated directory should contain the port or subdirectories that are ports; now, we `try_read_contents` and consider file not found as nonexistent, saving a disk operation. * `commands.install.cpp` no longer gets entirely broken in the 'add the builtin ports directory as an overlay' cases if there is a `vcpkg.json` in `%VCPKG_ROOT%/ports`. Related: * microsoft/vcpkg-docs#422 (Documentation update clarifying overlay-ports) Resolves: * https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1979597
- Loading branch information
1 parent
b4e99e1
commit 5b17460
Showing
28 changed files
with
536 additions
and
226 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
azure-pipelines/e2e-projects/overlays-dot/vcpkg-configuration.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,3 @@ | ||
{ | ||
"overlay-ports": [ "." ] | ||
} |
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,5 @@ | ||
{ | ||
"dependencies": [ | ||
"a" | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
azure-pipelines/e2e-projects/overlays-malformed-shadowing/config-overlays/a/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) |
4 changes: 4 additions & 0 deletions
4
azure-pipelines/e2e-projects/overlays-malformed-shadowing/config-overlays/a/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,4 @@ | ||
{ | ||
"name": "a", | ||
"version": "0" | ||
} |
2 changes: 2 additions & 0 deletions
2
...ines/e2e-projects/overlays-malformed-shadowing/config-overlays/malformed/a/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,2 @@ | ||
# This port is intentionally malformed and should not be loaded, because ../../a should be loaded instead | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
5 changes: 5 additions & 0 deletions
5
...ipelines/e2e-projects/overlays-malformed-shadowing/config-overlays/malformed/a/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,5 @@ | ||
{ | ||
"name": "a", | ||
"version": "0", | ||
"intentionally-malformed" | ||
} |
4 changes: 4 additions & 0 deletions
4
azure-pipelines/e2e-projects/overlays-malformed-shadowing/vcpkg-configuration.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,4 @@ | ||
{ | ||
"$comment": "'config-overlays/a' in . should get loaded first, so we should never consider 'config-overlays/malformed/a'", | ||
"overlay-ports": [ "config-overlays", "config-overlays/malformed" ] | ||
} |
5 changes: 5 additions & 0 deletions
5
azure-pipelines/e2e-projects/overlays-malformed-shadowing/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,5 @@ | ||
{ | ||
"dependencies": [ | ||
"a" | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
azure-pipelines/e2e-projects/overlays-not-quite-dot/hello/ensure-directory.txt
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 @@ | ||
This file exists only to ensure that git creates the directory containing it, so that ./hello/.. is a valid path. |
3 changes: 3 additions & 0 deletions
3
azure-pipelines/e2e-projects/overlays-not-quite-dot/vcpkg-configuration.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,3 @@ | ||
{ | ||
"overlay-ports": [ "./hello/.." ] | ||
} |
5 changes: 5 additions & 0 deletions
5
azure-pipelines/e2e-projects/overlays-not-quite-dot/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,5 @@ | ||
{ | ||
"dependencies": [ | ||
"a" | ||
] | ||
} |
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
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
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.