Open jonahbeckford opened 1 year ago
The third option (at least for opam itself) is ocaml-tar: i.e. we avoid using an external program completely. There's various other reasons for wanting to do that for performance - most especially, it would allow us to process index.tar.gz
without having to blat tens of thousands of small files on NTFS...!
The essential problem is that dangling symlinks are not supported in MSYS2 (and sometimes not in Cygwin), and symlinks in general aren't portable in native Windows. Simply based on the order of tar members in
url { src: ".../xyz.tar.gz" }
a symlink can become a dangling symlink.This is a tricky problem. One instance is https://github.com/thierry-martinez/stdcompat/issues/27 which has full details.
One solution was the PR I did in https://github.com/ocaml/opam/pull/4813. That did two passes for
tar
... the first would do everything except the symlinks and the second pass would do all the files. But somehow or for some reason that didn't make it into the code base. https://github.com/ocaml/opam/compare/2b60006117b116612138929e5e1059189e86f96f..7d40698858f27b9d9b01e0183c882a76d04398ce#diff-e9267480037ccaf8a2614178ed1aa887d1ae3e6cd5d986a62a420f5a61344fa3L613-L652 was that solution.My PR above is specific to MSYS2 and slow. An alternative solution is to fix the tar archives during
opam publish
anddune-release
.