libarchive
libarchive copied to clipboard
Can not unpack archive with link to the partition, that does not support links
I originally reported to cmake, as problem was with unpacking of archive by cmake, but I got information from them , that cmake uses lib archive library and recommend report to this project.
I build project on Windows using cmake (and your library), and this project unpacked library to current drive. Process unpacking failed on unpacking file with hard link, because current drive was network drive with PrlSF filesystem (network drive mapped by Parallels to virtual machine Windows 10). Windows support hard links on NTFS, but not on all kind of network drives. Could you fix it? If hard link is not supported by filesystem, software should create this file as usual file.
I have demo , prepared for cmake:
Windows 10, 64 bits. run as virtual machine on Mac Os X Monterey under Parallels version 17. Drive C: NTFS filesystem Drive Z: PrlSF filesystem - network filesystem mapped by Parallels from MacOsX partition. cmake 3.27. Example of failed script:
cmake_minimum_required(VERSION 3.27)
project(test_archive_exctract)
set(ARCHIVE_WITH_LINK_URL https://mirror.msys2.org/msys/x86_64/binutils-2.40-1-x86_64.pkg.tar.zst)
set(ARCHIVE_WITH_LINK_PATH ${CMAKE_BINARY_DIR}/binutils-2.40-1-x86_64.pkg.tar.zst)
set(ARCHIVE_WITH_LINK_PATH_OUT ${CMAKE_BINARY_DIR}/binutils)
file(DOWNLOAD ${ARCHIVE_WITH_LINK_URL} ${ARCHIVE_WITH_LINK_PATH} INACTIVITY_TIMEOUT 10)
file(ARCHIVE_EXTRACT INPUT "${ARCHIVE_WITH_LINK_PATH}" DESTINATION "${ARCHIVE_WITH_LINK_PATH_OUT}" )
Save code to CMakeLists.txt and run
cmake .
If archive contains the file, added as link, the command file(ARCHIVE_EXTRACT ...) failed to extract this file and remaining archive (ld.exe in this example) on network drive. Extract to NTFS drive (and native Unix drive under Unix script) work OK.
The example script is the extract from ICU (famous internationalisation and localisation library) installation package on Windows. binutils file is compiler tools necessary to build ICU data.