Windows 上的 tar 无法从存档中提取符号链接

Windows 上的 tar 无法从存档中提取符号链接

尝试使用 vcpkg 安装 GTK 时无法提取libexpat-libexpat-R_2_2_6.tar.gz

Building package expat[core]:x64-windows...
-- Downloading https://github.com/libexpat/libexpat/archive/R_2_2_6.tar.gz...
-- Extracting source C:/Users/USER/git/vcpkg/downloads/libexpat-libexpat-R_2_2_6.tar.gz
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
    Command failed: C:/Program Files/CMake/bin/cmake.exe;-E;tar;xjf;C:/Users/USER/git/vcpkg/downloads/libexpat-libexpat-R_2_2_6.tar.gz
    Working Directory: C:/Users/USER/git/vcpkg/buildtrees/expat/src/TEMP
    Error code: 1
    See logs for more information:
      C:\Users\USER\git\vcpkg\buildtrees\expat\extract-err.log

提取错误日志:

CMake Error: Problem with archive_write_header(): Can't create ''
CMake Error: Current file: libexpat-R_2_2_6/README.md
CMake Error: Problem extracting tar: C:/Users/USER/git/vcpkg/downloads/libexpat-libexpat-R_2_2_6.tar.gz

手动运行 tar 的结果是:

> tar xjf C:/Users/USER/git/vcpkg/downloads/libexpat-libexpat-R_2_2_6.tar.gz
libexpat-R_2_2_6/README.md: Can't create '\\\\?\\C:\\Users\\USER\\git\\vcpkg\\buildtrees\\expat\\src\\TEMP\\libexpat-R_2_2_6\\README.md'
tar: Error exit delayed from previous errors.

版本:

  • Microsoft Windows [版本 10.0.17763.437]
  • cmake 版本 3.14.2
  • bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f-ipp
  • vcpkg 2018.11.23-nohash(提交 0907798)

编辑:

tar 错误是预期出现的,问题出现在 cmake 中,预期输出(参见 extract-err.log)应该是:

cmake -E tar: warning: skipping symbolic link "libexpat-R_2_2_6/README.md" -> "expat/README.md".

编辑:

看起来这是一个活跃的 cmake 问题https://gitlab.kitware.com/cmake/cmake/issues/19102

答案1

Alexej Harm 发现了导致此问题的设置https://gitlab.kitware.com/cmake/cmake/issues/19102#note_558431

需要取消勾选 intl.cpl > 管理 > 更改系统区域设置... 中的 UTF-8 beta,以使 cmake (3.14.2) 正常运行。

相关内容