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.
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>
* 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.
* 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>
* 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
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
```
* 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'.
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>
* 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.
* 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