Skip to content

Commit

Permalink
Add and use manifest file to force use of utf-8 encoding for executab…
Browse files Browse the repository at this point in the history
…les.
  • Loading branch information
ni4 committed Nov 9, 2024
1 parent 4395bc6 commit add3e05
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/windows-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ jobs:
- name: Build
run: cmake --build build --config "Release" --parallel ${{ env.CORES }}

- name: Find Visual Studio root via vswhere
shell: cmd
run: |
FOR /F "delims=" %%i in ('C:\ProgramData\Chocolatey\bin\vswhere.exe -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath') DO SET "VS_PATH=%%i"
echo "Detected Visual Studio path: %VS_PATH%"
echo VS_PATH=%VS_PATH%>> "%GITHUB_ENV%"
- name: Test
run: |
# Change codepage to utf-8
Expand Down Expand Up @@ -164,6 +171,19 @@ jobs:
export PYTHONUTF8=1
export PATH="$PWD/build/src/lib:$PATH"
export RNP_LOG_CONSOLE=1
# Add mt.exe (manifest tool) to PATH
vsp=$(cygpath -u "${VS_PATH}")
ts_ver=$(<"$vsp/VC/Auxiliary/Build/Microsoft.VCToolsVersion.v143.default.txt")
lib_dir="${vsp}/VC/Tools/MSVC/${ts_ver}/bin/Hostx64/x64"
if [[ ! -d "$lib_dir" ]]; then
echo "Looks like directory with sanitizer libs changed from ${lib_dir}. Available ones:"
ls -la "${vsp}/VC/Tools/MSVC"
exit 1
fi
export PATH=$lib_dir:$PATH
# Add manifest which forces utf-8 encoding
pwd
mt.exe -manifest ./ci/utf8-manifest -outputresource:./build/src/tests/rnp_tests;1
ctest --test-dir build -C Debug -V -R rnp_tests.test_windows_unicode || true
ctest --parallel ${{ env.CORES }} --test-dir build -C Debug --output-on-failure -R rnp_tests.test_cli_rnpkeys_unicode
Expand Down
7 changes: 7 additions & 0 deletions ci/utf8-manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">
<activeCodePage>UTF-8</activeCodePage>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

0 comments on commit add3e05

Please sign in to comment.