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

**URL:** https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387
**Category:** Usage
**Created:** [December 12, 2025, 1:40pm UTC](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387 "2025-12-12T13:40:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![theoractice](https://discourse.cmake.org/user_avatar/discourse.cmake.org/theoractice/32/5940_2.png) [@theoractice](https://discourse.cmake.org/u/theoractice)
#### Post date: [December 12, 2025, 1:40pm UTC](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387/1 "2025-12-12T13:40:21Z")

</div>

vcpkg’s Error message:

```auto
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](https://github.com/microsoft/vcpkg/issues/48699)

And if you search ‘tar xjf’ in vcpkg’s issue list, you can see many similar [issues](https://github.com/microsoft/vcpkg/issues?q=is%253Aissue%20tar%20xjf).

Any ideas?

---

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [December 12, 2025, 2:16pm UTC](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387/2 "2025-12-12T14:16:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![theoractice](https://discourse.cmake.org/user_avatar/discourse.cmake.org/theoractice/32/5940_2.png) [@theoractice](https://discourse.cmake.org/u/theoractice)
#### Post date: [December 12, 2025, 8:10pm UTC](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387/3 "2025-12-12T20:10:28Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

### Author: ![theoractice](https://discourse.cmake.org/user_avatar/discourse.cmake.org/theoractice/32/5940_2.png) [@theoractice](https://discourse.cmake.org/u/theoractice)
#### Post date: [December 15, 2025, 7:45pm UTC](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387/4 "2025-12-15T19:45:38Z")

</div>

`tar xf` works totally fine with `tar` from git:

```auto
tools\git-2.7.4-windows\usr\bin\tar xf microsoft-onnxruntime-v1.23.2.tar.gz

```

Maybe CMake should also update its own `tar`.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 9, 2026, 5:15am UTC](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387/5 "2026-02-09T05:15:57Z")

</div>

CMake uses `libarchive`. Are they these files? [Releases · microsoft/onnxruntime · GitHub](https://github.com/microsoft/onnxruntime/releases)
