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
```
* 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>
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.
@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.
* 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
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.
* 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.
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.
* 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>
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.
* 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>
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.
The former wasn't getting set anywhere even though `BinaryCache::push_success()` uses it.
Also remove unused `BinaryConfigParserState::nuget_repo_info` field.
* 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>
* 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.
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.