* Use /MT and CMake 3.15.
CMakeLists.txt:
1 Bump to 3.15
4 Turn on policy CMP0092 to disable default cmake warnings.
30 Remove previous now-redundant use of MSVC_RUNTIME_LIBRARY
99 Remove regex obsoleted by CMP0092
utilities.cmake
194 Remove clang 9.x development warnings workaround.
203 Remove /W3 when development warnings are off.
* Make CMAKE_MSVC_RUNTIME_LIBRARY toolchain and command line overridable.
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
* [asset caching] Add cli parameter to pass asset sources
* Introduce imbue_from_fake_environment to avoid environment dependency in tests
* Fix broken test
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
* Add NO_COMPILER_TRACKING triplet option
* Use 'disable_compiler_tracking'
* Handle per-port compiler tracking
* Add test for compiler tracking
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
* Implement parallel cache decompression
* Switch parallel fmap to queue instead of chunked
* Switch to std::async
* Inline parallel_fmap due to Only One User
* Preserve RAII for file locking through virtual dispatch.
This change was extracted from adding the POSIX backend for filesystem to be easier to review. It moves everything related to file locking into files.cpp, and eliminates ifdefs in files.h for platform selection. It uses std::function to unlock the lock instead. Notably, this is the same number of virtual dispatches as before, and eliminates a theoretical lifetime problem where the Filesystem* did not outlive the ExclusiveFileLock type.
* Update include/vcpkg/base/files.h
Co-authored-by: Billy O'Neal <bion@microsoft.com>
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
* Enforce cross platform paths in registries.
This also drops the dependency on path::iterator which means Bill doesn't have to implement it in project depath
* Also fix array_elements to actually be diengaged on failure.
Unify error handling in filesystem.
Change all filesystem functions that may fail to have the form
f(args, args, error_code&)
f(args, args, LineInfo)
with "ignore_errors_t" replaced with a workaround to pass a throwaway std::error_code.
Adds get_directories_(non_)?recursive and get_regular_files(non_)?_recursive, which move the most common filtering criterion of callers of get_files_(non_)?recursive into the filesystem layer. This will improve performance on Windows where the directory-ness of an entity is returned as part of the normal enumeration process, which will save us N file open calls.
Changes termination messages to use a shared infrastructure which avoids bugs where the format string does not match the set of inputs.
Also changed generic_u8string to u8string in a lot of appropriate places.
Audited case sensitivity in path comparison to be consistent.
* vcpkg install: requesting non existing features should be an error
* Support print2(VCPKG_LINE_INFO) for debugging
* Handle the case of a feature removal during package upgrade
* Fix formatting
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
* Make symlink tests work on all Windows versions
test/files.cpp
Rather than try to read windows client specific registry keys as a means of predicting whether symlinks work, now that we distribute vcpkg in binary forms on Windows, we can assume it is built with a modern compiler, and thus with std::filesystem. This means we can detect the problematic condition by just attempting to create the symlink, and testing if we get ERROR_PRIVILEGE_NOT_HELD back.
utilities.cmake:
Delete handling for old compilers on Windows.
files.h and base/files.cpp:
Add create_directory_symlink called by tests, and the missing overloads of create_symlink.
Delete code blocks looking for defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM.
Fix bad format string in create_directory error message without enough %s.
Remove unnecessary regex_search for invalid chars.
util.h and util.cpp:
Delete extra copy of create_symlink infrastructure and mechanism to guess if create_symlink works.
strings.cpp:
Inline b32_encode
hash.h and hash.cpp and hash.cpp:
Drive by delete SHA1.
* Delete unused rol32 and format.
* Delete unused variable.
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
We recently have run into problems in our normal CI infrastructure when we increased the size of the VMs where all VMs tried to fetch the same nonexistent entries over and over and caused failures. To alievate that problem, this changes binary caching to not issue server I/Os for status that vcpkg already knows.
To that end, this is a substantial redesign of the IBinaryProvider mechanism to give this global knowledge of which things have been restored from cache, such that MergedBinaryProvider is replaced with class BinaryCache, and the functions that were 'masaging' the interface to IBinaryProvider are put in that type. Moreover, NullBinaryProvder is an empty binary cache.
Incidential fixes:
* Different commands were inconsistent in how they configured the binary cache, in particular manifest mode and normal mode installs treated --download-only differently.
* The different IBinaryProviders that make a temp zip file all use the same zip file name.