From 8d0cdb4f0d6628c14020bdcf3e9ac8a79af5a314 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 10 Aug 2021 07:42:21 +0000 Subject: [PATCH 1/2] Fix versioning features of transitive manifests --- .../ports/overlay-zlib/portfile.cmake | 0 .../ports/overlay-zlib/vcpkg.json | 4 ++++ .../ports/overlay/portfile.cmake | 0 .../transitive-constraints/ports/overlay/vcpkg.json | 10 ++++++++++ .../version-files/transitive-constraints/vcpkg.json | 7 +++++++ azure-pipelines/end-to-end-tests-dir/versions.ps1 | 8 ++++++++ src/vcpkg/install.cpp | 7 +++++-- src/vcpkg/registries.cpp | 6 ------ 8 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/portfile.cmake create mode 100644 azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json create mode 100644 azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/portfile.cmake create mode 100644 azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json create mode 100644 azure-pipelines/e2e_ports/version-files/transitive-constraints/vcpkg.json diff --git a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/portfile.cmake b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/portfile.cmake new file mode 100644 index 0000000000..e69de29bb2 diff --git a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json new file mode 100644 index 0000000000..627d8e09de --- /dev/null +++ b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "overlay-zlib", + "version": "1" +} \ No newline at end of file diff --git a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/portfile.cmake b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/portfile.cmake new file mode 100644 index 0000000000..e69de29bb2 diff --git a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json new file mode 100644 index 0000000000..8f74bce4c7 --- /dev/null +++ b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "overlay", + "version": "0", + "dependencies": [ + { + "name": "overlay-zlib", + "version>=": "99999" + } + ] +} \ No newline at end of file diff --git a/azure-pipelines/e2e_ports/version-files/transitive-constraints/vcpkg.json b/azure-pipelines/e2e_ports/version-files/transitive-constraints/vcpkg.json new file mode 100644 index 0000000000..60f9b82051 --- /dev/null +++ b/azure-pipelines/e2e_ports/version-files/transitive-constraints/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "test", + "version": "1", + "dependencies": [ + "overlay" + ] +} \ No newline at end of file diff --git a/azure-pipelines/end-to-end-tests-dir/versions.ps1 b/azure-pipelines/end-to-end-tests-dir/versions.ps1 index 7475638b67..72b6ea7f38 100644 --- a/azure-pipelines/end-to-end-tests-dir/versions.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/versions.ps1 @@ -2,6 +2,14 @@ $versionFilesPath = "$PSScriptRoot/../e2e_ports/version-files" +# Ensure transitive packages can be used even if they add version constraints +$CurrentTest = "transitive constraints without baseline" +Run-Vcpkg install @commonArgs --dry-run ` + "--x-builtin-ports-root=$versionFilesPath/transitive-constraints/ports" ` + "--x-manifest-root=$versionFilesPath/transitive-constraints" --debug +Throw-IfFailed +Refresh-TestRoot + # Test verify versions mkdir $VersionFilesRoot | Out-Null Copy-Item -Recurse "$versionFilesPath/versions_incomplete" $VersionFilesRoot diff --git a/src/vcpkg/install.cpp b/src/vcpkg/install.cpp index 770981c81b..f7e9a4709a 100644 --- a/src/vcpkg/install.cpp +++ b/src/vcpkg/install.cpp @@ -912,11 +912,14 @@ namespace vcpkg::Install auto baseprovider = PortFileProvider::make_baseline_provider(paths); std::vector extended_overlay_ports; - extended_overlay_ports.reserve(args.overlay_ports.size() + 1); + extended_overlay_ports.reserve(args.overlay_ports.size() + 2); extended_overlay_ports.push_back(manifest_path.parent_path().to_string()); Util::Vectors::append(&extended_overlay_ports, args.overlay_ports); + if (paths.get_configuration().registry_set.is_default_builtin_registry()) + { + extended_overlay_ports.push_back(paths.builtin_ports_directory().native()); + } auto oprovider = PortFileProvider::make_overlay_provider(paths, extended_overlay_ports); - PackageSpec toplevel{manifest_scf.core_paragraph->name, default_triplet}; auto install_plan = Dependencies::create_versioned_install_plan(*verprovider, *baseprovider, diff --git a/src/vcpkg/registries.cpp b/src/vcpkg/registries.cpp index 64aa14fdf8..bd8852b4b9 100644 --- a/src/vcpkg/registries.cpp +++ b/src/vcpkg/registries.cpp @@ -323,12 +323,6 @@ namespace if (auto scfp = found_scf.get()) { auto& scf = *scfp; - auto maybe_error = scf->check_against_feature_flags(port_directory, paths.get_feature_flags()); - if (maybe_error) - { - Checks::exit_maybe_upgrade(VCPKG_LINE_INFO, "Parsing manifest failed: %s", *maybe_error.get()); - } - if (scf->core_paragraph->name == port_name) { return std::make_unique( From 4d640d7bda8e9c998664f53187f634392e07304e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 11 Aug 2021 10:26:14 -0700 Subject: [PATCH 2/2] Format manifests --- .../ports/overlay-zlib/vcpkg.json | 6 +++--- .../ports/overlay/vcpkg.json | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json index 627d8e09de..bb4dcf032f 100644 --- a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json +++ b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay-zlib/vcpkg.json @@ -1,4 +1,4 @@ { - "name": "overlay-zlib", - "version": "1" -} \ No newline at end of file + "name": "overlay-zlib", + "version": "1" +} diff --git a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json index 8f74bce4c7..93238ab864 100644 --- a/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json +++ b/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay/vcpkg.json @@ -1,10 +1,10 @@ { - "name": "overlay", - "version": "0", - "dependencies": [ - { - "name": "overlay-zlib", - "version>=": "99999" - } - ] -} \ No newline at end of file + "name": "overlay", + "version": "0", + "dependencies": [ + { + "name": "overlay-zlib", + "version>=": "99999" + } + ] +}