Failing to create tar archive inside Windows Docker container (cmake -E tar)
I'm trying to compile simple program with CMake (using Hunter as package manger) in the windows Docker container, but it failing every time with following error archive_write_header: Can't record entry in tar file without pathname
.
It looks like there is a bug in cmake -E tar
command execution.
Versions
- Docker version 19.03.5, build 633a0ea
- cmake version 3.16.0
Environment
PS C:\> Get-WinSystemLocale
LCID Name DisplayName
---- ---- -----------
1033 en-US English (United States)
Steps to reproduce
Commands on host:
docker run -it --rm mcr.microsoft.com/dotnet/framework/sdk:4.8
Commands inside Docker container:
powershell
wget https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0-win64-x64.zip -UseBasicParsing -OutFile C:\cmake.zip
Expand-Archive -Path "cmake.zip" -DestinationPath "c:\"
C:\cmake-3.16.0-win64-x64\bin\cmake.exe -E tar "cv" C:\cmake.tar -- C:\cmake.zip
Results:
PS C:\> C:\cmake-3.16.0-win64-x64\bin\cmake.exe -E tar "cv" C:\cmake.tar -- C:\cmake.zip
cmake.zip
CMake Error: archive_write_header: Can't record entry in tar file without pathname
CMake Error: Problem creating tar: C:\cmake.tar
PS C:\>
This error reproduced with any file which I tried to compress.
Edited by Konstantin G