microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.9k stars 6.32k forks source link

Random failures in extraction on Mac + Docker #40615

Open diehard2 opened 1 month ago

diehard2 commented 1 month ago

Describe the bug In a bind mount between a Mac directory (M3) and Docker (using Colima) I occasionally get the following errors on random ports

Problem with archive_write_finish_entry(): Can't restore time

This is seen in zstd. In particular it is having trouble with symbolic links in the archive. However I have seen it in other archives that do not have symbolic links, but I haven't dug any further.

Environment

To Reproduce Steps to reproduce the behavior:

  1. bind a directory from mac to a docker container (almalinux 8.9 in my case)
  2. vcpkg install zstd

Expected behavior The archive would extract correctly

Failure logs Problem with archive_write_finish_entry(): Can't restore time

Additional context It looks like cmake rolled their own version of tar that can't handle time stamps that are incorrect. The system tar does handle this correctly with the -m flag. I have fixed this locally by patching vcpkg with

COMMAND /usr/bin/tar -mxzf "${arg_ARCHIVE}"

in line 122 of vcpkg-src/scripts/cmake/vcpkg_extract_source_archive.cmake

would be nice to switch to the official system tar, although I recognize this is most likely a colima bug (and I'll report there also)

MonicaLiu0311 commented 3 weeks ago

Sorry for the late reply, could you provide the specific error log? I would like to compare it with #28527.