Граф коммитов

20 Коммитов

Автор SHA1 Сообщение Дата
Billy O'Neal dfb60db5b9
Audit headers for overzealous inclusion reported by Visual Studio (#1273) 2023-11-09 15:06:33 -08:00
Robert Schumacher c059d374c1
Rearrange declarations and definitions to reduce needed includes. (#984)
* Shuffle headers to reduce dependencies.

* Split out registries.private.h to expose test-only APIs
2023-04-04 12:59:23 -07:00
Robert Schumacher 962205947f
Apply fwd headers and include only what you need (#983)
* Apply forward headers

* Adjust to split PR

* Fix ubuntu build

* Fix ubuntu build

* Fix non-Windows build

* Remove files.h from PCH and fix non-MSVC platforms
2023-03-30 11:24:45 -07:00
Victor Romero 02abc6628c
[RFC][registries] Allow pattern matching in packages declarations (#778)
* Resolve prefix patterns in packages declarations

* Allow prefixes in configuration parser

* A few more test cases

* Add warning for ignored patterns/packages

* Print warnings on vcpkg configuration

* Localize warning messages

* Clean up

* Test registry parsing

* Apply Billy's patch

* Apply Billy's suggestions from code review

Co-authored-by: Billy O'Neal <bion@microsoft.com>

* Format

* Collect all package pattern warnings into one

* Improve warning message

* Format messages

* Disallow period separated segments in port names

* Error messages on invalid patterns/names

* Cleanup

* Disallow registries without setting a baseline

* Fix for artifact registries

* Billy's PR comments

* Add e2e test registry

* End-to-end tests

* Fix e2e tests

* Make tests success case silent

* Accept prefixes ending in '-'

Co-authored-by: Billy O'Neal <bion@microsoft.com>
2022-12-12 11:38:22 -08:00
Rose 1e53a0c3b5
Mark functions as static and const (#764)
Also use constexpr where we can
2022-10-28 14:09:20 -07:00
val a1e5a75383
Configuring overlay ports and overlay triplets through the manifest (#743)
* overlays through manifest implemented

* turned artifacts on

* artifacts settings once more

* fixed formatting

* brought overlays to vcpkgpaths

* artifacts settings

* format

* sending merged overlay triplets

* moved constructor

* passing parameters by reference

* e2e tests

* bad paths test

* fix

* resolves overlay paths relative to vcpkg-configuration.json

* path fix

* Update test config

* modified make_relative_to_manifest

* Fix build

* changed lambda function

* made manifest directory const

* Revert

* Revert lambda function

* Add get_manifest_directory()

* making make_relative_to_manifest cleaner

* Comments

* Comments

Co-authored-by: Valeria Conde <t-vconde@microsoft.com>
2022-10-19 17:54:16 -07:00
Billy O'Neal 96b07ad4db
Implement 'new' in C++. (#613)
* Add Json::stringify overloads without specifying a style.

Most callers were just default-initializing JsonStyle which is equivalent to the WithSpaces(2) form.
WithSpaces(2) and default-initialized changed to call the new overload(s).
Callers who were stringifying 2 Json entities just to compare their strings also dropped the style parameter.
Callers who were using anything else were left alone.

* Implement new in C++.

This replaces the TypeScript implementation of new with a C++ one. Other changes:

* Now creates both vcpkg.json and vcpkg-configuration.json, which resolves "vcpkg new does not create vcpkg.json" https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1494967
* vcpkg-configuration.json can be embedded into vcpkg.json with --single-file.
* Now fills in the default registry with the current baseline git SHA.
* --name and --version are now mandatory since we are creating vcpkg.json, but they can be skipped with --application as per https://github.com/microsoft/vcpkg-tool/pull/605

* clang-format and messages

* Add unit tests.

* Add e2e test.

* Introduce zero_or_one_set.

* This is what tests are for.
2022-07-18 16:48:38 -07:00
nicole mazzuca 1cf1f7f126
[x-update-baseline] Initial implementation (#341)
* start working

* update vcpkgpaths to better support what I want

* optional: make certain `get()` is only called when
  it won't result in a dangling pointer
* vcpkgpaths: remove JsonStyle support as it isn't used
* vcpkgpaths: switch from two functions returning
  Optional<Manifest> + Optional<Path>,
  to one function returning Optional<ManifestAndLocation>
* vcpkgpaths: add `get_configuration_and_location`

* rename get_*_and_location -> get_*

* lots of CRs

* get_latest_baseline -> configuration.cpp
* format
* optional - add see-through operator==
* add `--add-initial-baseline` option
* more correct if-elses

* add messages!

```
PS /../nimazzuc/projects/testproj> ../vcpkg-tool/build/vcpkg x-update-baseline --dry-run
registry 'https://github.com/microsoft/vcpkg' already up to date: 89295c9fe22e97ca9e380a6c771ccf2ff09dca95
registry '/a/b' not updated: default
registry 'https://foobar' not updated: default
warning: git failed to fetch remote repository https://foobar
Error: Failed to fetch ref HEAD from repository https://foobar.
fatal: unable to access 'https://foobar/': Could not resolve host: foobar
```

* update - hopefully fix Billy's CRs

* fix formatting

* (optional::operator==) add tests, add opt<T> == opt<U>

* rename things

* registry_location -> pretty_location
* ManifestAndLocation -> ManifestAndPath
* ConfigurationAndLocation -> ConfigurationAndSource

* minor other CRs

* forgot to to_string

* format

* I think this is what robert wants?

* format
2022-04-19 13:04:52 -07:00
Billy Robert O'Neal III a4ffba5f34 Resolve Robert code review feedback. 2021-12-02 23:45:44 -08:00
Billy Robert O'Neal III 1841cfb46a Add vcpkg "new". 2021-12-02 23:45:44 -08:00
Robert Schumacher 1b7edfa719
Remove VcpkgPaths from RegistrySet interfaces (#287) 2021-11-30 14:47:35 -08:00
Robert Schumacher e7cb06347c
Refactor apart 'config data' from 'behavior object' for registries (#275)
* Refactor apart 'config data' from 'behavior object' for registries

* Fix relative path in filesystem registry config

* Address review comments

* Review comments
2021-11-29 15:56:50 -08:00
Victor Romero cfe7d9d8fe
Add new fields to vcpkg configuration (#248)
* [vcpkg] Read configuration from manifest

* format

* Add feature flag

* Improve ambiguous configuration error message

Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>

* Make x-vcpkg-configuration a proper field of the manifest

* add Configuration and RegistryImplementation serialize

* fix format

* Allow formatting embeded vcpkg configuration

* Do not use lambda to load optional configuration

Co-authored-by: Billy O'Neal <bion@microsoft.com>

* Minor fixes

* Fix format

* Add tests + allow $ extra-info on configuration files

* Remove feature flag and warn on use of embedded config

* Add parsing for ce fields in vcpkg-configuration.json

* Rename ce_configuration to ce_metadata

* WIP

* Fix test

* Order new fields in serialization add happy path tests

* WIP

* Tests for string fields

* Add even more tests

* Remove unused variable

* Fix CI issues

* Fix serialization of filesystem registries

* Demands are not actually recursive

* Fix CI issues

* Make settings an arbitrary object

Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Co-authored-by: Mathis Logemann <mathisloge@gmail.com>
Co-authored-by: Billy O'Neal <bion@microsoft.com>
2021-11-10 10:32:22 -08:00
Victor Romero 57708d020e
Embed vcpkg configuration in manifest (#239)
* [vcpkg] Read configuration from manifest

* format

* Add feature flag

* Improve ambiguous configuration error message

Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>

* Make x-vcpkg-configuration a proper field of the manifest

* add Configuration and RegistryImplementation serialize

* fix format

* Allow formatting embeded vcpkg configuration

* Do not use lambda to load optional configuration

Co-authored-by: Billy O'Neal <bion@microsoft.com>

* Minor fixes

* Fix format

* Add tests + allow $ extra-info on configuration files

* Remove feature flag and warn on use of embedded config

* Fix incorrect field name in error message

* Change field order of serialized manifests

Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Co-authored-by: Mathis Logemann <mathisloge@gmail.com>
Co-authored-by: Billy O'Neal <bion@microsoft.com>
2021-11-03 22:43:26 -07:00
Billy O'Neal cb1e40d6fe
Move all references to stdfs:: into files.cpp (#141)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
2021-08-06 14:43:46 -07:00
Billy O'Neal 2f17860938
Clean up vcpkg namespaces (#98)
* Delete the 'System' namespace.

* Enums -> Util

* Delete Files::

* Delete vcpkg::Files.

fs:: -> stdfs or vcpkg::Files, as appropriate.

Resolves the very common shadowing issue where we have a local variable named fs which shadows the namespace fs.

* Delete vcpkg::Files. Add stdfs::path -> vcpkg::path alias

* Fix warnings.

* Remove all const path& path instances.

Also fix a few remaining .string() and .generic_string() s.
2021-06-29 16:48:41 -07:00
nicole mazzuca c62f9746c4 [vcpkg registries] support versions (#15114)
* [vcpkg registries] support versions

This PR merges the Registries changes and the versioning changes, so that one can use both at the same time.

There is one major difference between this PR and the RFC (#13590), which is that instead of version files looking like:

```json
[
  ...
]
```

version files look like:

```
{
  "versions": [
    ...
  ]
}
```

this is to support interop between this PR and existing demos and the like;
fixing this, along with perhaps renaming `port_versions` to `port-versions` should be done after this is merged,
should be a trivial change.
2020-12-21 15:40:21 -08:00
ras0219 c963acce65 [vcpkg] Further JSON error improvements (#13399)
* [vcpkg] Split vcpkg/base/json.h into vcpkg/base/jsonreader.h

* [vcpkg] Extract definitions of Configuration-Deserializer (& friends)

These types are only used by VcpkgPaths during the initial parse.

* [vcpkg] Introduce levenshtein-distance suggestions for json errors

* [vcpkg] Fix regression in supports handling

* [vcpkg] Fix signed/unsigned mismatch

* [vcpkg] Address CR comments

* [vcpkg] Address CR comments

* Fix compiler error from merge conflict.

* [vcpkg] Change parameters of Reader::check_for_unexpected_fields to better match declaration

* [vcpkg] Improve errors from features set

* [vcpkg] Fix includes

* [vcpkg] Reuse code

* [vcpkg] Check the "name" field always to maximize error information

* [docs] Improve english phrasing in manifests.md

* [vcpkg] Correct docs link for manifests

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2020-10-12 10:22:47 -07:00
ras0219 34d19389a3 [vcpkg] Improve Json error messages (#12981)
* [vcpkg] Fix error reporting on json parse failure

* [vcpkg] Track manifest path for use in diagnostics

* [vcpkg] Use by-value for consumer API. Improve trailing comma diagnostic.

* [vcpkg] Track errors directly inside Json::Reader

* [vcpkg] Fixup use of .u8string()

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
2020-09-07 15:50:20 -07:00
nicole mazzuca 65640a2960 [vcpkg] Registries MVP (#13038) 2020-09-02 09:13:44 -07:00