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

Conversation

ras0219-msft
Copy link
Contributor

This PR fixes two outstanding bugs with using versioning features in transitive manifests:

  1. We previously required a builtin-baseline as part of transitive manifests if they provide version>=. This was a bug; we only need builtin-baseline for the top-level manifest because it is a non-transitive property.
  2. Manifest mode users that aren't using versioning or registries encountered errors when trying to use transitive dependencies from the built-in registry that have version constraints. This was not desired, because manifest mode without versioning should act the same as classic mode. In this PR, I've implemented that behavior by appending the builtin ports directory as an overlay. This is likely incorrect with respect to classic mode registry configuration (adding a vcpkg-configuration.json into the vcpkg instance), however that mode has no testing coverage currently anyway.

Example setup:

ports/overlay/vcpkg.json

{
    "name": "overlay",
    "version": "0",
    "dependencies": [
        {
            "name": "overlay-zlib",
            "version>=": "99999"
        }
    ]
}

ports/overlay-zlib/vcpkg.json

{
    "name": "overlay-zlib",
    "version": "1"
}

Example error 1:

$ cd /workspaces/vcpkg-tool/azure-pipelines/e2e_ports/version-files/transitive-constraints
$ /workspaces/vcpkg/vcpkg install --dry-run --x-builtin-ports-root=ports --x-install-root=vb
Parsing manifest failed: /workspaces/vcpkg-tool/azure-pipelines/e2e_ports/version-files/transitive-constraints/ports/overlay was rejected because it uses "version>=" without setting a "builtin-baseline".
See `vcpkg help versioning` for more information.
Note: Updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure.

Example error 2 (after fixing the missing baseline):

$ /workspaces/vcpkg/vcpkg install --dry-run --x-builtin-ports-root=ports --x-install-root=vb
Error: no version entry for overlay-zlib at version 99999.
We are currently using the version in the ports tree (1).

The above example happens whenever the version>= disagrees with the current ports tree version.

Expected output:

$ vcpkg install --dry-run --x-builtin-ports-root=ports --x-install-root=vb
Detecting compiler hash for triplet x64-linux...
The following packages will be built and installed:
    overlay[core]:x64-linux -> 0
  * overlay-zlib[core]:x64-linux -> 1
Additional packages (*) will be modified to complete this operation.

{
"name": "overlay-zlib",
"version": "1"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you format these files with format-manifest?

@ras0219-msft ras0219-msft merged commit 5058aed into microsoft:main Aug 11, 2021
@ras0219-msft ras0219-msft deleted the dev/roschuma/versioning-error branch August 11, 2021 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants