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

1340 Коммитов

Автор SHA1 Сообщение Дата
Billy O'Neal 829b20e144
Add "maybe" operations to JSON. (#1520)
Extracted from https://github.com/microsoft/vcpkg-tool/pull/1514
2024-10-23 14:57:27 -07:00
Billy O'Neal 76ca355da5
Allow constexpr optionals. (#1509)
Extracted from https://github.com/microsoft/vcpkg-tool/pull/1490/ as it's unclear when that change will land.
2024-10-23 11:35:54 -07:00
Billy O'Neal dc69ae8bdd
Add a better error message for unlimited argument commands. (#1515)
Before / after:

```console
PS D:\vcpkg\test> ..\vcpkg.exe new --application
PS D:\vcpkg\test> ..\vcpkg.exe add rapidjson
error: the command 'add' requires between 2 and 18446744073709551615 arguments, inclusive, but 1 were provided
[...]

PS D:\vcpkg\test> D:\vcpkg-tool\out\build\Win-x64-Debug-WithArtifacts\vcpkg.exe add rapidjson
error: the command 'add' requires at least 2 arguments, but 1 were provided
```
2024-10-17 18:57:34 -07:00
data-queue 67931f1ae7
Support Azure universal packages as a binary caching provider (#1491)
* add universal support

* fix

* fix

* review

* review

* fix
2024-10-17 18:14:39 -07:00
Billy O'Neal ab8988503c
x-add-version: Check that port-version is the next integer (#1495) 2024-09-30 12:55:55 -07:00
Billy O'Neal 48946f6a7f
Improve diagnostics when an invalid triplet name is supplied. (#1497)
* Improve diagnostics when an invalid triplet name is supplied.

This fixes a regression introduced in https://github.com/microsoft/vcpkg-tool/pull/1474 where an error message is added but the corresponding text being parsed is not. This was reported as https://github.com/microsoft/vcpkg/issues/41143

* Fix the unit tests for "hypens" 😅

* Fix comment for changed variable name
2024-09-30 12:54:53 -07:00
Billy O'Neal c16c0262f1
Remove unnecessary use of std::array (#1496)
std::array is actually not that cheap to compile and we did not really need it in these cases. ( https://raw.githubusercontent.com/ned14/stl-header-heft/master/graphs/msvs-2019.png )
2024-09-24 13:29:40 -07:00
Javier Matos Denizac a47c79f0c0
Use 7zr to unpack 7zip (#1477)
* first take, use 7zr to unpack 7za instead of cmake, remove cmake dance

* fix merge issues

* fix unit tests

* update vcpkg-scripts-sha.txt

* update vcpkg-scripts-sha.txt

* fix self extracting

* use 7zr for zip formats as well

* undo zip

* use cmake for tar since 7zr needs to unpack twice for .tar.gz

* undo changes to tar

* use cmake for tar decompression

* update vcpkg-scripts-sha

* Make the upgrade test always use the current vcpkgTools.xml.

* use 7zr for zip

* 7zr doesn't work on zip formats

---------

Co-authored-by: Javier Matos <javiermatos@Javiers-Laptop.local>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2024-09-17 16:32:13 -04:00
Billy O'Neal a65b710faf
Preserve the full exit code range in the system.process layer. (#1489)
Resolves a recent concern raised internally where tar.exe failed with some exit code that was larger than INT_MAX which got smashed by:

ee9a254511/src/vcpkg/base/system.process.cpp (L1426)
2024-09-12 20:15:12 -07:00
Victor Romero ee9a254511
Add `devdeviceid` telemetry (#1480) 2024-09-10 15:05:49 -07:00
autoantwort d3fc35774f
Keep all CUDA_PATH_* environment variables when forming the clean environment on Windows (#1476) 2024-09-03 12:14:49 -07:00
Victor Romero b8b3c1b31e
Make comparison of installed files case-insensitive (#1483) 2024-08-28 22:54:17 +00:00
Billy O'Neal 33fe38d1ee
Fix doubled warnings being printed for manifest warnings when loading ports. (#1466) 2024-08-03 00:42:35 -07:00
Benjamin Hodgson 54b6a6ee0d
Fix grammar in HashPortManyFiles warning message (#1467) 2024-07-30 13:40:23 -07:00
Alexander Neumann 88ee9316f5
Add VCPKG_POST_PORTFILE_INCLUDES (#1417) 2024-07-25 13:53:34 -07:00
WangWeiLin-MV 998c893164
Fix package pattern in json schema configuration registry (#1429) 2024-07-25 13:40:53 -07:00
Billy O'Neal c427992d33
Fix several console output nitpicks. (#1461)
* In https://github.com/microsoft/vcpkg-tool/pull/1455 I missed making absolute lowercase.
* In https://github.com/microsoft/vcpkg-tool/pull/1408 a lot of whitespace was missed leading to output like

error: building vtk:x64-linux failed with: BUILD_FAILEDSee https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
2024-07-24 10:53:21 -07:00
Billy O'Neal dce67b35a6
Make print_plan actually print. (#1415)
print_plan does 2 things. First, it formats the action plan and prints it to the console. Second, if there were removals in the plan and the intent is not recursive, it terminates vcpkg. A function named 'print' should not be terminating vcpkg.

Moreover, only one caller actually desires this terminating behavior: the install command. All other users hard coded a value of true.

This suggests that the decision to terminate should be localized to that one caller rather than spread over everything.
2024-07-23 13:48:32 -07:00
Billy O'Neal 2347a7b08d
Restore printing full paths to files containing absolute paths. (#1455)
@autoantwort points out that it makes sense for those to be clickable.

He also wants us to drop the note: prefix from newlines if we aren't attached to a tty; I'm not sure if that is correct.
2024-07-23 13:47:56 -07:00
Kefu Chai d67080fb00
Update fmt to v11.0.2 (#1457)
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2024-07-23 20:47:25 +00:00
autoantwort bf8aee5c1d
Http binary cache: One must use the {sha} variable if other variables are used. (#1459) 2024-07-23 11:09:21 -07:00
myd7349 bbb031821c
Fix export command usage (#1450) 2024-07-09 10:23:21 -07:00
Javier Matos Denizac 9eb99f74cd
Clarify asset caching output (#1409) 2024-07-05 22:18:13 -07:00
Kai Pastor b749be76fe
Raise errors for malformed overlay port manifests (#1435)
* Test ci command on malformed port manifests

* Test ci command on individual malformed port manifest

* Pass overlay port errors to OverlayProviderImpl

* Move broken-manifest overlay ports into separate dir

"e2e-ports/overlays" is in common vcpkg test args. It must not contain
ports with broken manifests where the the tool is expected to report the
error.

The tests which need these broken ports already passed an explicit
"--overlay-ports" argument which duplicated the one in @commonArgs.
That is why this commit only changes the value of the explicit argument.

* Ensure that inactive feature can have broken dependencies
2024-07-05 23:10:58 +00:00
Javier Matos Denizac dfc8c0f00e
Add Campaign IDs (#1408) 2024-06-24 11:31:37 -07:00
Billy O'Neal 779ab31a43
Teach x-ci-verify-versions to check that versions exist in the database (#1210) 2024-06-21 17:15:37 -07:00
Billy O'Neal 73b8645012
Update clang-format to 18.1.6. (#1433) 2024-06-13 20:31:54 -07:00
Billy O'Neal 8014d4b938
Ensure that all post-build checks have skip policies. (#1405)
Also audited for:
* Consistently following the 'IDE error format' pointing to portfile.cmake.
* Consistently referring to the correct skip policy in the error message where applicable.
* Printing paths and other information relative to ${CURRENT_PACKAGES_DIR} or similar as appropriate.
* Debug before release.
* Don't duplicate messages when a problem happens for both debug and release.

Drive by bugfix:

    if (!build_info.policies.is_enabled(BuildPolicy::ONLY_RELEASE_CRT))
    {
        error_count += check_crt_linkage_of_libs(
            build_info, false, debug_libs, debug_lib_info.value_or_exit(VCPKG_LINE_INFO), msg_sink);
    }

was wrong; ONLY_RELEASE_CRT should mean 'these should all be release', not 'we aren't even going to look at debug'.

It is fixed to:

    error_count += check_crt_linkage_of_libs(build_info.crt_linkage,
                                              build_info.policies.is_enabled(BuildPolicy::ONLY_RELEASE_CRT),
                                              debug_libs,
                                              debug_lib_info.value_or_exit(VCPKG_LINE_INFO),
                                              msg_sink);

here.

Drive-by bugfix:
EMPTY_INCLUDE_FOLDER should not block CMAKE_HELPER_PORT from checking that the include folder is, in fact, empty.

Drive-by bugfix:
        if (!violations.empty())
        {
            msg_sink.println_warning(msgPortBugRestrictedHeaderPaths);
            print_paths(msg_sink, violations);
            msg_sink.println(msgPortBugRestrictedHeaderPaths);     // <-- duplicate!
            return LintStatus::PROBLEM_DETECTED;
        }

Drive-by bugfix:
There were duplicate checks for the lib/cmake and debug/lib/cmake directories which even printed the same message; these have been merged.

Drive-by bugfix:
The existing copyright check emitted nonsense output that included full absolute paths like:
warning: The software license must be available at ${CURRENT_PACKAGES_DIR}/share/cmdline/copyright. vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/D:/b/cmdline//LICENSE")
since at least https://github.com/microsoft/vcpkg-tool/pull/1116/
That check has been basically rewritten to use vcpkg_install_copyright if there's only one src directory, and otherwise give up and print them all

Drive-by bugfix:
Several of the outdated CRTs didn't have the debug versions listed. Also, P was duplicated and there was no R for VC6.
2024-06-07 16:53:59 -07:00
Thomas1664 1e08aaa7e7
Combine multiple prints to a single one (#1396) 2024-06-06 18:26:56 -07:00
Billy O'Neal 7db75d6c97
Remove BuildPackageOptions from the ActionPlan (#1339)
* Eliminate PurgeDecompressFailure.

PurgeDecompressFailure causes the files backend for binary caching to delete the zip file if it fails to decompress. The install command set this to false due to a race consideration: it's possible that a partially uploaded zip is observed when the files backend is pointed to a network share, and deleting the file because we failed to decompress it just stomps on another builder sharing that same binary cache.

It seems incorrect that this reasoning would not apply to any other commands, but most of the other commands said PurgeDecompressFailure::Yes.

This change removes the option entirely in favor of the 'No' behavior.

* Do not redundantly set Editable or Use Head to false in manifest mode.

These are already implied by the blockers on line 1075 and 1080.

* While reviewing changes to https://github.com/microsoft/vcpkg-tool/pull/1339 , I observed that it was strange that the abi hash depends on whether download_only is selected. After discussion with @ras0219-msft , he agreed that the ABI hash shouldn't be affected by this setting.

However, given that in download mode, we intentionally build things which do not have all their dependencies present, it would not be safe to attempt to cache or otherwise install anything in that condition.

This change removes download_only from the ABI calculation, and changes installation to only attempt to install built bits whose dependencies are all satisfied.
2024-04-29 18:50:01 -07:00
Billy O'Neal 28a4083482
Soften the 'use version rather than version-string' message. (#1367)
In https://github.com/microsoft/vcpkg/pull/37563#discussion_r1536452701 we have an example of versions which meet the semantic versioning format but don't sort like semantic versions, so the message:

```console
PS D:\vcpkg> .\vcpkg.exe x-add-version sqlite-modern-cpp
Use the version scheme "version" rather than "version-string" in port "sqlite-modern-cpp".
Use --skip-version-format-check to disable this check.
```

is too strong. We need to explain to the user that they should only do that if the versions actually are intended to sort that way.
2024-04-29 13:56:20 -07:00
Billy O'Neal 62ef0300fe
Avoid curl command line length limits (#1390) 2024-04-22 14:14:05 -07:00
Thomas1664 1603ecb4ff
[postbuildlint] Don't read lib info twice (#1384) 2024-04-16 19:50:58 +00:00
Javier Matos Denizac 296a34e6cd
Add "verify-messages" target (#1372)
* should be forward slashes

* add script to check for unused messages

* add messages check to pr workflow

* error if unused messages

* dont print every message every time

* remove bogus comment

* remove bogus comment

* remove bogus comment (again)

* Remove timer; add word boundry to regex;merge format and very messages job in pr.yaml

* Use JSON files instead of REGEX to declare messages

* pass artifact messages as argument

* filter out empty from unused messages

* filter out empty from unused messages

* infer path from PSScriptRoot; reuse configure in format job

* remove unused messages

* add new line at the end of ps script

* remove unused messages

* try something

* add messages.json again

---------

Co-authored-by: Javier Matos <javiermatos@Javiers-Laptop.local>
Co-authored-by: Javier Matos <javiermatos@Javiers-Laptop.lan>
2024-04-10 19:50:55 -04:00
Billy O'Neal 82852302ac
Disable experimental boyer_moore_horspool_searcher. (#1375)
This should have the effect of disabling this on macOS which hopefully fixes the Python2 hang.

Related: https://github.com/microsoft/vcpkg-tool/pull/1255
2024-03-28 16:57:24 -07:00
Thomas1664 de85ec90b8
Paths in PrebuildInfo should be `Path` instead of `std::string` (#1366)
Co-authored-by: autoantwort <41973254+autoantwort@users.noreply.github.com>
2024-03-25 16:32:13 -07:00
Billy O'Neal 086859d80e
Remove for/if antipattern in PreBuildInfo::PreBuildInfo. (#1362)
The for loop starting on 1798 looked up each entry from its associated table, then had an individual if for each entry in the table. As a result, it wasn't truly being data driven since there was an if for each entry in the table. Moreover, the table had a circular dependency with the code since LOAD_VCVARS_ENV had to come after CHAINLOAD_TOOLCHAIN_FILE. I assume this was done to deduplicate the work of figuring out if the value was set since that is the common block at the top of the loop. Instead of the for/if antipattern I solved that problem by extracting functions.

The function Util::assign_if_set_and_nonempty preserves the table-like behavior for those values which are simple assignments as much as possible. The function Util::value_if_set_and_nonempty is used for the settings that needed additional work.
2024-03-20 17:03:00 -07:00
Alexander Neumann 23305650b8
Introduce VCPKG_HASH_ADDITIONAL_FILES (#797)
* fix warnings

* WIP VCPKG_HASH_ADDITIONAL_FILES

* cleanup

* e2e test

* more cleanup

* appyl format

* enable e2e test on linux and osx

* Fail CI if unsuccesful

* use TARGET_TRIPLET var

* remove ps assignment

* fix e2e

* remove trailing ,

* make test run on other platforms

* Apply suggestions from code review

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>

* Fix e2e test after CR

* fix syntax errors

* add failure if the file path is relative or not a regular file.

* format and logic fix

* fix format

* fix logic.

* Apply suggestions from code review

- fix typo
- rephrase description sentence

Co-authored-by: Victor Romero <romerosanchezv@gmail.com>

* Rephrase description

* Make the failure case actually capture output

* Apply format change

* Test-Match is only available for artifact tests

---------

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Victor Romero <romerosanchezv@gmail.com>
2024-03-19 16:16:07 -07:00
Billy O'Neal fa20b09e2d
Make --only-downloads not affect ABI (#1363)
While reviewing changes to https://github.com/microsoft/vcpkg-tool/pull/1339 , I observed that it was strange that the abi hash depends on whether download_only is selected. After discussion with @ras0219-msft , he agreed that the ABI hash shouldn't be affected by this setting.

However, given that in download mode, we intentionally build things which do not have all their dependencies present, it would not be safe to attempt to cache or otherwise install anything in that condition.

This change removes download_only from the ABI calculation, and changes installation to only attempt to install built bits whose dependencies are all satisfied.
2024-03-12 12:44:18 -07:00
Billy O'Neal 324c38bef5
"<unknown>" and "<command>" are not origins (#1346) 2024-03-08 17:07:16 -08:00
Billy O'Neal 06553af9c1
Deduplicate even more things (#1359) 2024-03-08 17:06:35 -08:00
Nick Renieris 56b4a5bc12
binarycaching: Set `BinaryProviders::nuget_repo` & remove unused field (#1360)
The former wasn't getting set anywhere even though `BinaryCache::push_success()` uses it.

Also remove unused `BinaryConfigParserState::nuget_repo_info` field.
2024-03-06 18:43:00 -08:00
data-queue 13fd7ab03f
Print path to compiler in output (#1328)
* print compiler path

* update messages.json

* fix empty message

* fix format

* add tests and fix

* update vcpkg to latest commit

* fix

* fix

* Fix e2e test on Windows.

* Change scripts SHA to not include https://github.com/microsoft/vcpkg/pull/36056

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2024-03-04 14:59:49 -08:00
Billy O'Neal 05f88ed2d0
Deduplicate string literals. (#1355) 2024-03-01 18:35:08 -08:00
Billy O'Neal c05f470eb2
Accept arbitrary version formats in overrides. (#1329)
* Accept arbitrary version formats in overrides.

We accidentally implemented the overrides deserializer to reject non-relaxed-versions in "overrides", despite the original intent that overrides are scheme-less. Note how the original schema:

https://github.com/microsoft/vcpkg-tool/pull/1209

, and original documentation:

https://github.com/microsoft/vcpkg-docs/pull/159

said everything should be accepted here.

Also fix our example printing when we're asking users to add overrides to ensure it is valid JSON.

* Implement preferring putting the port-version into the version text.

* Rename GenericVersionDeserializer to BaselineVersionTagDeserializer.
2024-03-01 22:40:33 +00:00
Billy O'Neal 0fcbb7d9ff
Remove the default triplet warning. (#1351) 2024-02-27 13:34:48 -08:00
Billy O'Neal 42dbe07290
Consistently ensure the word 'overlay' is printed when talking about overlays. (#1345) 2024-02-20 17:25:58 -08:00
Billy O'Neal 05320e4944
Try to fix macOS hang when building Python 2 (#1343) 2024-02-14 17:07:19 -08:00
Billy O'Neal bdbd8dcf04
Use less shouty enums. (#1336)
I observed that some of our enum classes like DryRun use PascalCase like most of our type names, and others used ALL_CAPS_SNAKE_CASE. I resolved in favor of PascalCase since enum classes are already prefixed and thus unworried about conflicts.
2024-02-01 10:47:15 -08:00
Billy O'Neal 910db8b0bb
Eliminate ParseError. (#1322)
* Eliminate ParseError.

Another pseudo-extraction from https://github.com/microsoft/vcpkg-tool/pull/1210 ; this means that ExpectedL is the only ExpectedT that exists.

* MessageMap
2024-01-26 13:45:58 -08:00