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

1340 Коммитов

Автор SHA1 Сообщение Дата
Billy O'Neal 8d673fc81a
Improve Unicode perf. (#1318) 2024-01-23 16:42:13 -08:00
Thomas1664 b1d882f2a9
Don't format options table like errors (#1306)
---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2024-01-10 16:12:36 -08:00
Billy O'Neal 48ba35a022
Avoid leaking doskey macros from internal vcvarsall runs. (#1295) 2024-01-10 11:50:43 -08:00
Billy O'Neal 4e75e1c5a5
Fix Utf8Decoder operator== handling of the last code point in the input (#1316)
* Fix Utf8Decoder operator== handling of the last code point in the input

While working on diagnostics for https://github.com/microsoft/vcpkg-tool/pull/1210 I observed that we were printing the caret ^ in the wrong place when it goes after the input.

The way this works is we form the line of text to print, then decode the unicode encoding units, and when we hit the target, we stop and print ^:

5b8f9c40dd/src/vcpkg/base/parse.cpp (L51-L68)

however, if the intended location for the ^ is the "end" of the line, we hit this bug:

5b8f9c40dd/src/vcpkg/base/unicode.cpp (L273)

The iterator only compares the last_ pointers, but both the "points at the last code point in the input" and "points to the end of the input" state set `next_ == last_`. See:

5b8f9c40dd/src/vcpkg/base/unicode.cpp (L222-L226)

This means that the points to the end and points one past the end iterator compare equal, so the loop in parse.cpp stops one position too early.

Also adds a bunch of testing for this specific case, for other parts of Utf8Decoder, adds a way to parse the first code point without failing, makes all the operators 'hidden friends', and removes localized strings for bugs-in-vcpkg-itself.

* Add noexcepts as requested by @Thomas1664
2024-01-04 17:36:54 -08:00
Thomas1664 bfda089e34
StringLiteral for command switches and settings (#1308) 2023-12-19 22:35:38 -08:00
Thomas1664 51d7f89c82
Inline defaulted functions (#1280) 2023-12-19 22:30:31 -08:00
Billy O'Neal 3ba6cec1bd
Reset PROCESSOR_ARCHITECTURE on start
A customer reported a problem where sometimes `vcpkg-cmake` can't detect that Ninja is safe to use. There, despite being on an amd64 system, this block didn't detect that things were OK: 

(#1297)08c4e71048/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake (L55-L61)

We are unable to replicate the problem, but suspect that they may be in an environment where PROCESSOR_ARCHITECTURE isn't set properly, similar to what we experienced in https://github.com/microsoft/vcpkg-tool/pull/769 .

Try to fix this problem by explicitly setting it to what it should be.

Before:

```console
PS D:\vcpkg> rm env:PROCESSOR_ARCHITECTURE
Remove-Item: Cannot find path 'Env:\PROCESSOR_ARCHITECTURE' because it does not exist.
PS D:\vcpkg> rm env:PROCESSOR_ARCHITEW6432
Remove-Item: Cannot find path 'Env:\PROCESSOR_ARCHITEW6432' because it does not exist.
PS D:\vcpkg> echo "PROCESSOR_ARCHITEW6432: $env:PROCESSOR_ARCHITEW6432 PROCESSOR_ARCHITECTURE: $env:PROCESSOR_ARCHITECTURE"
PROCESSOR_ARCHITEW6432:  PROCESSOR_ARCHITECTURE:
PS D:\vcpkg> .\vcpkg.exe env
Microsoft Windows [Version 10.0.22631.2715]
(c) Microsoft Corporation. All rights reserved.

D:\vcpkg>echo PROCESSOR_ARCHITEW6432: %PROCESSOR_ARCHITEW6432% PROCESSOR_ARCHITECTURE: %PROCESSOR_ARCHITECTURE%
PROCESSOR_ARCHITEW6432: %PROCESSOR_ARCHITEW6432% PROCESSOR_ARCHITECTURE: %PROCESSOR_ARCHITECTURE%

D:\vcpkg>exit
PS D:\vcpkg> echo "PROCESSOR_ARCHITEW6432: $env:PROCESSOR_ARCHITEW6432 PROCESSOR_ARCHITECTURE: $env:PROCESSOR_ARCHITECTURE"
PROCESSOR_ARCHITEW6432:  PROCESSOR_ARCHITECTURE:
PS D:\vcpkg> .\vcpkg.exe env C:\Windows\SysWOW64\cmd.exe
Microsoft Windows [Version 10.0.22631.2715]
(c) Microsoft Corporation. All rights reserved.

D:\vcpkg>echo PROCESSOR_ARCHITEW6432: %PROCESSOR_ARCHITEW6432% PROCESSOR_ARCHITECTURE: %PROCESSOR_ARCHITECTURE%
PROCESSOR_ARCHITEW6432: %PROCESSOR_ARCHITEW6432% PROCESSOR_ARCHITECTURE: %PROCESSOR_ARCHITECTURE%
```

After:

```console
PS D:\vcpkg> rm env:PROCESSOR_ARCHITECTURE
PS D:\vcpkg> rm env:PROCESSOR_ARCHITEW6432
Remove-Item: Cannot find path 'Env:\PROCESSOR_ARCHITEW6432' because it does not exist.
PS D:\vcpkg> echo "PROCESSOR_ARCHITEW6432: $env:PROCESSOR_ARCHITEW6432 PROCESSOR_ARCHITECTURE: $env:PROCESSOR_ARCHITECTURE"
PROCESSOR_ARCHITEW6432:  PROCESSOR_ARCHITECTURE:
PS D:\vcpkg> .\vcpkg.exe env
Microsoft Windows [Version 10.0.22631.2715]
(c) Microsoft Corporation. All rights reserved.

D:\vcpkg>echo PROCESSOR_ARCHITEW6432: %PROCESSOR_ARCHITEW6432% PROCESSOR_ARCHITECTURE: %PROCESSOR_ARCHITECTURE%
PROCESSOR_ARCHITEW6432: %PROCESSOR_ARCHITEW6432% PROCESSOR_ARCHITECTURE: AMD64

D:\vcpkg>exit
PS D:\vcpkg> echo "PROCESSOR_ARCHITEW6432: $env:PROCESSOR_ARCHITEW6432 PROCESSOR_ARCHITECTURE: $env:PROCESSOR_ARCHITECTURE"
PROCESSOR_ARCHITEW6432:  PROCESSOR_ARCHITECTURE:
PS D:\vcpkg> .\vcpkg.exe env C:\Windows\SysWOW64\cmd.exe
Microsoft Windows [Version 10.0.22631.2715]
(c) Microsoft Corporation. All rights reserved.

D:\vcpkg>echo PROCESSOR_ARCHITEW6432: %PROCESSOR_ARCHITEW6432% PROCESSOR_ARCHITECTURE: %PROCESSOR_ARCHITECTURE%
PROCESSOR_ARCHITEW6432: AMD64 PROCESSOR_ARCHITECTURE: x86
```
2023-12-11 14:53:00 -08:00
autoantwort c1b70fb90e
Separate user and machine output (#1175) 2023-12-11 11:01:40 -08:00
autoantwort 5fbcab79b1
Generate usage text for pkgconfig files (#1268) 2023-12-05 14:00:00 -08:00
data-queue 2f523c3faf
Print ABI of a package in output (#1293)
* fix

* format
2023-12-04 18:25:30 -08:00
Billy O'Neal bfb9896877
Print "@version" when talking about port versions more frequently. (#1292)
In https://github.com/microsoft/vcpkg/pull/35164 there was some confusion where a customer thought `vcpkg ci` was building an old version of openvino because we only printed the version to build for the `--dry-run` prepass and didn't print the version to build for the actual build. The customer thought we were building the old version rather than the new version as a result.

This change ensures we print the version we are discussing after "Installing" or "Building" and consistently uses the "packagespec@version" form in all the places. For consistency the "packagespec -> version" form we used in a few places is replaced with the @ form.
2023-12-04 15:06:08 -08:00
Billy O'Neal 1767aaee7b
dos2unix all the things (#1289)
* dos2unix all the things except for those that should have CRLFs

* Fix version DB.
2023-11-27 15:02:21 -08:00
Billy O'Neal 07041b08f0
Eliminate remaining users of ParseControlErrorInfo. (#1279)
Co-authored-by: Thomas1664 <46387399+Thomas1664@users.noreply.github.com>
2023-11-27 10:30:23 -08:00
Victor Romero 90e00c19de
Add unique repository ID detection in ADO and GitLab (#1281) 2023-11-27 10:29:47 -08:00
Billy O'Neal a35ce804e1
[z-applocal] Reduce nonexistent and non-PE files to warnings. (#1274) 2023-11-20 17:11:21 -08:00
Billy O'Neal 365d419c00
Ensure spdx_location is not dropped when loading ports. (#1237) 2023-11-10 15:11:59 -08:00
Billy O'Neal dfb60db5b9
Audit headers for overzealous inclusion reported by Visual Studio (#1273) 2023-11-09 15:06:33 -08:00
autoantwort c9e4be1d6a
Ensure generated GitHub issue bodies are not too long to post (#1257) 2023-11-07 11:53:01 -08:00
Billy O'Neal 0e693953a4
Use Version instead of {raw_version,port_version} in more places. (#1253) 2023-11-07 11:34:54 -08:00
autoantwort 92b355988f
std::experimental::boyer_moore_horspool_searcher is deprecated (#1266) 2023-11-07 11:27:50 -08:00
autoantwort 003947164a
Use View instead of Iterator + size (#1250) 2023-11-03 16:40:04 -07:00
Billy O'Neal 82a7c96db2
Clarify BuildInfo::version's purpose. (#1261)
* Add test case for the recording head version feature noted in https://github.com/microsoft/vcpkg-tool/pull/1259#discussion_r1378120355

* Sanitize detected head versions to make sure they are at least version-strings.
2023-11-03 16:06:51 -07:00
Billy O'Neal da950b3761
Clarify to localizers git tree SHA vs git commit SHA. (#1239) 2023-10-31 20:41:30 -07:00
Thomas1664 13b138a4e9
Add Container&& overload for `Util::Vectors::append` (#1254) 2023-10-31 18:11:53 -07:00
Billy O'Neal 4afdf8745a
Apply conditional noexcept to Expected's constructors. (#1251) 2023-10-31 16:57:14 -07:00
Billy O'Neal f9df9b33bf
Delocalize error: warning: and note:. (#1260)
* Delocalize error: warning: and note:.

Response to code review comment https://github.com/microsoft/vcpkg-tool/pull/1239#discussion_r1373803950
2023-10-31 16:46:17 -07:00
Thomas1664 fe0ad6ccfb
Use different search algorithm in `Strings::contains_any` (#1255) 2023-10-30 17:23:18 -07:00
Billy O'Neal 7411aa2913
Always use <vcpkg-test/util.h> rather than <catch2/catch.hpp>. (#1252)
This ensures the StringMakers in util.h are always available for better console output.
2023-10-27 17:03:19 -07:00
Billy O'Neal e0ec6cdb16
Fix VS static analyzer warnings. (#1235)
* Fix VS static analyzer warnings.

1. Optional and expected were not properly forwarding noexcept for their special member functions, so is_nothrow_move_constructible_v<Expected<T>> was false for all T. (This has bad implications if the expecteds are in a vector)
2. system.process.cpp uses a 32k stack buffer but it's the "top" of the stack so we don't care.
3. dependencies.cpp was calling std::move() on a constant variable `info_ptr->default_features`; I changed the declarations to better show that this was const.
4. (Drive by) All users of make_optional were actually doing emplacement.
2023-10-26 13:51:46 -07:00
Billy O'Neal 8f4f3fa9e4
Push ExpectedL into the SourceControlFile::parse family. (#1240) 2023-10-26 13:50:30 -07:00
Billy O'Neal 43c47e8c8d
Use ports-root and registry-versions git repos. (#1241)
* Use the git repo of --x-builtin-ports-root and --x-builtin-registry-versions-dir when talking about port commit shas and version tree shas, respectively.

I believe this is necessary to make the instructions in https://learn.microsoft.com/vcpkg/produce/publish-to-a-git-registry#4---update-the-versions-database actually work.

This also reduces the number of things that assume VCPKG_ROOT is a git repo. (Since it is not when we are shipped in VS or acquired with the one liner)
2023-10-24 16:50:49 -07:00
Billy O'Neal 9b151e6b7e
Use Version in DependencyOverride rather than reinventing it. (#1238) 2023-10-23 14:21:10 -07:00
Billy O'Neal d38bf94771
Split functions to avoid 'is_manifest' control coupling. (#1229) 2023-10-17 15:48:10 -07:00
Billy O'Neal 79ad338d67
urlencode spaces before calling curl (#1230)
Alternate resolution of https://github.com/microsoft/vcpkg/pull/34441

The URL is supposed to contain query parameters and similar, so we can't go all the way to full urlencode(). But spaces should do the same thing with curl as they do for WinHTTP and get encoded correctly.
2023-10-17 15:47:43 -07:00
Capric 5fc782025f
add mips64 target support (#1226) 2023-10-13 11:49:22 -07:00
Billy O'Neal 91ce2ab866
Add try_find_file_recursively_up (#1228)
Extracted from https://github.com/microsoft/vcpkg-tool/pull/1210
2023-10-10 17:44:53 -07:00
Robert Schumacher aedbe0424d
Extract msg:: removal from #1210 (#1227) 2023-10-10 15:27:30 -07:00
Billy O'Neal 0d3da0808d
Make registries distinguish between 'baseline is broken' and 'baseline missing'. (#1203) 2023-10-05 20:22:33 -07:00
Billy O'Neal 96851de5df
Add z-changelog; replacement for scripts/Get-Changelog.ps1 (#1200) 2023-10-03 22:49:25 -07:00
Thomas1664 2ebc346384
Search for post-build-check absolute paths in parallel (#1213) 2023-10-02 16:31:40 -07:00
Billy O'Neal 77d1cc508b
Fix crash while parsing malformed manifest files and make errors prettier (#1219)
Co-authored-by: autoantwort <41973254+autoantwort@users.noreply.github.com>
2023-10-02 01:31:22 -07:00
Thomas1664 afc10ff258
Various small fixes (#1215) 2023-09-28 20:02:01 -07:00
Billy O'Neal c8d3309f65
Burninate VersionDbType control coupling. (#1205)
The registries machinery like version database parsing is annoying to reuse because it has this VersionDbEntry type which can represent version records in both filesystem and git registries, forcing all callers that interact with everything to special case both or otherwise tolerate 'silent UB' all over the place. I found that all callers always pass constant values, meaning this all can be totally separate functions and structs, thus eliminating that entire class of error.

This also means that the interface most clients *want*, 'get_builtin_versions', now maps closely to what the actual implementation is doing.
This also means that reading git registries no longer requires clients to cough up a meaningless 'root' variable.
This also means that callers like add-version and ci-verify-versions can use the same version database record type that all the parsing machinery uses rather than repackaging into pair.
2023-09-20 13:56:38 -07:00
Billy O'Neal bfdd29ef82
Plumb error reporting through registries interfaces. (#1153) 2023-09-18 16:55:17 -07:00
Billy O'Neal c881585d95
Suggest x-update-baseline for manifest mode vcpkg upgrade. (#1184) 2023-09-11 15:36:48 -07:00
Billy O'Neal c9d87b464f
Update clang-format to 16.x (#1185) 2023-09-08 12:02:20 -07:00
Billy O'Neal e6c0307088
Make help be consistent. (#1169)
* Add name, synopsis, and example information to CommandMetadata.
* Clean up needing to make thunks for all help text in command metadata machinery.
* Power autocomplete and help with the same tables that power command lookup. Resolves this line item first discovered in https://github.com/microsoft/vcpkg-tool/pull/1164
* Improve help by printing synopsis and grouped examples powered by CommandMetadata.
* Update the main usage to make sure every relevant command is included.
* Add website link to all help commands.
* split rarely used and artifacts into separate `vcpkg help commands` from @ras0219-msft
* make tense for all synopsis and argument help text consistent from @ras0219-msft
* burninate 'instead of' and 'writes out'
* Deduplicate the all commands help topic and remove 'vcpkg' from 'vcpkg help blah'.
2023-09-06 23:55:19 -07:00
Billy O'Neal 51dfe0f4d3
Change the default triplet to the same as the host triplet on Windows. (#1180)
This removes the 'in September 2023' message and does what the message said we would do. For the next 6 months we'll warn that the behavior changed.

The specific change to triplet.cpp to change the triplet setting is from https://github.com/microsoft/vcpkg-tool/pull/640

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
2023-09-06 16:57:32 -07:00
Billy O'Neal 80b792671b
Delete 'vcpkg cache'. (#1174)
* Delete 'vcpkg cache'.

'vcpkg cache' was a helper for folks to attempt to implement caching systems. It prints the contents of the "packages" directory. It was a kind of helper for before we had real binary caching support built into the tool proper.

@vicroms indicates that telemetry shows fewer than 100 invocations of `vcpkg cache` in the last 90 days, so this should be OK to outright remove without a deprecation period.

* Also get rid of unique messages.
2023-09-06 16:56:53 -07:00
Alexander Neumann efcf58dd7b
Introduce --x-cmake-debug and --x-cmake-configure-debug (#1173)
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2023-09-04 13:29:16 -07:00
Billy O'Neal 117a5e64d0
Make artifacts use common console handling. (#1165) 2023-08-30 14:01:22 -07:00
Guillaume Racicot 6bc426e87b
Update fmt to 10.1.0 (#1168)
Co-authored-by: Guillaume Racicot <grc@pixmob.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2023-08-28 18:42:03 -07:00
autoantwort a7a3de88ad
Use posix definition of a line (#1172) 2023-08-28 17:49:36 -07:00
Julian Zimmermann a25b692b9d
replaces ${VERSION} variable with correct version in generated spdx files (#1162)
Co-authored-by: Julian Zimmermann <julian.zimmermann@gti.de>
Co-authored-by: autoantwort <41973254+autoantwort@users.noreply.github.com>
2023-08-25 15:02:00 -07:00
Billy O'Neal 71253a3b04
Add initial command guidelines and make all commands follow them. (#1164) 2023-08-23 13:06:09 -07:00
Billy O'Neal 6b2f36a769
Fix integrate to always know its subcommands. (#1161) 2023-08-22 17:27:11 -07:00
Thomas1664 95d864dc82
Cleanup: Move instead of copy and use XMLWriter for DGML (#1159) 2023-08-18 11:54:08 -07:00
Billy O'Neal c1dca2e08a
Restore LSP on PortfileProvider infrastructure. (#1157) 2023-08-17 12:07:23 -07:00
Billy O'Neal 5eecc9e587
Fix edit to only list builtin ports rather than trying to look in the registry set for its autocomplete. (#1158)
The edit command doesn't understand registries, and certainly has no reason to actually parse all the registries' ports.
2023-08-17 12:06:48 -07:00
Javier Matos Denizac 2d4fea47b9
vcpkg contact remove --survey option (#1160)
* --survey is retired

* silence compiler warning

* remove unused messages
2023-08-16 14:45:46 -07:00
Billy O'Neal 81c8bedf74
Infrastructure: allow passing stdin to subprocesses. (#1134)
Also uses the new infrastructure to avoid needing a temporary file in:
  [dependencygraph] Fix "command line too long" when sending to GitHub's dependency-graph API #1144
from @klalumiere .

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Kevin Lalumiere <kevin.lalumiere@gmail.com>
2023-08-11 21:17:59 -07:00
Haowu Ge 56798731f1
Add loongarch64 support (#1149) 2023-08-11 21:16:08 -07:00
autoantwort 47a03cc552
Ci: Detect not needed entries in ci.baseline.txt (#1111) 2023-08-11 21:14:56 -07:00
Javier Matos Denizac c94e4034e9
[Export Command] Enabling Manifest Mode (#1136)
* initial implementation

* avoid value or exit and reuse MissinOption message

* improve messaging

* reduce redundancy

* add end2end test file

* add test cases for raw based exports in manifest mode
2023-08-10 13:06:37 -07:00
Billy O'Neal d1c1423ef5
Fix crash trying to make a github issue report caused by compiler metadata being missing. (#1138) 2023-08-08 17:23:31 -07:00
Billy O'Neal 6c196bdf91
Fix search-by-name commands broken by wildcard packages feature. (#1147)
* get_all_port_names => append_all_port_names

* Extract get_all_reachable_port_names.

* Fix redundant equal compare in package_match_prefix when the prefix is a wildcard.

* Fix handling of wildcards when getting all reachable names.

* Teach autocomplete to do its work without hitting the network.

* Add unit test.
2023-08-08 17:22:43 -07:00
Kevin Lalumiere 5d96408565
Fix command line too long when sending to GitHub dependency graph (#1144) 2023-08-01 16:15:18 -07:00
Javier Matos Denizac be8125a13c
Add z-extract command / artifacts uses z-extract (#1039)
* Make commands physical design consistent.

In the vcpkg technical review meeting today we said:
* We want commands.Xxx.cpp for every "vcpkg Xxx" subcommand, rather than Xxx.cpp.
* We want x- commands to not have the x in their code names or x- in their file names, and z- commands have the z in their code names and z- in their file names.
* Command cpps have dashes.

Drive by fixes as part of this audit:
* FooCommand structs are gone, all users were stateless and are better served by plain function pointers. This also allows the command tables to be constexpr.
* commands.interface.h is dead, as it only existed to declare those structs that are dead.

Future changes:
* I really want all the Commands::Xxx and the commands namespace itself to go away. But ran out of time to sell this to the team.
  * Xxx::COMMAND_STRUCTURE => XxxCommandMetadata
  * Xxx::perform_and_exit => xxx_command_and_exit

Notes:build, install, and export probably deserve to have functionality split out, but that would probably be intricate so I have not attempted to do it here.
export.*.cpp seem like they *really* shouldn't be separate .cpps.

* Missed some _command s.

* wip

* wip

* format

* minimal impl

* add .xz

* Add help text for command

* vcpkg-artifacts uses x-extract

* format

* oops

* x-extract -> z-extract

* rename extract_archive_to_empty -> extract_archive and rename the old extract_archive to set_directory_to_archive_content

* fix comment

* wip

* add strip setting

* add strip option localized message

* format

* wip

* Add testing for strip mapping

* add --extract-type option to bypass file extension detection

* format

* wip

* test

* wip

* wip

* wip

* forward slash delim for non-windows

* wip

* try again

* maybe fix paths for non-windows

* use generic_Xxx

* use + instead of /

* convert back to path

* use appropriate path separators in test

* set VCPKG_COMMAND env variable

* set VCPKG_COMMAND

* set VCPKG_COMMAND in yaml

* wip

* use matrix.preset

* remove archive unit test from artifacts

* debug

* const everything

* create destination if it does not exist

* use fsPath instead

* bug fixes and remove installers

* fix end-to-end check

* wip

* wip

* debug messages

* fix strip for macos and linux

* print output

* wip

* cleanup

* format

* rename to command_extract_and_exit as per convention

* response to feedback

* remove the extract-type option and just fall back to cmake

* fix strip_map to proper behavior, better temp dir handling, etc

* fix unit tests

* for real this time

* wip

* wip

* reuse logic for is_slash functionality

* oops

* testing

* test

* testing

* verify problem

* try this

* fix

* use Strings::strto<int> instead of std::stoi

* add AUTO option + unit test

* add strip=AUTO

* switch artifacts to use strip=AUTO

* format

* cleanup

* fix compiler warnings

* fix conversion

* format

* remove magic -1, respond to feedback, format

* update localized messages

* add e2e

* test executable bits on non-windows

* oops

* better naming

* try this

* update end2end

* for real this time

* verify file exists

* print UnixMode

* oops

* fix indentation

* look for the right unixMode

* Simplify tests.

* Delete unreferenced test assets, add archive start events back.

* remove = from #define

* format

* minor fix

* Fix casing for enum class

* rename strip_map and get_common_prefix_count and add minimum documentation

* wip

* missed a couple renames

* rename test folder from "archive" to "folder0"

* remove then from artifact caller

* some structural changes

* enforce relationship between stripMode and stripCount

* use files is_slash

* check strip option is >=0

* format

* minor refactoring

* remove empty entries from get_archive_deploy_operations

* minor refactor

* adds testing for guess_extraction_type and get_strip_setting

* add testing for get_strip_setting

* minor feedback

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2023-07-31 15:54:26 -07:00
autoantwort 51bd5bdf0f
Allow features with platform expressions (#813) 2023-07-25 17:58:44 -07:00
Javier Matos Denizac da079bd164
Cleanup binary caching for GHA (#978)
* Remove const Optional<>& from the constructor. The caller unpacks them prior to calling constructor

* rename put_file() parameter 'request' to 'method'

* Added `get_cache_entry` to downloads and `lookup_cache_entry` uses it.

* wip

* reserve_cache_entry and push success now use get_entry

* print output for debugging

* fix reference to temporary bug

* wip

* wip

* wip..

* try again

* rename get_entry to invoke_http_request

* cleanup

* wip

* change `invoke_http_request` to return an expected

* change key to be package name + abi

* debug print statements

* reverse method and url order on command

* more print statements.

* try again

* checking value of invoke_http_request

* one more time

* print exit code

* print exit code

* try again

* wip

* try to print cachId

* wip

* wip

* write url has an s at the end...

* cleanup

* [working]removing debug print messages

* add option -L

* use -X method instead of -d

* ensure query_params is not empty before joining

* wip

* wip

* restructure curl command

* if GET, queries delimited by ?

* testing without flattening just letting -d do its thing

* print command

* wip

* remove -L

* move the method option

* don't pass -d to GET requests

* confirming that -X GET is not needed

* merge main

* wip

* encoding data manually rather than using -d

* print error if there is one.

* for real this time

* do not encode data since content-type = application/json

* use -d instead of --data-raw

* const string& everything

* oops

* try --data-raw

* try my own implementation of filesize

* rename filesize to file_size

* do ec.assign since I don't need to assign it to anything custom

* set ec in a consistent manner

* format

* const the parameters

* format again

* rename url_encode to percent_encode because it's no longer needed

* remove unused variable

* wrap linux code in #else to avoid the 'unreachable code' warning

* apply diff

* add User-Agent header

* change to base version

* use vcpkg_version_base-vcpkg_version

* wip

* update cache key/value

* missed headers

* fix headers

* wip

* wip

* try again

* try again

* debug print

* remove debug messages

* some error handling

* remove unused variable

* format

* format

* response to feedback

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2023-07-14 11:10:23 -07:00
Billy O'Neal 722ba739c4
Use git read-tree rather than git archive + untar to extract trees. (#1120) 2023-07-10 07:43:49 -07:00
comex 482b64dc97
Typo fix (#1123)
"sumbit" => "submit".  Also capitalize "cli" in the same message.
2023-07-08 23:09:39 -07:00
Billy O'Neal 183eb7b66d
Cleanup HashPortManyFiles warning. (#1122)
I missed CR comments in https://github.com/microsoft/vcpkg-tool/pull/1104
2023-07-07 19:16:40 -04:00
autoantwort 1ff720fd20
ToolCache: Better explain errors. (#1099)
* ToolCache: Better explain errors.

Fixes https://github.com/microsoft/vcpkg/issues/31292 and https://github.com/microsoft/vcpkg/issues/26377

* Lazy call error function

* Address CR Comments
2023-07-07 18:18:23 -04:00
Billy O'Neal 0b63e37a0f
Allow vcpkg remove, vcpkg export, etc. without overlays. (#1110) 2023-07-07 17:59:45 -04:00
Billy O'Neal 156f858646
Change max_port_file_count to warn rather than failing to calculate an ABI hash. (#1104)
* Repeal max_port_file_count.

Resolves https://github.com/microsoft/vcpkg/issues/31975 .

* Change from removing the limit to warning when it is exceeded.
2023-07-07 17:54:16 -04:00
dan-shaw da69cf07d5
Telemetry for Actions pipeline (#1113)
* fix

* fix

* fix
2023-07-05 11:33:59 -07:00
dan-shaw 560a6e8527
dependency graph API submission fix (#1119)
* fix

* fix

* fix

* fix
2023-07-03 15:26:08 -07:00
Billy O'Neal d89474b12f
Allow overrides to select ports that aren't in the baseline. (#1109)
* Add an e2e test for removed-from-baseline ports.

* Rename patterns.ps1 to e2e-registry.ps1, to reflect that there are
  tests for more than just patterns now.
* Add removed.json.in and a call to it.

See also https://github.com/microsoft/vcpkg-tool/pull/1108 which
fixes all the e2e infrastructure to consistently use -s.

* Actually fix the bug: anything accepting both an ActionPlan and a PortFileProvider is suspect. In this case it was:

```
        void load_tag_vars(const ActionPlan& action_plan,
                           const PortFileProvider& port_provider,
                           Triplet host_triplet) const;
```

Fix that by just pushing the ActionPlan part down to the underlying virtual load_tag_vars.
2023-06-23 15:54:41 -07:00
Billy O'Neal f19f3d9939
Ensure package_dir is always filled in. (#1103)
Resolves https://github.com/microsoft/vcpkg/issues/31908

In https://github.com/microsoft/vcpkg-tool/pull/1040 , create_feature_install_plan and create_versioned_install_plan were fixed, but not create_upgrade_plan.

Make this bug structurally impossible by making the FooAction ctors that fill in m_scfl also fill in package_dir.
2023-06-22 12:36:39 -07:00
autoantwort 5c1c6b0fd4
Allow license expressions in features (#1096) 2023-06-21 16:40:35 -07:00
dan-shaw b9c33bb0e7
GitHub Dependency Graph API (#989)
* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2023-06-19 17:33:13 -07:00
Billy O'Neal 8c254a5fb6
Telemetry: defend against parent process loops (#1101) 2023-06-15 15:28:39 -07:00
Billy O'Neal 3db1ef6d60
Change get_real_filesystem() into a variable rather than a function. (#1051)
Also:

* Make all the things const so that the overall variable can be constexpr.
* Implement the readonlyness with a drived interface type rather than cv qualifiers, as requested by @ras0219-msft.
2023-06-12 15:53:39 -07:00
Thomas1664 2359ab2735
Code Cleanup (#1095) 2023-06-12 15:49:40 -07:00
Wim Leflere 19441c1bd6
Add Mermaid diagram support (#935)
Co-authored-by: Wim Leflere <wleflere@cochlear.com>
2023-06-12 11:36:00 -07:00
dan-shaw 25da717d81
Revert GitHub repo telemetry collection (#1091)
We decided that while this data would be very useful to us, it isn't worth potential privacy concerns.
2023-06-06 16:47:50 -07:00
Billy O'Neal 46c0e22def
Fix binary caching for 'upgrade'd packages (#1083) 2023-05-31 01:33:49 -07:00
Billy O'Neal 528fe75d7c
Add --format to depend-info. (#1080)
* Add --format to depend-info.

Add error handling and testing to depend-info switch handling.

Documentation update: https://github.com/microsoft/vcpkg-docs/pull/89

* xtree => x-tree, can not => cannot
2023-05-30 09:28:21 -07:00
Billy O'Neal 6e6b3c8ded
Better xbox triplet support. (#1059) 2023-05-22 16:51:31 -07:00
Billy O'Neal cbe34ab1ad
Add / use map utilities. (#1075)
* Add / use map utilities.

While reviewing https://github.com/microsoft/vcpkg-tool/pull/989/ I nerd sniped myself into looking for other instances of this pattern. Ultimately I proved to myself that I should *not* make a comment, but proving that required doing this work anyway...

* CR feedback
2023-05-22 15:13:20 -07:00
Pierre Wendling 92a5968c9e
Update fmt to 10.0.0 (#1063) 2023-05-17 13:17:49 -07:00
Robert Schumacher 8d2923fa31
Split BinaryProvider into read vs write (#998)
* Refactor Binary Caching

* Fix macOS failure

* Remove try_restore as defunct

* Apply REQUIRE_LINES

* Rename Install::perform -> Install::execute_plan to better match behavior.

* Address some PR comments

* Additional PR comments

* Address PR comments

* Format and regenerate messages
2023-05-10 09:39:09 -07:00
Robert Schumacher c2859a3f87
Rename / Rearrange BinaryCache functions (#1057)
* Rearrange BinaryCache call sites

* Restore only_downloads behavior

* Address PR comment

* Avoid recomputing ABIs in set-installed
2023-05-08 13:44:24 -07:00
Billy O'Neal 123d66de41
Add x-update-registry command. (#1053)
* Add x-update-registry command.

Docs submitted as https://github.com/microsoft/vcpkg-docs/pull/79

* Actually implement --all.

* Get rid of the _UpdatingRegistryDataFrom$.comment edit.
2023-05-08 11:37:21 -07:00
Victor Romero 947239cdfa
[telemetry] Track process tree (#1049)
* [telemetry] track process tree using hashes

* send metrics

* error handling

* fix tests

* Fix process handle leak

* Fix non-Windows build

* Use CreateToolhelp32Snapshot API

* Track process tree on Linux

* PR comments

* Handle parenthesis in stat file + add tests

* Apply suggestions from code review

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

---------

Co-authored-by: Billy O'Neal <bion@microsoft.com>
2023-05-05 16:45:32 -07:00
dan-shaw 054ba3f5b1
telemetry: track actions environmental variable (#1055) 2023-05-05 15:07:51 -07:00
dubejf 93e42aeca7
Provide better diagnostics to non-admin users of 'integrate install'. (#1036) 2023-05-02 21:47:48 +00:00
Billy O'Neal 1cc66b5371
Use size_t for indents rather than int. (#1045)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
2023-05-02 21:47:33 +00:00
autoantwort c87e471e99
Add missing output to stdout log (#1047) 2023-05-02 11:14:09 -07:00