Skip to content

[vcpkg] Implement VersionedPortfileProvider and BaselineProvider#14123

Merged
vicroms merged 52 commits intomicrosoft:masterfrom
vicroms:versioning/versioned-portfile-provider
Nov 27, 2020
Merged

[vcpkg] Implement VersionedPortfileProvider and BaselineProvider#14123
vicroms merged 52 commits intomicrosoft:masterfrom
vicroms:versioning/versioned-portfile-provider

Conversation

@vicroms
Copy link
Member

@vicroms vicroms commented Oct 20, 2020

This PR implements two interfaces that are to be consumed by a versioned dependency resolver.
This is an important step in implementing package versioning in vcpkg.

IVersionedPortfileProvider {
    get_port_versions(port_name) -> Version[]
    get_control_file(port_name, version) -> ControlFile
}

IBaselineProvider {
    get_baseline_version(port_name) -> Version
}

This is an MVP implementation that works with the default ports registry.

@JackBoosY JackBoosY added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Oct 21, 2020
@vicroms vicroms changed the title [vcpkg] WIP: Fetch port files from specific version [vcpkg] WIP: Versioned portfile provider Oct 28, 2020
@vicroms
Copy link
Member Author

vicroms commented Nov 20, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vicroms vicroms force-pushed the versioning/versioned-portfile-provider branch from d4c9cec to cfb807d Compare November 20, 2020 21:37
@vicroms
Copy link
Member Author

vicroms commented Nov 21, 2020

@strega-nil @BillyONeal @ras0219

I think this is ready for merge now. I will investigate the git archive method in a separate PR.

@vicroms vicroms changed the title [vcpkg] WIP: Versioned portfile provider [vcpkg] Implement VersionedPortfileProvider and BaselineProvider Nov 23, 2020
Comment on lines +27 to +32
using std::hash;
using std::size_t;
using std::string;

return ((hash<string>()(key.port_name) ^ (hash<string>()(key.version.to_string()) << 1)) >> 1) ^
(hash<int>()(static_cast<int>(key.scheme)) << 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to self to add hashing to the vcpkg lib.

@vicroms vicroms force-pushed the versioning/versioned-portfile-provider branch from 745be0a to c12a53c Compare November 25, 2020 19:00
@vicroms
Copy link
Member Author

vicroms commented Nov 26, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vicroms
Copy link
Member Author

vicroms commented Nov 27, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vicroms vicroms merged commit 6c9cda1 into microsoft:master Nov 27, 2020
strega-nil added a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
…rosoft#14123)

* WIP: Get versions from database files

* Fix formatting

* Provider inherits ResourceBase

* Correct versions JSON file location

* Fix formatting

* Fix formatting

* Fix include in versions.h

* Fetch port versions using git tree object

* Undo changes to x-history

* Remove unnecesary moves

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>

* Extract Git manipulation code

* [WIP] Review comments

* [WIP] Review comments pt. 2

* [WIP] Review comments / fix formatting

* Generate baseline.json

* Extract deserializers from registries source file

* BaselineProvider initial implementation

* Modify gitignore

* Update .gitignore again

* Use JSON deserializer for versions db

* Lazy load baseline file

* Fetch baseline.json from baseline commit

* More git abstractions

* Clean up code

* Path helpers

* Formatting

* Move data into impl object

* Use implementation object for VersionedPortfileProvider

* Reuse cloned instance for checkouts

* Code cleanup and formatting

* Fix returning dangling reference

* Prepare to remove files in port_versions/

* Remove files in port_versions/

* Update .gitignore

* Some PR review comments

* Use StringView

* More StringView conversions

* More refactoring

* Make some implementation members private

* Functions for parsing baseline and version files

* Hide deserializers implementation

* Check for `versions` feature flag in registries.

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
@vicroms vicroms deleted the versioning/versioned-portfile-provider branch September 26, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants