Commit Graph

42 Commits

Author SHA1 Message Date
nicole mazzuca
9740611cab
[vcpkg] Registries MVP (#13038) 2020-09-02 09:13:44 -07:00
nicole mazzuca
5e164e3dd2
[vcpkg] Add Forward Declarations (originally by @cngzhnp) (#12985)
Co-authored-by: cngzhnp <cengizhanpasaoglu@gmail.com>
2020-08-19 15:33:15 -07:00
nicole mazzuca
895678db8f
[vcpkg] Rewrite CMake build system to be more target-based (#12698)
* Change to using more target-focused cmake

* Add vcpkg_target_add_warning_options

* targetify the rest

* move the globs together

* Force-include pch.h on non-windows

* Rename VCPKGLIB_NON_PCH_* to VCPKGLIB_* in globs

* Remove `include "pch.h"`s

* missed a few lines

* fix build

* fix CMAKE_CURRENT_SOURCE_DIR

* try to fix VCPKG_REQUIRE_LINK_CXXFS

* change msvc-stl logic

* fix build

* CR

* clang-format

* Apply suggestions from code review

Thanks @ras0219!

Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
2020-08-10 12:32:34 -07:00
nicole mazzuca
1d8f0acc9c
[vcpkg manifest] Manifest Implementation (#11757)
==== Changes Related to manifests ====

* Add the `manifests` feature flag
  * This only says whether we look for a `vcpkg.json` in the cwd, not
    whether we support parsing manifests (for ports, for example)
* Changes to the manifests RFC
  * `"authors"` -> `"maintainers"`
  * `--x-classic-mode` -> `-manifests` \in `vcpkg_feature_flags`
  * reserve `"core"` in addition to `"default"`, since that's already
    reserved for features
  * Add a small helper note about what identifiers must look like
  * `<license-string>`: SPDX v3.8 -> v3.9
  * `"feature"."description"` is allowed to be an array of strings as well
  * `"version"` -> `"version-string"` for forward-compat with versions
    RFC
* Add the `--feature-flags` option
* Add the ability to turn off feature flags via passing
  `-<feature-flag>` to `VCPKG_FEATURE_FLAGS` or `--feature-flags`
* Add CMake toolchain support for manifests
  * Requires either:
    * a feature flag of `manifests` in either `Env{VCPKG_FEATURE_FLAGS}`
      or `VCPKG_FEATURE_FLAGS`
    * Passing the `VCPKG_ENABLE_MANIFESTS` option
  * The toolchain will install your packages to
    `${VCPKG_MANIFEST_DIR}/vcpkg_installed`.
* Add MSBuild `vcpkg integrate install` support for manifests
  * Requires `VcpkgEnableManifest` to be true
* `vcpkg create` creates a port that has a `vcpkg.json` instead of a
  `CONTROL`
* argparse, abseil, 3fd, and avisynthplus ports switched to manifest
  from CONTROL
* Add support for `--x-manifest-root`, as well as code for finding it if
  not passed
* Add support for parsing manifests!
* Add a filesystem lock!

==== Important Changes which are somewhat unrelated to manifests ====

* Rename `logicexpression.{h,cpp}` to `platform-expression.{h,cpp}`
* Add `PlatformExpression` type which takes the place of the old logic
  expression
  * Split the parsing of platform expressions from checking whether
    they're true or not
  * Eagerly parse PlatformExpressions as opposed to leaving them as
    strings
* Add checking for feature flag consistency
  * i.e., if `-binarycaching` is passed, you shouldn't be passing
    `--binarysource`
* Add the `Json::Reader` type which, with the help of user-defined
  visitors, converts JSON to your internal type
* VcpkgArgParser: place the switch names into a constant as opposed to
  using magic constants
  * In general update the parsing code so that this ^ works
* Add `Port-Version` fields to CONTROL files
  * This replaces the existing practice of
    `Version: <my-version>-<port-version>`

==== Smaller changes ====
* small drive-by cleanups to some CMake
  * `${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}` ->
    `${CURRENT_INSTALLED_DIR}`
  * Remove `-analyze` when compiling with clang-cl, since that's not a
    supported flag (vcpkg's build system)
  * Add a message about which compiler is detected by vcpkg's build
    system machinery
* Fix `Expected::then`
* Convert `""` to `{}` for `std::string` and `fs::path`, to avoid a
  `strlen` (additionally, `.empty()` instead of `== ""`, and `.clear()`)
* Add `Strings::strto` which converts strings to numeric types
* Support built-in arrays and `StringView` for `Strings::join`
* Add `operator<` and friends to `StringView`
* Add `substr` to `StringView`
* SourceParagraphParser gets some new errors
2020-06-30 10:40:18 -07:00
Billy O'Neal
5504dfa7da
[vcpkg] Turn on tests and PREfast in CI, and fix tests to pass. (#11239)
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
2020-05-14 12:49:31 -07:00
Billy O'Neal
5db4f98d6e
Don't build the metrics uploader when metrics are disabled. (#11234) 2020-05-08 00:16:49 -07:00
Billy O'Neal
d7d410b50b
[vcpkg] Restrict telemetry uploads to TLS 1.2 (#11213)
* [vcpkg] Restrict telemetry uploads to TLS 1.2, as required by Azure security policy.

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
2020-05-07 14:20:14 -07:00
Martin Hořeňovský
6ef805c2a9
[vcpkg] Small touchups for vcpkg unit tests (#11068)
* Do not disable expression decomposition in some optional tests

The tests are trivial enough that it is unlikely to come useful,
but the old usage is bad practice.

* Run tests in random order

This should prevent committing tests that are run-order dependent,
or at least shake them out eventually in CI.
2020-04-29 12:00:50 -07:00
nicole mazzuca
09af1e9b55
[vcpkg] Add initial JSON support (#10521)
* [vcpkg] Add initial JSON support

This adds a JSON parser, as well as the amount of unicode support
required for JSON parsing to work according to the specification. In the
future, I hope to rewrite our existing XML files into JSON.

Additionally, as a drive-by, we've added the following:

* add /wd4800 to pragmas.h -- this is a "performance warning", for when
  you implicitly convert pointers or integers to bool, and shouldn't be
  an issue for us.
* Switched Parse::ParserBase to read unicode (as utf-8), as opposed to
  ASCII
* Building again under VCPKG_DEVELOPMENT_WARNINGS, yay!
2020-04-17 18:16:20 -07:00
nicole mazzuca
22623e3501
[vcpkg] Clean up CMake build system (#10834)
There are quite a few changes to the CMake build system packaged up into
one set here:
* Added `toolsrc/cmake/utilities.cmake`, which contains the following:
  * `vcpkg_detect_compiler` -- get the name of the C++ compiler, as one
    of {gcc, clang, msvc}
  * `vcpkg_detect_standard_library` -- get the name of the standard
    library we're linking to, as one of {libstdc++, libc++, msvc-stl}
  * `vcpkg_detect_std_filesystem` -- figure out how to link and call
    into C++17's filesystem; whether one needs to link to `stdc++fs` or
    `c++fs`, and whether to use `<filesystem>` or
    `<experimental/filesystem>`.
* Added a `VCPKG_WARNINGS_AS_ERRORS`, split off from
  `VCPKG_DEVELOPMENT_WARNINGS`, which allows one to use the development
  warnings without passing -Werror
* Rename `DEFINE_DISABLE_METRICS` to `VCPKG_DISABLE_METRICS` -- the
  former will now print a deprecation message and set the latter.
* Now, print a deprecation message on `WERROR`; it doesn't do anything
  since the behavior it requested is now the default.
* Pass `-std=c++17` if the compiler allows it, instead of `-std=c++1z`
* Do some code movement
* Pass `USE_STD_FILESYSTEM` if possible, instead of only on minGW
  * Renamed to `VCPKG_USE_STD_FILESYSTEM`

Additionally, we now pass `/W4` in Debug mode on x86 in the Visual
Studio build system; this brings it in line with the CMake build system,
and the x64 Visual Studio build system.

And finally, we make some minor code changes to support compiling in
VCPKG_DEVELOPMENT_WARNINGS mode.
2020-04-14 22:08:50 -07:00
Robert Schumacher
f7fb56decd [vcpkg] Use CreateProcess on Windows. Improve EnvVars manipulation and handling. (#9897)
* [vcpkg] Rewrite process spawning on windows to always use CreateProcess, enabling better environment handling

* [vcpkg] Use environment cache to avoid calling vcvars multiple times

* [vcpkg] Increase buffer size while computing hashes

* [vcpkg] Remove unneeded cmd.exe wrapper process on all CreateProcess calls

* [vcpkg] Fix .vcxproj{,.filters}

* [vcpkg] Upgrade Ctrl-C state machine to handle multiple background processes.

* [vcpkg] Fix regression while launching metrics: 'start' can't be passed directly to CreateProcessW

* [vcpkg] Fix typo on non-Windows

* [vcpkg] Fix various uses of >NUL across the code

* [vcpkg] Fix various uses of >NUL across the code
2020-02-08 22:45:36 -08:00
Cristian Adam
38b959022c Add support for building with MinGW (#9137)
* Add support for building with MinGW

Tested with MSYS2 MinGW 8.3.0, gcc-mcf.lhmouse MinGW 9.2.1,
and StephanTLavavej/mingw-distro!

* Add MinGW toolchain

From your MinGW configured shell you could just use vcpkg to
configure packages.

An x64-mingw triplet would look like:
```
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_ENV_PASSTHROUGH PATH)

set(VCPKG_CMAKE_SYSTEM_NAME MinGW)
```

* Add MinGW community tripplets

x64 tested with https://github.com/StephanTLavavej/mingw-distro
x86, arm64, arm tested with https://github.com/mstorsjo/llvm-mingw
2020-01-17 15:36:08 -08:00
Kristof
24a97b16e7 [toolsrc] Added missing @ to FATAL_ERROR message (#9720)
To install a specific version of a package via homebrew, an `@` symbol must be placed in-between the package name and its version.
Added missing symbol to `toolsrc/CMakeLists.txt`

See homebrew console output for reference:
```
Kristofs-Mac-Pro:vcpkg kristofdaja$ brew search gcc
==> Formulae
gcc                     gcc@5                   gcc@7                   x86_64-elf-gcc
gcc@4.9                 gcc@6                   gcc@8
```
2020-01-16 15:11:27 -08:00
fradav
483257fbfb Update to clang 9.* (removed libc++fs) (#8924) 2019-11-21 17:11:57 -08:00
Joel Pelaez Jorge
db3e74fa9c Fix CMake checks for Apple Clang 11.0 on macOS 10.15 (#8580)
* Fix CMake checks for Apple Clang 11.0 on macOS 10.15

* Use clang++ instance clang if allowAppleClang is enabled
2019-10-14 16:04:05 -07:00
Nicole Mazzuca
300e21d59e [vcpkg] Major tool CMakeLists.txt updates
- Add the "VCPKG_DEVELOPMENT_WARNINGS" flag
	- setting "WERROR" will also set this flag
	- This flag is set by default
	- on GCC/clang, this will pass '-Wall -Wextra -Wpedantic -Werror'
	- on GCC, this will additionally pass '-Wmissing-declarations'
	- on clang, this will additionally pass '-Wmissing-prototypes'
	- on MSVC, this will pass '-W4 -WX'
- On Visual Studio 2017 and later, pass '-permissive-'
- Change the source for fallout of these changes
- add `format` subcommand
	- formats all C++ source and header files using clang-format
- move `include/vcpkg-test/catch.h` to `include/catch2/catch.hpp`
- pass CONFIGURE_DEPENDS to file(GLOB)
2019-08-16 19:40:53 -07:00
Alexander Neumann
f9c92910a7 Change CMakeLists.txt in toolsrc to allow compiling with llvm toolset (#4572)
* llvm warning pessimistic move

* warning missing override

* warning invalid noreturn. ::TerminateProcess ist not marked as noreturn!

* use more modern cmake features instead of adding c++ standard by hand.

* Normalize line endings

* Fix add_executable()

* Fix target commands

* Clean up CMakeLists.txt
2019-08-14 14:06:00 -07:00
Nicole Mazzuca
e79f0dc532 [vcpkg] Make Filesystem::remove_all faster #7570
I added benchmarks to measure how fast the parallel remove_all code was
-- it turns out, about 3x slower than stdfs::remove_all. Since this was
the case, I removed all of the parallelism and rewrote it serially, and
ended up about 30% faster than stdfs::remove_all (in addition to
supporting symlinks).

In addition, I did the following three orthogonal changes:
  - simplified the work queue, basing it on Billy O'Neal's idea
  - Fix warnings on older versions of compilers in tests, by splitting
    the pragmas out of pch.h.
  - Ran clang-format on some files

In fixing up remove_all, the following changes were made:
  - On Windows, regular symlinks and directory symlinks are distinct;
    as an example, to remove directory symlinks (and junctions, for that
    matter), one must use RemoveDirectory. Only on Windows, I added new
    `file_type` and `file_status` types, with `file_type` including a new
    `directory_symlink` enumerator, and `file_status` being exactly the
    same as the old one except using the new `file_type`. On Unix, I
    didn't make that change since they don't make a distinction.
  - I added new `symlink_status` and `status` functions which use the
    new `file_status` on Windows.
  - I made `Filesystem::exists` call `fs::exists(status(p))`, as opposed
    to the old version which called `stdfs::exists` directly.
  - Added benchmarks to `vcpkg-test/files.cpp`. They test the
    performance of `remove_all` on small directories (~20 files), with
    symlinks and without, and on large directories (~2000 files), with
    symlinks and without.
2019-08-07 16:51:12 -07:00
nicole mazzuca
165907550c
Update tests, and add documentation! (#7506)
This PR does the following:

* fix tests -- now, they're always built in the CMake scripts, and they work on VS2015
  *add a new flag, BUILD_TESTING, which allows one to turn off testing builds
* Add documentation for running tests
2019-08-02 09:52:39 -07:00
nicole mazzuca
aeecc01fbd Modify CMakeLists to split up vcpkglib (#7407)
Before this, we had vcpkg and vcpkg-test taking the vcpkglib source
files directory -- this commit makes vcpkglib an object library.
2019-07-24 13:50:45 -07:00
Nicole Mazzuca
0d8bba52e4 allow tests to run on older standard libraries 2019-07-19 23:20:28 -07:00
Nicole Mazzuca
c55ea0a0d5 switch to new test framework 2019-07-19 12:56:24 -07:00
nicole mazzuca
8250553789 Rewrite the tests! now they're cross-platform! (#7315)
* begin exploratory rewriting of tests

* continue working on tests

* more test work! holy butts vcpkg-tests/plan.cpp was a bunch of work

* finish writing new tests

  - [x] write catch2 tests
  - [ ] rewrite/at least delete the VS project files
  - [ ] document running tests

* Fix tests to work on WSL, rewrite test vcxproj

still need to test on macOS
also, delete tests.pch.h

* Condense add_test calls
2019-07-18 19:07:00 -07:00
Robert Schumacher
e5b92a3911
[vcpkg] Improve vcpkg::Files::Filesystem error handling (#6919)
* [vcpkg] Modify Filesystem::remove and Filesystem::rename to not throw.

* [.gitignore] Ignore new VS2019 CMake integration default location

* [.gitignore] Ignore CMakeSettings.json in toolsrc

* [vcpkg] Time external processes called with System::cmd_execute

* [vcpkg] Work around VS2019 CMake bug

* [vcpkg] Fix several unused variable warnings.

* [vcpkg] Improve error handling in vcpkg::Files::Filesystem

Always require either std::error_code or LineInfo to print better errors.

* [vcpkg] Fixup missing return value.

Drive by fix: silence warnings in tests.

* [vcpkg] Fix exiting in error_code overload

Drive by fixes for /analyze with VS2019
2019-06-19 11:49:57 -07:00
lukka
46a77b9006 appleclang 10.01 does not have <filesystem> (#6413)
support
2019-05-13 04:11:35 -07:00
fradav
5ab041409b Updated libc++fs link for libc++ 8.0 (#6029) 2019-04-15 22:50:09 -07:00
soroshsabz
246bd61ba1 Add -allowAppleClang option to bootstrap.sh. (fixes #4698) (#5915)
* Add -allowAppleClang option to bootstrap.sh. (fixes #4698)

* [vcpkg-bootstrap] Simplify appleclang changes and reformat

* [vcpkg-bootstrap] Remove enviroment variable VCPKG_ALLOW_APPLE_CLANG
2019-04-11 00:32:03 -07:00
Robert Schumacher
b39b0899cb [vcpkg] Synchronize vcpkg-base with external repo (#5934) 2019-04-08 23:26:18 -07:00
Mathieu Ropert
bf4af7afdc Fix vcpkg build with clang on Linux (#5360) 2019-03-05 14:52:26 -08:00
Konstantin Podsvirov
a6986fdbea [vcpkg] Link bcrypt via CMake on Windows (#3765) 2018-06-26 11:40:44 -07:00
Alexander Karatarakis
db3004459f Improve disableMetrics propagation when consuming CMakeLists directly 2018-06-11 17:01:13 -07:00
Alexander Karatarakis
9508d4aad2 Add -disableMetrics for linux 2018-06-08 18:40:20 -07:00
Robert Schumacher
a2aeb2f194 [vcpkg] Mark many types noexcept. Make certain code patterns more transparent to /analyze. #ifdef-out unused code on non-windows. 2018-04-12 00:47:17 -07:00
Alexander Karatarakis
35bbd4015a Improve message for appleclang 2018-03-30 14:46:43 -07:00
Alexander Karatarakis
ba7b8e6d73 Add message for appleclang versions that don't support std::filesystem 2018-03-29 15:29:16 -07:00
Robert Schumacher
9336d5ea84 [vcpkg] Link pthreads 2018-03-13 05:21:17 -07:00
Konstantin Podsvirov
1bcf4cef0d [vcpkg] Allow compilation via CMake with MSVC (#2935) 2018-03-02 11:16:49 -08:00
Robert Schumacher
0ef0300b8e [vcpkg] Enable metrics on linux 2018-02-21 23:01:54 -08:00
Robert Schumacher
63a23cf0ca [vcpkg] Fix regressions in WSL build. 2017-12-14 14:31:28 -08:00
Robert Schumacher
b496f7df49 [vcpkg] Further fix for clang/gcc 2017-11-28 13:07:08 -08:00
Robert Schumacher
8ba3279143 [vcpkg] Use c++experimental in clang 2017-11-28 10:50:33 -08:00
Robert Schumacher
14cbe496bc [vcpkg] Allow compilation inside WSL 2017-11-25 16:21:54 -08:00