cmake 3.31.10 fails to unzip using '-E tar xjf' in vcpkg

vcpkg’s Error message:

Command failed: D:/Coding/vcpkg/downloads/tools/cmake-3.31.10-windows/cmake-3.31.10-windows-x86_64/bin/cmake.exe -E tar xjf D:/Coding/vcpkg/downloads/microsoft-onnxruntime-v1.23.2.tar.gz

See the related issue here

And if you search ‘tar xjf’ in vcpkg’s issue list, you can see many similar issues.

Any ideas?

‘j’ is for bzip2, why is that used for a .tar.gz?

I have found the cause:
In the tar.gz file, there is a folder named microsoft-onnxruntime-v1.23.2.tar.gz\onnxruntime-1.23.2\winml\test\collateral\models\UnicodePath\こんにちは maçã.

If you extract it directly from the console using tar xjf microsoft-onnxruntime-v1.23.2.tar.gz, there is no error, but the folder name becomes 銇撱倱銇仭銇_ma莽茫. So, xjf actually works, but the handling of Unicode paths is not perfect.

If you extract it using cmake-3.31.10-windows-x86_64/bin/cmake.exe -E tar xjf microsoft-onnxruntime-v1.23.2.tar.gz, you will encounter errors like:

CMake Error: Problem with archive_write_header(): Invalid empty pathname
CMake Error: Current file:
CMake Error: Problem extracting tar: microsoft-onnxruntime-v1.23.2.tar.gz

I still don’t know how to bypass this error in the CMake context.