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

[vcpkg] Registries MVP #13038

Merged
merged 20 commits into from
Sep 2, 2020
Merged

Conversation

strega-nil
Copy link
Contributor

@strega-nil strega-nil commented Aug 20, 2020

This adds everything except for git registries, which will be implemented later.

Note: this is a large change. You may want to look at each commit in turn.

See https://github.com/strega-nil/vcpkg-example/tree/trunk for an example of using registries :) (ignore the actual C++, that's not really what's important... no guarantees on it compiling, for example)

strega-nil and others added 7 commits August 20, 2020 15:47
Also move common_projection() to Util:: to be with its friends
…gPaths

This PR adds support for $.configuration in manifest files, which can either be an immediate object or the string "file" (which will search recursively up for a vcpkg-configuration.json).
This allows us to get better compiler errors when playing around with json parsing
Additionally, move some stuff over to json.h, and some minor json reading changes
Also rename *Field -> *Deserializer
Additionally, move the valid fields check into the Reader
Also add format_manifest support for configuration
this still allows us to use overlay ports, but uses the registry set for everything else
still to do: add other types of registries!
@JackBoosY JackBoosY added category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:internal This PR or Issue was filed by the vcpkg team. labels Aug 21, 2020
@strega-nil strega-nil requested review from ras0219-msft and BillyONeal and removed request for ras0219-msft August 21, 2020 03:59
@edhebi
Copy link
Contributor

edhebi commented Aug 21, 2020

In your example project, you specify both your local registry and the builtin one, with no default. Is it possible to only define a registry for some packages, and keep the builtin as a fallback ?

something like this:

{
  "name": "fmt-example",
  "version-string": "0.0.1",
  "dependencies": [
    "fmt",
     "zlib"
  ],
  "configuration": {
    "registries": [
      {
        "kind": "directory",
        "path": "my-registry",
        "packages": [ "zlib" ]
      }
    ]
  }
}

where the builtin registry is used automatically for fmt ?

toolsrc/include/vcpkg/base/optional.h Outdated Show resolved Hide resolved
toolsrc/include/vcpkg/base/util.h Show resolved Hide resolved
toolsrc/include/vcpkg/fwd/registries.h Outdated Show resolved Hide resolved
toolsrc/include/vcpkg/registries.h Show resolved Hide resolved
toolsrc/include/vcpkg/vcpkgpaths.h Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/paragraphs.cpp Show resolved Hide resolved
toolsrc/src/vcpkg/portfileprovider.cpp Show resolved Hide resolved
toolsrc/src/vcpkg/portfileprovider.cpp Show resolved Hide resolved
toolsrc/src/vcpkg/registries.cpp Show resolved Hide resolved
toolsrc/src/vcpkg/registries.cpp Show resolved Hide resolved
@strega-nil
Copy link
Contributor Author

@edhebi yep! The default registry defaults to the builtin one :) I'd definitely recommend reading the manifest RFC at #12881 for more info, and if you still have questions post them there :)

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

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

No serious issues left other than Bill not being a fan of that one lambda. I don't agree with the "configuration" mechanism in the spec, but this does seem to implement what's in that spec.

toolsrc/include/vcpkg/vcpkgpaths.h Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/paragraphs.cpp Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/base/files.cpp Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/paragraphs.cpp Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/portfileprovider.cpp Show resolved Hide resolved
toolsrc/src/vcpkg/vcpkgpaths.cpp Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/vcpkgpaths.cpp Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/vcpkgpaths.cpp Outdated Show resolved Hide resolved
@strega-nil strega-nil force-pushed the filesystem-registries branch 3 times, most recently from 790f09e to 61dc239 Compare August 31, 2020 17:58
We had a serious discussion today, and so the way we're going forward
with this is very different -- no longer having a `"configuration"`
field, adding inheritance, etc.

Check the RFC for more info on how this will be done in the future; for
the MVP, all it changes (fundamentally) is where the configuration stuff
gets set -- it's in vcpkg-configuration.json in the manifest root.
@strega-nil
Copy link
Contributor Author

@BillyONeal could you merge this today?

@BillyONeal
Copy link
Member

Yes, but I thought we wanted another reviewer?

Copy link
Contributor

@ras0219 ras0219 left a comment

Choose a reason for hiding this comment

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

Please also confirm everything still compiles using v140 and gcc-7:

FROM ubuntu:18.04

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
  xz-utils \
  build-essential \
  tar \
  unzip \
  ninja-build \
  cmake \
  curl \
  vim \
  git \
  nasm \
  yasm \
  python3 \
  pkg-config \
  zip

CMD [ "/bin/bash" ]

docker run -it --rm 51d7a08f83a8 /bin/bash -c "git clone https://github.com/microsoft/vcpkg --depth=1 && vcpkg/bootstrap-vcpkg.sh"

// CMakeSettings.json
[
    {
      "name": "x64-Release-v140",
      "generator": "Visual Studio 16 2019 Win64",
      "configurationType": "RelWithDebInfo",
      "buildRoot": "${projectDir}\\out\\build\\${name}",
      "installRoot": "${projectDir}\\out\\install\\${name}",
      "cmakeCommandArgs": "-T v140 -DVCPKG_STANDARD_LIBRARY=msvc-stl -DVCPKG_WARNINGS_AS_ERRORS=OFF -DBUILD_TESTING=OFF",
      "buildCommandArgs": "/m",
      "ctestCommandArgs": "",
      "inheritEnvironments": [ "msvc_x64_x64" ],
      "variables": [],
      "environments": [ { "CL": "/MP" } ]
    }
]

toolsrc/include/vcpkg/paragraphs.h Outdated Show resolved Hide resolved
toolsrc/include/vcpkg/registries.h Outdated Show resolved Hide resolved
toolsrc/include/vcpkg/registries.h Outdated Show resolved Hide resolved
toolsrc/include/vcpkg/registries.h Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/base/json.cpp Show resolved Hide resolved
toolsrc/include/vcpkg/registries.h Show resolved Hide resolved
toolsrc/src/vcpkg/sourceparagraph.cpp Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/sourceparagraph.cpp Outdated Show resolved Hide resolved
toolsrc/src/vcpkg/sourceparagraph.cpp Show resolved Hide resolved
toolsrc/src/vcpkg/sourceparagraph.cpp Outdated Show resolved Hide resolved
@strega-nil
Copy link
Contributor Author

@ras0219 fwiw, we compile with g++-7 in CI.

Also, I'll have a patch out later today to fix compilation with g++-6.

@BillyONeal BillyONeal merged commit 9740611 into microsoft:master Sep 2, 2020
@BillyONeal
Copy link
Member

Thanks for your contribution!

@strega-nil strega-nil deleted the filesystem-registries branch September 10, 2020 21:20
strega-nil added a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
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 info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants