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.
We have no reason to build vcpkg as arm64ec, but the C++ compiler team have asked us to make this work since they use us as a test case.
Unfortunately, CMake's defaults ( https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/Platform/Windows-MSVC.cmake#L243 ) take the pretty names AMD64 and ARM64EC which we use in the COFF file reader. This removes those defines.
* 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
```