Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix versioning features of transitive manifests #151

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "overlay-zlib",
"version": "1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "overlay",
"version": "0",
"dependencies": [
{
"name": "overlay-zlib",
"version>=": "99999"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "test",
"version": "1",
"dependencies": [
"overlay"
]
}
8 changes: 8 additions & 0 deletions azure-pipelines/end-to-end-tests-dir/versions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/vcpkg/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,11 +912,14 @@ namespace vcpkg::Install
auto baseprovider = PortFileProvider::make_baseline_provider(paths);

std::vector<std::string> 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,
Expand Down
6 changes: 0 additions & 6 deletions src/vcpkg/registries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<BuiltinPortTreeRegistryEntry>(
Expand Down